Fix typos in variable names and comments
Change-Id: I361916cc18c67e72fbfdbb4b6547f80a5d098327
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
||||
"io"
|
||||
)
|
||||
|
||||
// Container interface abstracion for continer.
|
||||
// Container interface abstraction for container.
|
||||
// Particular implementation depends on container runtime environment (CRE). Interface
|
||||
// defines methods that must be implemented for CRE (e.g. docker, containerd or CRI-O)
|
||||
type Container interface {
|
||||
@@ -17,7 +17,7 @@ type Container interface {
|
||||
}
|
||||
|
||||
// NewContainer returns instance of Container interface implemented by particular driver
|
||||
// Returned instance type (i.e. implementation) depends on driver sceified via function
|
||||
// Returned instance type (i.e. implementation) depends on driver specified via function
|
||||
// arguments (e.g. "docker").
|
||||
// Supported drivers:
|
||||
// * docker
|
||||
|
||||
@@ -58,7 +58,7 @@ type DockerClient interface {
|
||||
string,
|
||||
container.WaitCondition,
|
||||
) (<-chan container.ContainerWaitOKBody, <-chan error)
|
||||
// ContainerLogs returns the logs generated by a continer in an
|
||||
// ContainerLogs returns the logs generated by a container in an
|
||||
// io.ReadCloser.
|
||||
ContainerLogs(
|
||||
context.Context,
|
||||
@@ -166,7 +166,7 @@ func (c *DockerContainer) getConfig(
|
||||
return cCfg, hCfg
|
||||
}
|
||||
|
||||
// getImageId return ID of continer image specified by URL. Method executes
|
||||
// getImageId return ID of container image specified by URL. Method executes
|
||||
// ImageList function supplied with "reference" filter
|
||||
func (c *DockerContainer) getImageId(url string) (string, error) {
|
||||
kv := filters.KeyValuePair{
|
||||
@@ -277,11 +277,11 @@ func (c *DockerContainer) RunCommand(
|
||||
// set to false explicitly
|
||||
func (c *DockerContainer) RunCommandOutput(
|
||||
cmd []string,
|
||||
continerInput io.Reader,
|
||||
containerInput io.Reader,
|
||||
volumeMounts []string,
|
||||
envVars []string,
|
||||
) (io.ReadCloser, error) {
|
||||
if err := c.RunCommand(cmd, continerInput, volumeMounts, envVars, false); err != nil {
|
||||
if err := c.RunCommand(cmd, containerInput, volumeMounts, envVars, false); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
@@ -242,13 +242,13 @@ func TestGetId(t *testing.T) {
|
||||
cnt := getDockerContainerMock(mockDockerClient{})
|
||||
err := cnt.RunCommand([]string{"testCmd"}, nil, nil, []string{}, false)
|
||||
require.NoError(t, err)
|
||||
actialId := cnt.GetId()
|
||||
actualId := cnt.GetId()
|
||||
|
||||
assert.Equal(t, "testID", actialId)
|
||||
assert.Equal(t, "testID", actualId)
|
||||
}
|
||||
|
||||
func TestRunCommand(t *testing.T) {
|
||||
imageListeError := fmt.Errorf("Image List Error")
|
||||
imageListError := fmt.Errorf("Image List Error")
|
||||
attachError := fmt.Errorf("Attach error")
|
||||
containerStartError := fmt.Errorf("Container Start error")
|
||||
containerWaitError := fmt.Errorf("Container Wait Error")
|
||||
@@ -277,10 +277,10 @@ func TestRunCommand(t *testing.T) {
|
||||
debug: false,
|
||||
mockDockerClient: mockDockerClient{
|
||||
imageList: func() ([]types.ImageSummary, error) {
|
||||
return nil, imageListeError
|
||||
return nil, imageListError
|
||||
},
|
||||
},
|
||||
expectedErr: imageListeError,
|
||||
expectedErr: imageListError,
|
||||
assertF: func(t *testing.T) {},
|
||||
},
|
||||
{
|
||||
@@ -467,17 +467,17 @@ func TestNewDockerContainer(t *testing.T) {
|
||||
|
||||
assert.Equal(t, tt.expectedErr, actualErr)
|
||||
|
||||
var actualResStuct resultStruct
|
||||
var actualResStruct resultStruct
|
||||
if actualRes == nil {
|
||||
actualResStuct = resultStruct{}
|
||||
actualResStruct = resultStruct{}
|
||||
} else {
|
||||
actualResStuct = resultStruct{
|
||||
actualResStruct = resultStruct{
|
||||
tag: actualRes.tag,
|
||||
imageUrl: actualRes.imageUrl,
|
||||
id: actualRes.id,
|
||||
}
|
||||
}
|
||||
assert.Equal(t, tt.expectedResult, actualResStuct)
|
||||
assert.Equal(t, tt.expectedResult, actualResStruct)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ type ErrEmptyImageList struct {
|
||||
}
|
||||
|
||||
func (e ErrEmptyImageList) Error() string {
|
||||
return "Image List Error. No images filetered"
|
||||
return "Image List Error. No images filtered"
|
||||
}
|
||||
|
||||
// ErrRunContainerCommand returned if container command
|
||||
|
||||
Reference in New Issue
Block a user