mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #44211 from thaJeztah/more_linters_step1
fix (whitespace) formatting in preparation of enabling more linters
This commit is contained in:
commit
8d193d81af
140 changed files with 16 additions and 262 deletions
|
@ -61,5 +61,4 @@ func (v VersionMiddleware) WrapHandler(handler func(ctx context.Context, w http.
|
||||||
ctx = context.WithValue(ctx, httputils.APIVersionKey{}, apiVersion)
|
ctx = context.WithValue(ctx, httputils.APIVersionKey{}, apiVersion)
|
||||||
return handler(ctx, w, r, vars)
|
return handler(ctx, w, r, vars)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -237,7 +237,6 @@ func (br *buildRouter) postBuild(ctx context.Context, w http.ResponseWriter, r *
|
||||||
defer func() { _ = output.Close() }()
|
defer func() { _ = output.Close() }()
|
||||||
|
|
||||||
errf := func(err error) error {
|
errf := func(err error) error {
|
||||||
|
|
||||||
if httputils.BoolValue(r, "q") && notVerboseBuffer.Len() > 0 {
|
if httputils.BoolValue(r, "q") && notVerboseBuffer.Len() > 0 {
|
||||||
_, _ = output.Write(notVerboseBuffer.Bytes())
|
_, _ = output.Write(notVerboseBuffer.Bytes())
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,5 +115,4 @@ func TestAdjustForAPIVersion(t *testing.T) {
|
||||||
if len(spec.TaskTemplate.ContainerSpec.Ulimits) != 0 {
|
if len(spec.TaskTemplate.ContainerSpec.Ulimits) != 0 {
|
||||||
t.Error("Ulimits were not stripped from spec")
|
t.Error("Ulimits were not stripped from spec")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,17 +33,16 @@ func TestStrSliceUnmarshalJSON(t *testing.T) {
|
||||||
"[]": {},
|
"[]": {},
|
||||||
`["/bin/sh","-c","echo"]`: {"/bin/sh", "-c", "echo"},
|
`["/bin/sh","-c","echo"]`: {"/bin/sh", "-c", "echo"},
|
||||||
}
|
}
|
||||||
for json, expectedParts := range parts {
|
for input, expected := range parts {
|
||||||
strs := StrSlice{"default", "values"}
|
strs := StrSlice{"default", "values"}
|
||||||
if err := strs.UnmarshalJSON([]byte(json)); err != nil {
|
if err := strs.UnmarshalJSON([]byte(input)); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
actualParts := []string(strs)
|
actualParts := []string(strs)
|
||||||
if !reflect.DeepEqual(actualParts, expectedParts) {
|
if !reflect.DeepEqual(actualParts, expected) {
|
||||||
t.Fatalf("%#v: expected %v, got %v", json, expectedParts, actualParts)
|
t.Fatalf("%#v: expected %v, got %v", input, expected, actualParts)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -177,7 +177,7 @@ func (is *Source) Resolve(ctx context.Context, id source.Identifier, sm *session
|
||||||
p := &puller{
|
p := &puller{
|
||||||
src: imageIdentifier,
|
src: imageIdentifier,
|
||||||
is: is,
|
is: is,
|
||||||
//resolver: is.getResolver(is.RegistryHosts, imageIdentifier.Reference.String(), sm, g),
|
// resolver: is.getResolver(is.RegistryHosts, imageIdentifier.Reference.String(), sm, g),
|
||||||
platform: platform,
|
platform: platform,
|
||||||
sm: sm,
|
sm: sm,
|
||||||
}
|
}
|
||||||
|
@ -439,7 +439,6 @@ func (p *puller) Snapshot(ctx context.Context, g session.Group) (cache.Immutable
|
||||||
// TODO: Optimize to do dispatch and integrate pulling with download manager,
|
// TODO: Optimize to do dispatch and integrate pulling with download manager,
|
||||||
// leverage existing blob mapping and layer storage
|
// leverage existing blob mapping and layer storage
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// TODO: need a wrapper snapshot interface that combines content
|
// TODO: need a wrapper snapshot interface that combines content
|
||||||
// and snapshots as 1) buildkit shouldn't have a dependency on contentstore
|
// and snapshots as 1) buildkit shouldn't have a dependency on contentstore
|
||||||
// or 2) cachemanager should manage the contentstore
|
// or 2) cachemanager should manage the contentstore
|
||||||
|
|
|
@ -24,7 +24,6 @@ import (
|
||||||
|
|
||||||
// ResolveCacheImporterFunc returns a resolver function for local inline cache
|
// ResolveCacheImporterFunc returns a resolver function for local inline cache
|
||||||
func ResolveCacheImporterFunc(sm *session.Manager, resolverFunc docker.RegistryHosts, cs content.Store, rs reference.Store, is imagestore.Store) remotecache.ResolveCacheImporterFunc {
|
func ResolveCacheImporterFunc(sm *session.Manager, resolverFunc docker.RegistryHosts, cs content.Store, rs reference.Store, is imagestore.Store) remotecache.ResolveCacheImporterFunc {
|
||||||
|
|
||||||
upstream := registryremotecache.ResolveCacheImporterFunc(sm, cs, resolverFunc)
|
upstream := registryremotecache.ResolveCacheImporterFunc(sm, cs, resolverFunc)
|
||||||
|
|
||||||
return func(ctx context.Context, group session.Group, attrs map[string]string) (remotecache.Importer, specs.Descriptor, error) {
|
return func(ctx context.Context, group session.Group, attrs map[string]string) (remotecache.Importer, specs.Descriptor, error) {
|
||||||
|
|
|
@ -295,7 +295,6 @@ func (b *Builder) dispatchDockerfileWithCancellation(parseResult []instructions.
|
||||||
}
|
}
|
||||||
dispatchRequest.state.updateRunConfig()
|
dispatchRequest.state.updateRunConfig()
|
||||||
fmt.Fprintf(b.Stdout, " ---> %s\n", stringid.TruncateID(dispatchRequest.state.imageID))
|
fmt.Fprintf(b.Stdout, " ---> %s\n", stringid.TruncateID(dispatchRequest.state.imageID))
|
||||||
|
|
||||||
}
|
}
|
||||||
if err := emitImageID(b.Aux, dispatchRequest.state); err != nil {
|
if err := emitImageID(b.Aux, dispatchRequest.state); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -104,7 +104,6 @@ func copierFromDispatchRequest(req dispatchRequest, download sourceDownloader, i
|
||||||
imageSource: imageSource,
|
imageSource: imageSource,
|
||||||
platform: platform,
|
platform: platform,
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *copier) createCopyInstruction(sourcesAndDest instructions.SourcesAndDest, cmdName string) (copyInstruction, error) {
|
func (o *copier) createCopyInstruction(sourcesAndDest instructions.SourcesAndDest, cmdName string) (copyInstruction, error) {
|
||||||
|
|
|
@ -64,7 +64,6 @@ func dispatchEnv(d dispatchRequest, c *instructions.EnvCommand) error {
|
||||||
//
|
//
|
||||||
// Sets the maintainer metadata.
|
// Sets the maintainer metadata.
|
||||||
func dispatchMaintainer(d dispatchRequest, c *instructions.MaintainerCommand) error {
|
func dispatchMaintainer(d dispatchRequest, c *instructions.MaintainerCommand) error {
|
||||||
|
|
||||||
d.state.maintainer = c.Maintainer
|
d.state.maintainer = c.Maintainer
|
||||||
return d.builder.commit(d.state, "MAINTAINER "+c.Maintainer)
|
return d.builder.commit(d.state, "MAINTAINER "+c.Maintainer)
|
||||||
}
|
}
|
||||||
|
@ -557,7 +556,6 @@ func dispatchVolume(d dispatchRequest, c *instructions.VolumeCommand) error {
|
||||||
//
|
//
|
||||||
// Set the signal that will be used to kill the container.
|
// Set the signal that will be used to kill the container.
|
||||||
func dispatchStopSignal(d dispatchRequest, c *instructions.StopSignalCommand) error {
|
func dispatchStopSignal(d dispatchRequest, c *instructions.StopSignalCommand) error {
|
||||||
|
|
||||||
_, err := signal.ParseSignal(c.Signal)
|
_, err := signal.ParseSignal(c.Signal)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errdefs.InvalidParameter(err)
|
return errdefs.InvalidParameter(err)
|
||||||
|
|
|
@ -284,7 +284,6 @@ func TestHealthcheckNone(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestHealthcheckCmd(t *testing.T) {
|
func TestHealthcheckCmd(t *testing.T) {
|
||||||
|
|
||||||
b := newBuilderWithMockBackend()
|
b := newBuilderWithMockBackend()
|
||||||
sb := newDispatchRequest(b, '`', nil, NewBuildArgs(make(map[string]*string)), newStagesBuildResults())
|
sb := newDispatchRequest(b, '`', nil, NewBuildArgs(make(map[string]*string)), newStagesBuildResults())
|
||||||
expectedTest := []string{"CMD-SHELL", "curl -f http://localhost/ || exit 1"}
|
expectedTest := []string{"CMD-SHELL", "curl -f http://localhost/ || exit 1"}
|
||||||
|
|
|
@ -139,7 +139,6 @@ func TestCopyRunConfig(t *testing.T) {
|
||||||
// Assert the original was not modified
|
// Assert the original was not modified
|
||||||
assert.Check(t, runConfig != runConfigCopy, testcase.doc)
|
assert.Check(t, runConfig != runConfigCopy, testcase.doc)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func fullMutableRunConfig() *container.Config {
|
func fullMutableRunConfig() *container.Config {
|
||||||
|
|
|
@ -72,7 +72,6 @@ func TestProcessShouldRemoveDockerfileDockerignore(t *testing.T) {
|
||||||
executeProcess(t, contextDir)
|
executeProcess(t, contextDir)
|
||||||
|
|
||||||
checkDirectory(t, contextDir, []string{shouldStayFilename})
|
checkDirectory(t, contextDir, []string{shouldStayFilename})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestProcessNoDockerignore(t *testing.T) {
|
func TestProcessNoDockerignore(t *testing.T) {
|
||||||
|
@ -85,7 +84,6 @@ func TestProcessNoDockerignore(t *testing.T) {
|
||||||
executeProcess(t, contextDir)
|
executeProcess(t, contextDir)
|
||||||
|
|
||||||
checkDirectory(t, contextDir, []string{shouldStayFilename, builder.DefaultDockerfileName})
|
checkDirectory(t, contextDir, []string{shouldStayFilename, builder.DefaultDockerfileName})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestProcessShouldLeaveAllFiles(t *testing.T) {
|
func TestProcessShouldLeaveAllFiles(t *testing.T) {
|
||||||
|
@ -99,7 +97,6 @@ func TestProcessShouldLeaveAllFiles(t *testing.T) {
|
||||||
executeProcess(t, contextDir)
|
executeProcess(t, contextDir)
|
||||||
|
|
||||||
checkDirectory(t, contextDir, []string{shouldStayFilename, builder.DefaultDockerfileName, dockerignoreFilename})
|
checkDirectory(t, contextDir, []string{shouldStayFilename, builder.DefaultDockerfileName, dockerignoreFilename})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: remove after moving to a separate pkg
|
// TODO: remove after moving to a separate pkg
|
||||||
|
|
|
@ -17,7 +17,6 @@ import (
|
||||||
// be sent over the error channel. If an error is sent all processing will be stopped. It's up
|
// be sent over the error channel. If an error is sent all processing will be stopped. It's up
|
||||||
// to the caller to reopen the stream in the event of an error by reinvoking this method.
|
// to the caller to reopen the stream in the event of an error by reinvoking this method.
|
||||||
func (cli *Client) Events(ctx context.Context, options types.EventsOptions) (<-chan events.Message, <-chan error) {
|
func (cli *Client) Events(ctx context.Context, options types.EventsOptions) (<-chan events.Message, <-chan error) {
|
||||||
|
|
||||||
messages := make(chan events.Message)
|
messages := make(chan events.Message)
|
||||||
errs := make(chan error, 1)
|
errs := make(chan error, 1)
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,6 @@ func TestEventsErrorFromServer(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestEvents(t *testing.T) {
|
func TestEvents(t *testing.T) {
|
||||||
|
|
||||||
expectedURL := "/events"
|
expectedURL := "/events"
|
||||||
|
|
||||||
filters := filters.NewArgs()
|
filters := filters.NewArgs()
|
||||||
|
|
|
@ -325,7 +325,6 @@ func newRouterOptions(config *config.Config, d *daemon.Daemon) (routerOptions, e
|
||||||
|
|
||||||
func (cli *DaemonCli) reloadConfig() {
|
func (cli *DaemonCli) reloadConfig() {
|
||||||
reload := func(c *config.Config) {
|
reload := func(c *config.Config) {
|
||||||
|
|
||||||
// Revalidate and reload the authorization plugins
|
// Revalidate and reload the authorization plugins
|
||||||
if err := validateAuthzPlugins(c.AuthorizationPlugins, cli.d.PluginStore); err != nil {
|
if err := validateAuthzPlugins(c.AuthorizationPlugins, cli.d.PluginStore); err != nil {
|
||||||
logrus.Fatalf("Error validating authorization plugin: %v", err)
|
logrus.Fatalf("Error validating authorization plugin: %v", err)
|
||||||
|
|
|
@ -62,5 +62,4 @@ func TestTrap(t *testing.T) {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -222,7 +222,6 @@ func configReferencesToGRPC(sr []*types.ConfigReference) ([]*swarmapi.ConfigRefe
|
||||||
func configReferencesFromGRPC(sr []*swarmapi.ConfigReference) []*types.ConfigReference {
|
func configReferencesFromGRPC(sr []*swarmapi.ConfigReference) []*types.ConfigReference {
|
||||||
refs := make([]*types.ConfigReference, 0, len(sr))
|
refs := make([]*types.ConfigReference, 0, len(sr))
|
||||||
for _, s := range sr {
|
for _, s := range sr {
|
||||||
|
|
||||||
r := &types.ConfigReference{
|
r := &types.ConfigReference{
|
||||||
ConfigID: s.ConfigID,
|
ConfigID: s.ConfigID,
|
||||||
ConfigName: s.ConfigName,
|
ConfigName: s.ConfigName,
|
||||||
|
|
|
@ -120,7 +120,6 @@ func endpointFromGRPC(e *swarmapi.Endpoint) types.Endpoint {
|
||||||
NetworkID: v.NetworkID,
|
NetworkID: v.NetworkID,
|
||||||
Addr: v.Addr})
|
Addr: v.Addr})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return endpoint
|
return endpoint
|
||||||
|
|
|
@ -96,7 +96,6 @@ func serviceSpecFromGRPC(spec *swarmapi.ServiceSpec) (*types.ServiceSpec, error)
|
||||||
for _, n := range spec.Networks {
|
for _, n := range spec.Networks {
|
||||||
netConfig := types.NetworkAttachmentConfig{Target: n.Target, Aliases: n.Aliases, DriverOpts: n.DriverAttachmentOpts}
|
netConfig := types.NetworkAttachmentConfig{Target: n.Target, Aliases: n.Aliases, DriverOpts: n.DriverAttachmentOpts}
|
||||||
serviceNetworks = append(serviceNetworks, netConfig)
|
serviceNetworks = append(serviceNetworks, netConfig)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
taskTemplate, err := taskSpecFromGRPC(spec.Task)
|
taskTemplate, err := taskSpecFromGRPC(spec.Task)
|
||||||
|
@ -169,7 +168,6 @@ func ServiceSpecToGRPC(s types.ServiceSpec) (swarmapi.ServiceSpec, error) {
|
||||||
for _, n := range s.TaskTemplate.Networks {
|
for _, n := range s.TaskTemplate.Networks {
|
||||||
netConfig := &swarmapi.NetworkAttachmentConfig{Target: n.Target, Aliases: n.Aliases, DriverAttachmentOpts: n.DriverOpts}
|
netConfig := &swarmapi.NetworkAttachmentConfig{Target: n.Target, Aliases: n.Aliases, DriverAttachmentOpts: n.DriverOpts}
|
||||||
taskNetworks = append(taskNetworks, netConfig)
|
taskNetworks = append(taskNetworks, netConfig)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
spec := swarmapi.ServiceSpec{
|
spec := swarmapi.ServiceSpec{
|
||||||
|
@ -473,7 +471,6 @@ func resourcesToGRPC(res *types.ResourceRequirements) *swarmapi.ResourceRequirem
|
||||||
MemoryBytes: res.Reservations.MemoryBytes,
|
MemoryBytes: res.Reservations.MemoryBytes,
|
||||||
Generic: GenericResourcesToGRPC(res.Reservations.GenericResources),
|
Generic: GenericResourcesToGRPC(res.Reservations.GenericResources),
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return reqs
|
return reqs
|
||||||
|
@ -536,7 +533,6 @@ func restartPolicyToGRPC(p *types.RestartPolicy) (*swarmapi.RestartPolicy, error
|
||||||
}
|
}
|
||||||
if p.MaxAttempts != nil {
|
if p.MaxAttempts != nil {
|
||||||
rp.MaxAttempts = *p.MaxAttempts
|
rp.MaxAttempts = *p.MaxAttempts
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return rp, nil
|
return rp, nil
|
||||||
|
|
|
@ -460,7 +460,6 @@ func (c *containerAdapter) createVolumes(ctx context.Context) error {
|
||||||
// It returns an error if the driver name is different - that is a valid error
|
// It returns an error if the driver name is different - that is a valid error
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -16,7 +16,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestHealthStates(t *testing.T) {
|
func TestHealthStates(t *testing.T) {
|
||||||
|
|
||||||
// set up environment: events, task, container ....
|
// set up environment: events, task, container ....
|
||||||
e := events.New()
|
e := events.New()
|
||||||
_, l, _ := e.Subscribe()
|
_, l, _ := e.Subscribe()
|
||||||
|
|
|
@ -248,14 +248,11 @@ func (c *Cluster) CreateService(s swarm.ServiceSpec, encodedAuth string, queryRe
|
||||||
logrus.Warnf("unable to pin image %s to digest: %s", ctnr.Image, err.Error())
|
logrus.Warnf("unable to pin image %s to digest: %s", ctnr.Image, err.Error())
|
||||||
// warning in the client response should be concise
|
// warning in the client response should be concise
|
||||||
resp.Warnings = append(resp.Warnings, digestWarning(ctnr.Image))
|
resp.Warnings = append(resp.Warnings, digestWarning(ctnr.Image))
|
||||||
|
|
||||||
} else if ctnr.Image != digestImage {
|
} else if ctnr.Image != digestImage {
|
||||||
logrus.Debugf("pinning image %s by digest: %s", ctnr.Image, digestImage)
|
logrus.Debugf("pinning image %s by digest: %s", ctnr.Image, digestImage)
|
||||||
ctnr.Image = digestImage
|
ctnr.Image = digestImage
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
logrus.Debugf("creating service using supplied digest reference %s", ctnr.Image)
|
logrus.Debugf("creating service using supplied digest reference %s", ctnr.Image)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replace the context with a fresh one.
|
// Replace the context with a fresh one.
|
||||||
|
@ -287,7 +284,6 @@ func (c *Cluster) UpdateService(serviceIDOrName string, version uint64, spec swa
|
||||||
var resp *types.ServiceUpdateResponse
|
var resp *types.ServiceUpdateResponse
|
||||||
|
|
||||||
err := c.lockedManagerAction(func(ctx context.Context, state nodeState) error {
|
err := c.lockedManagerAction(func(ctx context.Context, state nodeState) error {
|
||||||
|
|
||||||
err := c.populateNetworkID(ctx, state.controlClient, &spec)
|
err := c.populateNetworkID(ctx, state.controlClient, &spec)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -562,7 +562,6 @@ func (daemon *Daemon) allocateNetwork(container *container.Container) (retErr er
|
||||||
if err := daemon.connectToNetwork(container, defaultNetName, nConf.EndpointSettings, updateSettings); err != nil {
|
if err := daemon.connectToNetwork(container, defaultNetName, nConf.EndpointSettings, updateSettings); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// the intermediate map is necessary because "connectToNetwork" modifies "container.NetworkSettings.Networks"
|
// the intermediate map is necessary because "connectToNetwork" modifies "container.NetworkSettings.Networks"
|
||||||
|
@ -601,7 +600,6 @@ func (daemon *Daemon) allocateNetwork(container *container.Container) (retErr er
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := container.WriteHostConfig(); err != nil {
|
if _, err := container.WriteHostConfig(); err != nil {
|
||||||
|
|
|
@ -342,5 +342,4 @@ func TestRootMountCleanup(t *testing.T) {
|
||||||
checkMounted(t, cfg.Root, false)
|
checkMounted(t, cfg.Root, false)
|
||||||
assert.Assert(t, d.cleanupMounts())
|
assert.Assert(t, d.cleanupMounts())
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -557,7 +557,6 @@ func verifyPlatformContainerResources(resources *containertypes.Resources, sysIn
|
||||||
if len(resources.BlkioDeviceWriteBps) > 0 && !sysInfo.BlkioWriteBpsDevice {
|
if len(resources.BlkioDeviceWriteBps) > 0 && !sysInfo.BlkioWriteBpsDevice {
|
||||||
warnings = append(warnings, "Your kernel does not support BPS Block I/O write limit or the cgroup is not mounted. Block I/O BPS write limit discarded.")
|
warnings = append(warnings, "Your kernel does not support BPS Block I/O write limit or the cgroup is not mounted. Block I/O BPS write limit discarded.")
|
||||||
resources.BlkioDeviceWriteBps = []*pblkiodev.ThrottleDevice{}
|
resources.BlkioDeviceWriteBps = []*pblkiodev.ThrottleDevice{}
|
||||||
|
|
||||||
}
|
}
|
||||||
if len(resources.BlkioDeviceReadIOps) > 0 && !sysInfo.BlkioReadIOpsDevice {
|
if len(resources.BlkioDeviceReadIOps) > 0 && !sysInfo.BlkioReadIOpsDevice {
|
||||||
warnings = append(warnings, "Your kernel does not support IOPS Block read limit or the cgroup is not mounted. Block I/O IOPS read limit discarded.")
|
warnings = append(warnings, "Your kernel does not support IOPS Block read limit or the cgroup is not mounted. Block I/O IOPS read limit discarded.")
|
||||||
|
@ -1089,7 +1088,6 @@ func setupInitLayer(idMapping idtools.IdentityMapping) func(string) error {
|
||||||
//
|
//
|
||||||
// If names are used, they are verified to exist in passwd/group
|
// If names are used, they are verified to exist in passwd/group
|
||||||
func parseRemappedRoot(usergrp string) (string, string, error) {
|
func parseRemappedRoot(usergrp string) (string, string, error) {
|
||||||
|
|
||||||
var (
|
var (
|
||||||
userID, groupID int
|
userID, groupID int
|
||||||
username, groupname string
|
username, groupname string
|
||||||
|
|
|
@ -237,7 +237,6 @@ func (a *Driver) CreateReadWrite(id, parent string, opts *graphdriver.CreateOpts
|
||||||
// Create three folders for each id
|
// Create three folders for each id
|
||||||
// mnt, layers, and diff
|
// mnt, layers, and diff
|
||||||
func (a *Driver) Create(id, parent string, opts *graphdriver.CreateOpts) error {
|
func (a *Driver) Create(id, parent string, opts *graphdriver.CreateOpts) error {
|
||||||
|
|
||||||
if opts != nil && len(opts.StorageOpt) != 0 {
|
if opts != nil && len(opts.StorageOpt) != 0 {
|
||||||
return fmt.Errorf("--storage-opt is not supported for aufs")
|
return fmt.Errorf("--storage-opt is not supported for aufs")
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,6 @@ type btrfsOptions struct {
|
||||||
// Init returns a new BTRFS driver.
|
// Init returns a new BTRFS driver.
|
||||||
// An error is returned if BTRFS is not supported.
|
// An error is returned if BTRFS is not supported.
|
||||||
func Init(home string, options []string, idMap idtools.IdentityMapping) (graphdriver.Driver, error) {
|
func Init(home string, options []string, idMap idtools.IdentityMapping) (graphdriver.Driver, error) {
|
||||||
|
|
||||||
// Perform feature detection on /var/lib/docker/btrfs if it's an existing directory.
|
// Perform feature detection on /var/lib/docker/btrfs if it's an existing directory.
|
||||||
// This covers situations where /var/lib/docker/btrfs is a mount, and on a different
|
// This covers situations where /var/lib/docker/btrfs is a mount, and on a different
|
||||||
// filesystem than /var/lib/docker.
|
// filesystem than /var/lib/docker.
|
||||||
|
|
|
@ -647,7 +647,6 @@ func (devices *DeviceSet) migrateOldMetaData() error {
|
||||||
if err := os.Rename(devices.oldMetadataFile(), devices.oldMetadataFile()+".migrated"); err != nil {
|
if err := os.Rename(devices.oldMetadataFile(), devices.oldMetadataFile()+".migrated"); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
@ -1148,7 +1147,6 @@ func (devices *DeviceSet) setupVerifyBaseImageUUIDFS(baseInfo *devInfo) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (devices *DeviceSet) checkGrowBaseDeviceFS(info *devInfo) error {
|
func (devices *DeviceSet) checkGrowBaseDeviceFS(info *devInfo) error {
|
||||||
|
|
||||||
if !userBaseSize {
|
if !userBaseSize {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -1622,7 +1620,6 @@ func (devices *DeviceSet) loadThinPoolLoopBackInfo() error {
|
||||||
devices.dataDevice = dataLoopDevice
|
devices.dataDevice = dataLoopDevice
|
||||||
devices.dataLoopFile = datafilename
|
devices.dataLoopFile = datafilename
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// metadata device has not been passed in. So there should be a
|
// metadata device has not been passed in. So there should be a
|
||||||
|
@ -1643,7 +1640,6 @@ func (devices *DeviceSet) loadThinPoolLoopBackInfo() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (devices *DeviceSet) enableDeferredRemovalDeletion() error {
|
func (devices *DeviceSet) enableDeferredRemovalDeletion() error {
|
||||||
|
|
||||||
// If user asked for deferred removal then check both libdm library
|
// If user asked for deferred removal then check both libdm library
|
||||||
// and kernel driver support deferred removal otherwise error out.
|
// and kernel driver support deferred removal otherwise error out.
|
||||||
if enableDeferredRemoval {
|
if enableDeferredRemoval {
|
||||||
|
@ -1946,7 +1942,6 @@ func (devices *DeviceSet) AddDevice(hash, baseHash string, storageOpt map[string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (devices *DeviceSet) parseStorageOpt(storageOpt map[string]string) (uint64, error) {
|
func (devices *DeviceSet) parseStorageOpt(storageOpt map[string]string) (uint64, error) {
|
||||||
|
|
||||||
// Read size to change the block device size per container.
|
// Read size to change the block device size per container.
|
||||||
for key, val := range storageOpt {
|
for key, val := range storageOpt {
|
||||||
key := strings.ToLower(key)
|
key := strings.ToLower(key)
|
||||||
|
|
|
@ -176,10 +176,10 @@ func DriverBenchDiffApplyN(b *testing.B, fileCount int, drivername string, drive
|
||||||
// suppressing "SA9003: empty branch (staticcheck)" instead of commenting-out/removing
|
// suppressing "SA9003: empty branch (staticcheck)" instead of commenting-out/removing
|
||||||
// these lines because removing/commenting these lines causes a ripple effect
|
// these lines because removing/commenting these lines causes a ripple effect
|
||||||
// of changes, and there's still a to-do below
|
// of changes, and there's still a to-do below
|
||||||
//nolint:staticcheck
|
//nolint:staticcheck,revive
|
||||||
if applyDiffSize != diffSize {
|
if applyDiffSize != diffSize {
|
||||||
// TODO: enforce this
|
// TODO: enforce this
|
||||||
//b.Fatalf("Apply diff size different, got %d, expected %s", applyDiffSize, diffSize)
|
// b.Fatalf("Apply diff size different, got %d, expected %s", applyDiffSize, diffSize)
|
||||||
}
|
}
|
||||||
if err := checkManyFiles(driver, diff, fileCount, 6); err != nil {
|
if err := checkManyFiles(driver, diff, fileCount, 6); err != nil {
|
||||||
b.Fatal(err)
|
b.Fatal(err)
|
||||||
|
@ -248,7 +248,6 @@ func DriverBenchDeepLayerRead(b *testing.B, layerCount int, drivername string, d
|
||||||
|
|
||||||
b.ResetTimer()
|
b.ResetTimer()
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
|
|
||||||
// Read content
|
// Read content
|
||||||
c, err := os.ReadFile(filepath.Join(root, "testfile.txt"))
|
c, err := os.ReadFile(filepath.Join(root, "testfile.txt"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -279,7 +279,6 @@ func addManyLayers(drv graphdriver.Driver, baseLayer string, count int) (string,
|
||||||
}
|
}
|
||||||
|
|
||||||
lastLayer = nextLayer
|
lastLayer = nextLayer
|
||||||
|
|
||||||
}
|
}
|
||||||
return lastLayer, nil
|
return lastLayer, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -246,7 +246,6 @@ func (d *Driver) CreateReadWrite(id, parent string, opts *graphdriver.CreateOpts
|
||||||
// Create is used to create the upper, lower, and merge directories required for overlay fs for a given id.
|
// Create is used to create the upper, lower, and merge directories required for overlay fs for a given id.
|
||||||
// The parent filesystem is used to configure these directories for the overlay.
|
// The parent filesystem is used to configure these directories for the overlay.
|
||||||
func (d *Driver) Create(id, parent string, opts *graphdriver.CreateOpts) (retErr error) {
|
func (d *Driver) Create(id, parent string, opts *graphdriver.CreateOpts) (retErr error) {
|
||||||
|
|
||||||
if opts != nil && len(opts.StorageOpt) != 0 {
|
if opts != nil && len(opts.StorageOpt) != 0 {
|
||||||
return fmt.Errorf("--storage-opt is not supported for overlay")
|
return fmt.Errorf("--storage-opt is not supported for overlay")
|
||||||
}
|
}
|
||||||
|
|
|
@ -378,7 +378,6 @@ func (d *Driver) Get(id, mountLabel string) (_ string, retErr error) {
|
||||||
if rmErr := unix.Rmdir(mountpoint); rmErr != nil && !os.IsNotExist(rmErr) {
|
if rmErr := unix.Rmdir(mountpoint); rmErr != nil && !os.IsNotExist(rmErr) {
|
||||||
logrus.WithField("storage-driver", "zfs").Debugf("Failed to remove %s: %v", id, rmErr)
|
logrus.WithField("storage-driver", "zfs").Debugf("Failed to remove %s: %v", id, rmErr)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
|
@ -134,7 +134,6 @@ func (i *ImageService) ImageDelete(ctx context.Context, imageRef string, force,
|
||||||
records = append(records, untaggedRecord)
|
records = append(records, untaggedRecord)
|
||||||
} else {
|
} else {
|
||||||
remainingRefs = append(remainingRefs, repoRef)
|
remainingRefs = append(remainingRefs, repoRef)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
repoRefs = remainingRefs
|
repoRefs = remainingRefs
|
||||||
|
|
|
@ -152,7 +152,6 @@ func (i *ImageService) Images(ctx context.Context, opts types.ImageListOptions)
|
||||||
}
|
}
|
||||||
if summary.RepoDigests == nil && summary.RepoTags == nil {
|
if summary.RepoDigests == nil && summary.RepoTags == nil {
|
||||||
if opts.All || len(i.imageStore.Children(id)) == 0 {
|
if opts.All || len(i.imageStore.Children(id)) == 0 {
|
||||||
|
|
||||||
if opts.Filters.Contains("dangling") && !danglingOnly {
|
if opts.Filters.Contains("dangling") && !danglingOnly {
|
||||||
// dangling=false case, so dangling image is not needed
|
// dangling=false case, so dangling image is not needed
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -23,7 +23,6 @@ var acceptedSearchFilterTags = map[string]bool{
|
||||||
func (i *ImageService) SearchRegistryForImages(ctx context.Context, searchFilters filters.Args, term string, limit int,
|
func (i *ImageService) SearchRegistryForImages(ctx context.Context, searchFilters filters.Args, term string, limit int,
|
||||||
authConfig *registry.AuthConfig,
|
authConfig *registry.AuthConfig,
|
||||||
headers map[string][]string) (*registry.SearchResults, error) {
|
headers map[string][]string) (*registry.SearchResults, error) {
|
||||||
|
|
||||||
if err := searchFilters.Validate(acceptedSearchFilterTags); err != nil {
|
if err := searchFilters.Validate(acceptedSearchFilterTags); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,6 @@ import (
|
||||||
// The existing image(s) is not destroyed.
|
// The existing image(s) is not destroyed.
|
||||||
// If no parent is specified, a new image with the diff of all the specified image's layers merged into a new layer that has no parents.
|
// If no parent is specified, a new image with the diff of all the specified image's layers merged into a new layer that has no parents.
|
||||||
func (i *ImageService) SquashImage(id, parent string) (string, error) {
|
func (i *ImageService) SquashImage(id, parent string) (string, error) {
|
||||||
|
|
||||||
var (
|
var (
|
||||||
img *image.Image
|
img *image.Image
|
||||||
err error
|
err error
|
||||||
|
|
|
@ -129,7 +129,6 @@ func (c *contentStoreForPull) Writer(ctx context.Context, opts ...content.Writer
|
||||||
if err := o(&cfg); err != nil {
|
if err := o(&cfg); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
c.addDigested(cfg.Desc.Digest)
|
c.addDigested(cfg.Desc.Digest)
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,6 @@ func (l *mockLoggingPlugin) StartLogging(file string, info Info) error {
|
||||||
|
|
||||||
l.c.Broadcast()
|
l.c.Broadcast()
|
||||||
return
|
return
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
l.c.L.Lock()
|
l.c.L.Lock()
|
||||||
|
@ -55,7 +54,6 @@ func (l *mockLoggingPlugin) StartLogging(file string, info Info) error {
|
||||||
l.c.L.Unlock()
|
l.c.L.Unlock()
|
||||||
l.c.Broadcast()
|
l.c.Broadcast()
|
||||||
}
|
}
|
||||||
|
|
||||||
}()
|
}()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -172,7 +170,6 @@ func TestAdapterReadLogs(t *testing.T) {
|
||||||
assert.Check(t, !ok, "expected message channel to be closed")
|
assert.Check(t, !ok, "expected message channel to be closed")
|
||||||
case <-time.After(10 * time.Second):
|
case <-time.After(10 * time.Second):
|
||||||
t.Fatal("timeout waiting for message channel to close")
|
t.Fatal("timeout waiting for message channel to close")
|
||||||
|
|
||||||
}
|
}
|
||||||
lw.ConsumerGone()
|
lw.ConsumerGone()
|
||||||
|
|
||||||
|
|
|
@ -661,7 +661,6 @@ func TestCollectBatchTicker(t *testing.T) {
|
||||||
assert.Equal(t, logline+" 3", aws.StringValue(argument.LogEvents[0].Message))
|
assert.Equal(t, logline+" 3", aws.StringValue(argument.LogEvents[0].Message))
|
||||||
|
|
||||||
stream.Close()
|
stream.Close()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestCollectBatchMultilinePattern(t *testing.T) {
|
func TestCollectBatchMultilinePattern(t *testing.T) {
|
||||||
|
|
|
@ -65,7 +65,6 @@ func makeTestMessages() []*logger.Message {
|
||||||
{Source: "stderr", Timestamp: time.Now().Add(-1 * 10 * time.Minute), Line: []byte("just one more message")},
|
{Source: "stderr", Timestamp: time.Now().Add(-1 * 10 * time.Minute), Line: []byte("just one more message")},
|
||||||
{Source: "stdout", Timestamp: time.Now().Add(-1 * 90 * time.Minute), Line: []byte("someone adjusted the clock")},
|
{Source: "stdout", Timestamp: time.Now().Add(-1 * 90 * time.Minute), Line: []byte("someone adjusted the clock")},
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tr Reader) testTail(t *testing.T, live bool) {
|
func (tr Reader) testTail(t *testing.T, live bool) {
|
||||||
|
|
|
@ -138,7 +138,6 @@ func (c *sharedTempFileConverter) openExisting(st stfcState, id stfID, v sharedT
|
||||||
|
|
||||||
res := <-wait
|
res := <-wait
|
||||||
return res.fr, res.err
|
return res.fr, res.err
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *sharedTempFileConverter) convert(f *os.File) (converted *os.File, size int64, err error) {
|
func (c *sharedTempFileConverter) convert(f *os.File) (converted *os.File, size int64, err error) {
|
||||||
|
|
|
@ -207,7 +207,6 @@ func TestSharedTempFileConverter(t *testing.T) {
|
||||||
assert.Check(t, src.Close())
|
assert.Check(t, src.Close())
|
||||||
assert.NilError(t, os.Remove(name))
|
assert.NilError(t, os.Remove(name))
|
||||||
checkDirEmpty(t, dir)
|
checkDirEmpty(t, dir)
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,6 @@ func TestRingDrain(t *testing.T) {
|
||||||
if len(ls) != 0 {
|
if len(ls) != 0 {
|
||||||
t.Fatalf("expected 0 messages on 2nd drain: %v", ls)
|
t.Fatalf("expected 0 messages on 2nd drain: %v", ls)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type nopLogger struct{}
|
type nopLogger struct{}
|
||||||
|
|
|
@ -265,5 +265,4 @@ func parseLogFormat(logFormat, proto string) (syslog.Formatter, syslog.Framer, e
|
||||||
default:
|
default:
|
||||||
return nil, nil, errors.New("Invalid syslog format")
|
return nil, nil, errors.New("Invalid syslog format")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -815,7 +815,6 @@ func buildCreateEndpointOptions(c *container.Container, n libnetwork.Network, ep
|
||||||
return nil, errors.Errorf("Invalid link-local IP address: %s", ipam.LinkLocalIPs)
|
return nil, errors.Errorf("Invalid link-local IP address: %s", ipam.LinkLocalIPs)
|
||||||
}
|
}
|
||||||
ipList = append(ipList, linkip)
|
ipList = append(ipList, linkip)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ip = net.ParseIP(ipam.IPv4Address); ip == nil && ipam.IPv4Address != "" {
|
if ip = net.ParseIP(ipam.IPv4Address); ip == nil && ipam.IPv4Address != "" {
|
||||||
|
@ -828,7 +827,6 @@ func buildCreateEndpointOptions(c *container.Container, n libnetwork.Network, ep
|
||||||
|
|
||||||
createOptions = append(createOptions,
|
createOptions = append(createOptions,
|
||||||
libnetwork.CreateOptionIpam(ip, ip6, ipList, nil))
|
libnetwork.CreateOptionIpam(ip, ip6, ipList, nil))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, alias := range epConfig.Aliases {
|
for _, alias := range epConfig.Aliases {
|
||||||
|
@ -882,7 +880,6 @@ func buildCreateEndpointOptions(c *container.Container, n libnetwork.Network, ep
|
||||||
|
|
||||||
createOptions = append(createOptions, libnetwork.EndpointOptionGeneric(genericOption))
|
createOptions = append(createOptions, libnetwork.EndpointOptionGeneric(genericOption))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Port-mapping rules belong to the container & applicable only to non-internal networks
|
// Port-mapping rules belong to the container & applicable only to non-internal networks
|
||||||
|
|
|
@ -173,7 +173,6 @@ func TestFilterNetworks(t *testing.T) {
|
||||||
if testCase.err != "" {
|
if testCase.err != "" {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Fatalf("expect error '%s', got no error", testCase.err)
|
t.Fatalf("expect error '%s', got no error", testCase.err)
|
||||||
|
|
||||||
} else if !strings.Contains(err.Error(), testCase.err) {
|
} else if !strings.Contains(err.Error(), testCase.err) {
|
||||||
t.Fatalf("expect error '%s', got '%s'", testCase.err, err)
|
t.Fatalf("expect error '%s', got '%s'", testCase.err, err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -706,7 +706,6 @@ func WithMounts(daemon *Daemon, c *container.Container) coci.SpecOpts {
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -404,5 +404,4 @@ func TestDaemonReloadNetworkDiagnosticPort(t *testing.T) {
|
||||||
if !daemon.netController.IsDiagnosticEnabled() {
|
if !daemon.netController.IsDiagnosticEnabled() {
|
||||||
t.Fatalf("diagnostic should be enable")
|
t.Fatalf("diagnostic should be enable")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,6 @@ func (daemon *Daemon) ContainerRestart(ctx context.Context, name string, options
|
||||||
return fmt.Errorf("Cannot restart container %s: %v", name, err)
|
return fmt.Errorf("Cannot restart container %s: %v", name, err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// containerRestart attempts to gracefully stop and then start the
|
// containerRestart attempts to gracefully stop and then start the
|
||||||
|
|
|
@ -15,7 +15,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestWithSeccomp(t *testing.T) {
|
func TestWithSeccomp(t *testing.T) {
|
||||||
|
|
||||||
type expected struct {
|
type expected struct {
|
||||||
daemon *Daemon
|
daemon *Daemon
|
||||||
c *container.Container
|
c *container.Container
|
||||||
|
|
|
@ -171,7 +171,6 @@ func TestManifestStore(t *testing.T) {
|
||||||
|
|
||||||
err = w.Commit(ctx, desc.Size, desc.Digest, opts...)
|
err = w.Commit(ctx, desc.Size, desc.Digest, opts...)
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// All tests should end up with no active ingest
|
// All tests should end up with no active ingest
|
||||||
|
@ -348,7 +347,6 @@ func TestDetectManifestBlobMediaType(t *testing.T) {
|
||||||
assert.Equal(t, mt, tc.expected)
|
assert.Equal(t, mt, tc.expected)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDetectManifestBlobMediaTypeInvalid(t *testing.T) {
|
func TestDetectManifestBlobMediaTypeInvalid(t *testing.T) {
|
||||||
|
@ -418,5 +416,4 @@ func TestDetectManifestBlobMediaTypeInvalid(t *testing.T) {
|
||||||
assert.Equal(t, mt, "")
|
assert.Equal(t, mt, "")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -313,7 +313,6 @@ func (ldm *LayerDownloadManager) makeDownloadFunc(descriptor DownloadDescriptor,
|
||||||
d.err = errors.New("download cancelled during retry delay")
|
d.err = errors.New("download cancelled during retry delay")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,6 @@ func TestFSInvalidRoot(t *testing.T) {
|
||||||
|
|
||||||
os.RemoveAll(root)
|
os.RemoveAll(root)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestFSMetadataGetSet(t *testing.T) {
|
func TestFSMetadataGetSet(t *testing.T) {
|
||||||
|
|
|
@ -138,7 +138,6 @@ func (l *tarexporter) parseNames(names []string) (desc map[image.ID]*imageDescri
|
||||||
if err := addAssoc(image.IDFromDigest(id), namedRef); err != nil {
|
if err := addAssoc(image.IDFromDigest(id), namedRef); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return imgDescr, nil
|
return imgDescr, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -224,7 +224,6 @@ func (s *DockerAPISuite) TestPostContainersAttach(c *testing.T) {
|
||||||
// , contenttype, …), if receive a successful "101 Switching Protocols" response return
|
// , contenttype, …), if receive a successful "101 Switching Protocols" response return
|
||||||
// a `io.WriteCloser` and `bufio.Reader`
|
// a `io.WriteCloser` and `bufio.Reader`
|
||||||
func requestHijack(method, endpoint string, data io.Reader, ct, daemon string, modifiers ...func(*http.Request)) (io.WriteCloser, *bufio.Reader, error) {
|
func requestHijack(method, endpoint string, data io.Reader, ct, daemon string, modifiers ...func(*http.Request)) (io.WriteCloser, *bufio.Reader, error) {
|
||||||
|
|
||||||
hostURL, err := client.ParseHostURL(daemon)
|
hostURL, err := client.ParseHostURL(daemon)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, errors.Wrap(err, "parse daemon host error")
|
return nil, nil, errors.Wrap(err, "parse daemon host error")
|
||||||
|
|
|
@ -427,7 +427,6 @@ func (s *DockerAPISuite) TestBuildChownOnCopy(c *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerAPISuite) TestBuildCopyCacheOnFileChange(c *testing.T) {
|
func (s *DockerAPISuite) TestBuildCopyCacheOnFileChange(c *testing.T) {
|
||||||
|
|
||||||
dockerfile := `FROM busybox
|
dockerfile := `FROM busybox
|
||||||
COPY file /file`
|
COPY file /file`
|
||||||
|
|
||||||
|
@ -468,7 +467,6 @@ COPY file /file`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerAPISuite) TestBuildAddCacheOnFileChange(c *testing.T) {
|
func (s *DockerAPISuite) TestBuildAddCacheOnFileChange(c *testing.T) {
|
||||||
|
|
||||||
dockerfile := `FROM busybox
|
dockerfile := `FROM busybox
|
||||||
ADD file /file`
|
ADD file /file`
|
||||||
|
|
||||||
|
|
|
@ -545,7 +545,6 @@ func (s *DockerAPISuite) TestContainerAPICreate(c *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerAPISuite) TestContainerAPICreateEmptyConfig(c *testing.T) {
|
func (s *DockerAPISuite) TestContainerAPICreateEmptyConfig(c *testing.T) {
|
||||||
|
|
||||||
cli, err := client.NewClientWithOpts(client.FromEnv)
|
cli, err := client.NewClientWithOpts(client.FromEnv)
|
||||||
assert.NilError(c, err)
|
assert.NilError(c, err)
|
||||||
defer cli.Close()
|
defer cli.Close()
|
||||||
|
@ -1070,7 +1069,6 @@ func (s *DockerAPISuite) TestContainerAPICopyResourcePathEmptyPre124(c *testing.
|
||||||
b, err := request.ReadBody(body)
|
b, err := request.ReadBody(body)
|
||||||
assert.NilError(c, err)
|
assert.NilError(c, err)
|
||||||
assert.Assert(c, is.Regexp("^Path cannot be empty\n$", string(b)))
|
assert.Assert(c, is.Regexp("^Path cannot be empty\n$", string(b)))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerAPISuite) TestContainerAPICopyResourcePathNotFoundPre124(c *testing.T) {
|
func (s *DockerAPISuite) TestContainerAPICopyResourcePathNotFoundPre124(c *testing.T) {
|
||||||
|
@ -1092,7 +1090,6 @@ func (s *DockerAPISuite) TestContainerAPICopyResourcePathNotFoundPre124(c *testi
|
||||||
b, err := request.ReadBody(body)
|
b, err := request.ReadBody(body)
|
||||||
assert.NilError(c, err)
|
assert.NilError(c, err)
|
||||||
assert.Assert(c, is.Regexp("^Could not find the file /notexist in container "+name+"\n$", string(b)))
|
assert.Assert(c, is.Regexp("^Could not find the file /notexist in container "+name+"\n$", string(b)))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerAPISuite) TestContainerAPICopyContainerNotFoundPr124(c *testing.T) {
|
func (s *DockerAPISuite) TestContainerAPICopyContainerNotFoundPr124(c *testing.T) {
|
||||||
|
@ -1230,7 +1227,6 @@ func (s *DockerAPISuite) TestContainerAPIDeleteRemoveVolume(c *testing.T) {
|
||||||
|
|
||||||
// Regression test for https://github.com/docker/docker/issues/6231
|
// Regression test for https://github.com/docker/docker/issues/6231
|
||||||
func (s *DockerAPISuite) TestContainerAPIChunkedEncoding(c *testing.T) {
|
func (s *DockerAPISuite) TestContainerAPIChunkedEncoding(c *testing.T) {
|
||||||
|
|
||||||
config := map[string]interface{}{
|
config := map[string]interface{}{
|
||||||
"Image": "busybox",
|
"Image": "busybox",
|
||||||
"Cmd": append([]string{"/bin/sh", "-c"}, sleepCommandForDaemonPlatform()...),
|
"Cmd": append([]string{"/bin/sh", "-c"}, sleepCommandForDaemonPlatform()...),
|
||||||
|
@ -1920,7 +1916,6 @@ func (s *DockerAPISuite) TestContainersAPICreateMountsValidation(c *testing.T) {
|
||||||
msg: "Source must not be specified",
|
msg: "Source must not be specified",
|
||||||
},
|
},
|
||||||
}...)
|
}...)
|
||||||
|
|
||||||
}
|
}
|
||||||
apiClient, err := client.NewClientWithOpts(client.FromEnv)
|
apiClient, err := client.NewClientWithOpts(client.FromEnv)
|
||||||
assert.NilError(c, err)
|
assert.NilError(c, err)
|
||||||
|
@ -2148,7 +2143,6 @@ func (s *DockerAPISuite) TestContainersAPICreateMountsCreate(c *testing.T) {
|
||||||
assert.NilError(c, err)
|
assert.NilError(c, err)
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
|
|
||||||
// Named volumes still exist after the container is removed
|
// Named volumes still exist after the container is removed
|
||||||
case x.spec.Type == "volume" && len(x.spec.Source) > 0:
|
case x.spec.Type == "volume" && len(x.spec.Source) > 0:
|
||||||
_, err := apiclient.VolumeInspect(ctx, mountPoint.Name)
|
_, err := apiclient.VolumeInspect(ctx, mountPoint.Name)
|
||||||
|
|
|
@ -147,7 +147,6 @@ func (s *DockerAPISuite) TestAPIImagesImportBadSrc(c *testing.T) {
|
||||||
assert.Equal(c, res.StatusCode, te.statusExp)
|
assert.Equal(c, res.StatusCode, te.statusExp)
|
||||||
assert.Equal(c, res.Header.Get("Content-Type"), "application/json")
|
assert.Equal(c, res.Header.Get("Content-Type"), "application/json")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// #14846
|
// #14846
|
||||||
|
|
|
@ -31,7 +31,6 @@ func (s *DockerAPISuite) TestInspectAPIContainerResponse(c *testing.T) {
|
||||||
cases = []acase{
|
cases = []acase{
|
||||||
{"v1.25", append(keysBase, "Mounts")},
|
{"v1.25", append(keysBase, "Mounts")},
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
cases = []acase{
|
cases = []acase{
|
||||||
{"v1.20", append(keysBase, "Mounts")},
|
{"v1.20", append(keysBase, "Mounts")},
|
||||||
|
@ -51,7 +50,7 @@ func (s *DockerAPISuite) TestInspectAPIContainerResponse(c *testing.T) {
|
||||||
assert.Check(c, ok, "%s does not exist in response for version %s", key, cs.version)
|
assert.Check(c, ok, "%s does not exist in response for version %s", key, cs.version)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Issue #6830: type not properly converted to JSON/back
|
// Issue #6830: type not properly converted to JSON/back
|
||||||
_, ok := inspectJSON["Path"].(bool)
|
_, ok := inspectJSON["Path"].(bool)
|
||||||
assert.Assert(c, !ok, "Path of `true` should not be converted to boolean `true` via JSON marshalling")
|
assert.Assert(c, !ok, "Path of `true` should not be converted to boolean `true` via JSON marshalling")
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,5 +125,4 @@ func (s *DockerSwarmSuite) TestAPISwarmNodeDrainPause(c *testing.T) {
|
||||||
d1.UpdateService(c, d1.GetService(c, id), setInstances(instances))
|
d1.UpdateService(c, d1.GetService(c, id), setInstances(instances))
|
||||||
poll.WaitOn(c, pollCheck(c, d1.CheckActiveContainerCount, checker.Equals(instances-d2ContainerCount)), poll.WithTimeout(defaultReconciliationTimeout))
|
poll.WaitOn(c, pollCheck(c, d1.CheckActiveContainerCount, checker.Equals(instances-d2ContainerCount)), poll.WithTimeout(defaultReconciliationTimeout))
|
||||||
poll.WaitOn(c, pollCheck(c, d2.CheckActiveContainerCount, checker.Equals(d2ContainerCount)), poll.WithTimeout(defaultReconciliationTimeout))
|
poll.WaitOn(c, pollCheck(c, d2.CheckActiveContainerCount, checker.Equals(d2ContainerCount)), poll.WithTimeout(defaultReconciliationTimeout))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,7 +120,6 @@ func (s *DockerSwarmSuite) TestAPISwarmServicesMultipleAgents(c *testing.T) {
|
||||||
instances = 5
|
instances = 5
|
||||||
d1.UpdateService(c, d1.GetService(c, id), setInstances(instances))
|
d1.UpdateService(c, d1.GetService(c, id), setInstances(instances))
|
||||||
poll.WaitOn(c, pollCheck(c, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d3.CheckActiveContainerCount), checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
|
poll.WaitOn(c, pollCheck(c, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d3.CheckActiveContainerCount), checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerSwarmSuite) TestAPISwarmServicesCreateGlobal(c *testing.T) {
|
func (s *DockerSwarmSuite) TestAPISwarmServicesCreateGlobal(c *testing.T) {
|
||||||
|
@ -193,7 +192,6 @@ func (s *DockerSwarmSuite) TestAPISwarmServicesUpdate(c *testing.T) {
|
||||||
|
|
||||||
// 2nd batch
|
// 2nd batch
|
||||||
poll.WaitOn(c, pollCheck(c, daemons[0].CheckRunningTaskImages, checker.DeepEquals(map[string]int{image1: instances})), poll.WithTimeout(defaultReconciliationTimeout))
|
poll.WaitOn(c, pollCheck(c, daemons[0].CheckRunningTaskImages, checker.DeepEquals(map[string]int{image1: instances})), poll.WithTimeout(defaultReconciliationTimeout))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerSwarmSuite) TestAPISwarmServicesUpdateStartFirst(c *testing.T) {
|
func (s *DockerSwarmSuite) TestAPISwarmServicesUpdateStartFirst(c *testing.T) {
|
||||||
|
@ -294,7 +292,6 @@ func (s *DockerSwarmSuite) TestAPISwarmServicesUpdateStartFirst(c *testing.T) {
|
||||||
|
|
||||||
// 2nd batch
|
// 2nd batch
|
||||||
poll.WaitOn(c, pollCheck(c, d.CheckRunningTaskImages, checker.DeepEquals(map[string]int{image1: instances})), poll.WithTimeout(defaultReconciliationTimeout))
|
poll.WaitOn(c, pollCheck(c, d.CheckRunningTaskImages, checker.DeepEquals(map[string]int{image1: instances})), poll.WithTimeout(defaultReconciliationTimeout))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerSwarmSuite) TestAPISwarmServicesFailedUpdate(c *testing.T) {
|
func (s *DockerSwarmSuite) TestAPISwarmServicesFailedUpdate(c *testing.T) {
|
||||||
|
@ -333,7 +330,6 @@ func (s *DockerSwarmSuite) TestAPISwarmServicesFailedUpdate(c *testing.T) {
|
||||||
assert.NilError(c, err, out)
|
assert.NilError(c, err, out)
|
||||||
|
|
||||||
poll.WaitOn(c, pollCheck(c, daemons[0].CheckRunningTaskImages, checker.DeepEquals(map[string]int{image1: instances})), poll.WithTimeout(defaultReconciliationTimeout))
|
poll.WaitOn(c, pollCheck(c, daemons[0].CheckRunningTaskImages, checker.DeepEquals(map[string]int{image1: instances})), poll.WithTimeout(defaultReconciliationTimeout))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerSwarmSuite) TestAPISwarmServiceConstraintRole(c *testing.T) {
|
func (s *DockerSwarmSuite) TestAPISwarmServiceConstraintRole(c *testing.T) {
|
||||||
|
|
|
@ -56,7 +56,6 @@ func (s *DockerCLIAttachSuite) TestAttachClosedOnContainerStop(c *testing.T) {
|
||||||
case <-time.After(attachWait):
|
case <-time.After(attachWait):
|
||||||
c.Fatal("timed out without attach returning")
|
c.Fatal("timed out without attach returning")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIAttachSuite) TestAttachAfterDetach(c *testing.T) {
|
func (s *DockerCLIAttachSuite) TestAttachAfterDetach(c *testing.T) {
|
||||||
|
|
|
@ -108,7 +108,6 @@ func (s *DockerCLIBuildSuite) TestBuildEnvironmentReplacementVolume(c *testing.T
|
||||||
if _, ok := volumes[volumePath]; !ok {
|
if _, ok := volumes[volumePath]; !ok {
|
||||||
c.Fatal("Volume " + volumePath + " from environment not in Config.Volumes on image")
|
c.Fatal("Volume " + volumePath + " from environment not in Config.Volumes on image")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIBuildSuite) TestBuildEnvironmentReplacementExpose(c *testing.T) {
|
func (s *DockerCLIBuildSuite) TestBuildEnvironmentReplacementExpose(c *testing.T) {
|
||||||
|
@ -133,7 +132,6 @@ func (s *DockerCLIBuildSuite) TestBuildEnvironmentReplacementExpose(c *testing.T
|
||||||
c.Fatalf("Exposed port %d from environment not in Config.ExposedPorts on image", p)
|
c.Fatalf("Exposed port %d from environment not in Config.ExposedPorts on image", p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIBuildSuite) TestBuildEnvironmentReplacementWorkdir(c *testing.T) {
|
func (s *DockerCLIBuildSuite) TestBuildEnvironmentReplacementWorkdir(c *testing.T) {
|
||||||
|
@ -240,7 +238,6 @@ func (s *DockerCLIBuildSuite) TestBuildEnvironmentReplacementEnv(c *testing.T) {
|
||||||
if envCount != 4 {
|
if envCount != 4 {
|
||||||
c.Fatalf("Didn't find all env vars - only saw %d\n%s", envCount, envResult)
|
c.Fatalf("Didn't find all env vars - only saw %d\n%s", envCount, envResult)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIBuildSuite) TestBuildHandleEscapesInVolume(c *testing.T) {
|
func (s *DockerCLIBuildSuite) TestBuildHandleEscapesInVolume(c *testing.T) {
|
||||||
|
@ -308,7 +305,6 @@ func (s *DockerCLIBuildSuite) TestBuildOnBuildLowercase(c *testing.T) {
|
||||||
if strings.Contains(result.Combined(), "ONBUILD ONBUILD") {
|
if strings.Contains(result.Combined(), "ONBUILD ONBUILD") {
|
||||||
c.Fatalf("Got an ONBUILD ONBUILD error with no error: got %s", result.Combined())
|
c.Fatalf("Got an ONBUILD ONBUILD error with no error: got %s", result.Combined())
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIBuildSuite) TestBuildEnvEscapes(c *testing.T) {
|
func (s *DockerCLIBuildSuite) TestBuildEnvEscapes(c *testing.T) {
|
||||||
|
@ -325,7 +321,6 @@ func (s *DockerCLIBuildSuite) TestBuildEnvEscapes(c *testing.T) {
|
||||||
if strings.TrimSpace(out) != "$" {
|
if strings.TrimSpace(out) != "$" {
|
||||||
c.Fatalf("Env TEST was not overwritten with bar when foo was supplied to dockerfile: was %q", strings.TrimSpace(out))
|
c.Fatalf("Env TEST was not overwritten with bar when foo was supplied to dockerfile: was %q", strings.TrimSpace(out))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIBuildSuite) TestBuildEnvOverwrite(c *testing.T) {
|
func (s *DockerCLIBuildSuite) TestBuildEnvOverwrite(c *testing.T) {
|
||||||
|
@ -342,7 +337,6 @@ func (s *DockerCLIBuildSuite) TestBuildEnvOverwrite(c *testing.T) {
|
||||||
if strings.TrimSpace(out) != "bar" {
|
if strings.TrimSpace(out) != "bar" {
|
||||||
c.Fatalf("Env TEST was not overwritten with bar when foo was supplied to dockerfile: was %q", strings.TrimSpace(out))
|
c.Fatalf("Env TEST was not overwritten with bar when foo was supplied to dockerfile: was %q", strings.TrimSpace(out))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME(vdemeester) why we disabled cache here ?
|
// FIXME(vdemeester) why we disabled cache here ?
|
||||||
|
@ -377,7 +371,6 @@ ONBUILD ENTRYPOINT ["echo"]`))
|
||||||
if !regexp.MustCompile(`(?m)^hello world`).MatchString(out) {
|
if !regexp.MustCompile(`(?m)^hello world`).MatchString(out) {
|
||||||
c.Fatal("got malformed output from onbuild", out)
|
c.Fatal("got malformed output from onbuild", out)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIBuildSuite) TestBuildCacheAdd(c *testing.T) {
|
func (s *DockerCLIBuildSuite) TestBuildCacheAdd(c *testing.T) {
|
||||||
|
@ -447,7 +440,6 @@ ADD %s/file /`
|
||||||
if out == out2 {
|
if out == out2 {
|
||||||
c.Fatalf("MTime didn't change:\nOrigin:%s\nNew:%s", out, out2)
|
c.Fatalf("MTime didn't change:\nOrigin:%s\nNew:%s", out, out2)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Regression for https://github.com/docker/docker/pull/27805
|
// Regression for https://github.com/docker/docker/pull/27805
|
||||||
|
@ -682,7 +674,6 @@ func (s *DockerCLIBuildSuite) TestBuildCopyWildcard(c *testing.T) {
|
||||||
if id1 != id2 {
|
if id1 != id2 {
|
||||||
c.Fatal("didn't use the cache")
|
c.Fatal("didn't use the cache")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIBuildSuite) TestBuildCopyWildcardInName(c *testing.T) {
|
func (s *DockerCLIBuildSuite) TestBuildCopyWildcardInName(c *testing.T) {
|
||||||
|
@ -728,7 +719,6 @@ func (s *DockerCLIBuildSuite) TestBuildCopyWildcardCache(c *testing.T) {
|
||||||
if id1 != id2 {
|
if id1 != id2 {
|
||||||
c.Fatal("didn't use the cache")
|
c.Fatal("didn't use the cache")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIBuildSuite) TestBuildAddSingleFileToNonExistingDir(c *testing.T) {
|
func (s *DockerCLIBuildSuite) TestBuildAddSingleFileToNonExistingDir(c *testing.T) {
|
||||||
|
@ -1012,7 +1002,6 @@ func (s *DockerCLIBuildSuite) TestBuildAddBadLinks(c *testing.T) {
|
||||||
if _, err := os.Stat(nonExistingFile); err == nil || !os.IsNotExist(err) {
|
if _, err := os.Stat(nonExistingFile); err == nil || !os.IsNotExist(err) {
|
||||||
c.Fatalf("%s shouldn't have been written and it shouldn't exist", nonExistingFile)
|
c.Fatalf("%s shouldn't have been written and it shouldn't exist", nonExistingFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIBuildSuite) TestBuildAddBadLinksVolume(c *testing.T) {
|
func (s *DockerCLIBuildSuite) TestBuildAddBadLinksVolume(c *testing.T) {
|
||||||
|
@ -1053,7 +1042,6 @@ func (s *DockerCLIBuildSuite) TestBuildAddBadLinksVolume(c *testing.T) {
|
||||||
if _, err := os.Stat(nonExistingFile); err == nil || !os.IsNotExist(err) {
|
if _, err := os.Stat(nonExistingFile); err == nil || !os.IsNotExist(err) {
|
||||||
c.Fatalf("%s shouldn't have been written and it shouldn't exist", nonExistingFile)
|
c.Fatalf("%s shouldn't have been written and it shouldn't exist", nonExistingFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Issue #5270 - ensure we throw a better error than "unexpected EOF"
|
// Issue #5270 - ensure we throw a better error than "unexpected EOF"
|
||||||
|
@ -1131,7 +1119,6 @@ func (s *DockerCLIBuildSuite) TestBuildWithInaccessibleFilesInContext(c *testing
|
||||||
if !strings.Contains(result.Combined(), "error checking context") {
|
if !strings.Contains(result.Combined(), "error checking context") {
|
||||||
c.Fatalf("output should've contained the string: error checking context\ngot:%s", result.Combined())
|
c.Fatalf("output should've contained the string: error checking context\ngot:%s", result.Combined())
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name := "testlinksok"
|
name := "testlinksok"
|
||||||
|
@ -1195,7 +1182,6 @@ func (s *DockerCLIBuildSuite) TestBuildForceRm(c *testing.T) {
|
||||||
if containerCountBefore != containerCountAfter {
|
if containerCountBefore != containerCountAfter {
|
||||||
c.Fatalf("--force-rm shouldn't have left containers behind")
|
c.Fatalf("--force-rm shouldn't have left containers behind")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIBuildSuite) TestBuildRm(c *testing.T) {
|
func (s *DockerCLIBuildSuite) TestBuildRm(c *testing.T) {
|
||||||
|
@ -1273,7 +1259,6 @@ func (s *DockerCLIBuildSuite) TestBuildWithVolumes(c *testing.T) {
|
||||||
if !equal {
|
if !equal {
|
||||||
c.Fatalf("Volumes %s, expected %s", result, expected)
|
c.Fatalf("Volumes %s, expected %s", result, expected)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIBuildSuite) TestBuildMaintainer(c *testing.T) {
|
func (s *DockerCLIBuildSuite) TestBuildMaintainer(c *testing.T) {
|
||||||
|
@ -1540,7 +1525,6 @@ func (s *DockerCLIBuildSuite) TestBuildContextCleanup(c *testing.T) {
|
||||||
if err = compareDirectoryEntries(entries, entriesFinal); err != nil {
|
if err = compareDirectoryEntries(entries, entriesFinal); err != nil {
|
||||||
c.Fatalf("context should have been deleted, but wasn't")
|
c.Fatalf("context should have been deleted, but wasn't")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIBuildSuite) TestBuildContextCleanupFailedBuild(c *testing.T) {
|
func (s *DockerCLIBuildSuite) TestBuildContextCleanupFailedBuild(c *testing.T) {
|
||||||
|
@ -1564,7 +1548,6 @@ func (s *DockerCLIBuildSuite) TestBuildContextCleanupFailedBuild(c *testing.T) {
|
||||||
if err = compareDirectoryEntries(entries, entriesFinal); err != nil {
|
if err = compareDirectoryEntries(entries, entriesFinal); err != nil {
|
||||||
c.Fatalf("context should have been deleted, but wasn't")
|
c.Fatalf("context should have been deleted, but wasn't")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// compareDirectoryEntries compares two sets of DirEntry (usually taken from a directory)
|
// compareDirectoryEntries compares two sets of DirEntry (usually taken from a directory)
|
||||||
|
@ -1724,7 +1707,6 @@ func (s *DockerCLIBuildSuite) TestBuildEmptyEntrypoint(c *testing.T) {
|
||||||
if res != expected {
|
if res != expected {
|
||||||
c.Fatalf("Entrypoint %s, expected %s", res, expected)
|
c.Fatalf("Entrypoint %s, expected %s", res, expected)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIBuildSuite) TestBuildEntrypoint(c *testing.T) {
|
func (s *DockerCLIBuildSuite) TestBuildEntrypoint(c *testing.T) {
|
||||||
|
@ -1738,7 +1720,6 @@ func (s *DockerCLIBuildSuite) TestBuildEntrypoint(c *testing.T) {
|
||||||
if res != expected {
|
if res != expected {
|
||||||
c.Fatalf("Entrypoint %s, expected %s", res, expected)
|
c.Fatalf("Entrypoint %s, expected %s", res, expected)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// #6445 ensure ONBUILD triggers aren't committed to grandchildren
|
// #6445 ensure ONBUILD triggers aren't committed to grandchildren
|
||||||
|
@ -2174,7 +2155,6 @@ func (s *DockerCLIBuildSuite) TestBuildWithVolumeOwnership(c *testing.T) {
|
||||||
if expected := "daemon daemon"; !strings.Contains(out, expected) {
|
if expected := "daemon daemon"; !strings.Contains(out, expected) {
|
||||||
c.Fatalf("expected %s received %s", expected, out)
|
c.Fatalf("expected %s received %s", expected, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// testing #1405 - config.Cmd does not get cleaned up if
|
// testing #1405 - config.Cmd does not get cleaned up if
|
||||||
|
@ -2282,7 +2262,6 @@ docker.com>"
|
||||||
if res != "\"Docker IO <io@docker.com>\"" {
|
if res != "\"Docker IO <io@docker.com>\"" {
|
||||||
c.Fatalf("Parsed string did not match the escaped string. Got: %q", res)
|
c.Fatalf("Parsed string did not match the escaped string. Got: %q", res)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIBuildSuite) TestBuildVerifyIntString(c *testing.T) {
|
func (s *DockerCLIBuildSuite) TestBuildVerifyIntString(c *testing.T) {
|
||||||
|
@ -2297,7 +2276,6 @@ func (s *DockerCLIBuildSuite) TestBuildVerifyIntString(c *testing.T) {
|
||||||
if !strings.Contains(out, "\"123\"") {
|
if !strings.Contains(out, "\"123\"") {
|
||||||
c.Fatalf("Output does not contain the int as a string:\n%s", out)
|
c.Fatalf("Output does not contain the int as a string:\n%s", out)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIBuildSuite) TestBuildDockerignore(c *testing.T) {
|
func (s *DockerCLIBuildSuite) TestBuildDockerignore(c *testing.T) {
|
||||||
|
@ -3215,7 +3193,6 @@ func (s *DockerCLIBuildSuite) TestBuildCmdShDashC(c *testing.T) {
|
||||||
if res != expected {
|
if res != expected {
|
||||||
c.Fatalf("Expected value %s not in Config.Cmd: %s", expected, res)
|
c.Fatalf("Expected value %s not in Config.Cmd: %s", expected, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIBuildSuite) TestBuildCmdSpaces(c *testing.T) {
|
func (s *DockerCLIBuildSuite) TestBuildCmdSpaces(c *testing.T) {
|
||||||
|
@ -3426,7 +3403,6 @@ func (s *DockerCLIBuildSuite) TestBuildLabelsCache(c *testing.T) {
|
||||||
if id1 == id2 {
|
if id1 == id2 {
|
||||||
c.Fatalf("Build 6 should have worked & NOT used the cache(%s,%s)", id1, id2)
|
c.Fatalf("Build 6 should have worked & NOT used the cache(%s,%s)", id1, id2)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME(vdemeester) port to docker/cli e2e tests (api tests should test suppressOutput option though)
|
// FIXME(vdemeester) port to docker/cli e2e tests (api tests should test suppressOutput option though)
|
||||||
|
@ -3477,7 +3453,6 @@ func (s *DockerCLIBuildSuite) TestBuildNotVerboseSuccess(c *testing.T) {
|
||||||
c.Fatalf("Test %s expected stderr to be empty, but it is [%#v]", te.Name, result.Stderr())
|
c.Fatalf("Test %s expected stderr to be empty, but it is [%#v]", te.Name, result.Stderr())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME(vdemeester) migrate to docker/cli tests
|
// FIXME(vdemeester) migrate to docker/cli tests
|
||||||
|
@ -3702,7 +3677,6 @@ CMD cat /foo/file`),
|
||||||
if out != expected {
|
if out != expected {
|
||||||
c.Fatalf("expected file contents for /foo/file to be %q but received %q", expected, out)
|
c.Fatalf("expected file contents for /foo/file to be %q but received %q", expected, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIBuildSuite) TestBuildFromMixedcaseDockerfile(c *testing.T) {
|
func (s *DockerCLIBuildSuite) TestBuildFromMixedcaseDockerfile(c *testing.T) {
|
||||||
|
@ -3752,7 +3726,6 @@ RUN find /tmp/`}))
|
||||||
!strings.Contains(result.Combined(), "/tmp/Dockerfile") {
|
!strings.Contains(result.Combined(), "/tmp/Dockerfile") {
|
||||||
c.Fatalf("Missing proper output: %s", result.Combined())
|
c.Fatalf("Missing proper output: %s", result.Combined())
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME(vdemeester) should migrate to docker/cli tests
|
// FIXME(vdemeester) should migrate to docker/cli tests
|
||||||
|
@ -3778,7 +3751,6 @@ RUN sh -c "find /tmp/" # sh -c is needed on Windows to use the correct find`)
|
||||||
!strings.Contains(result.Combined(), "/tmp/Dockerfile") {
|
!strings.Contains(result.Combined(), "/tmp/Dockerfile") {
|
||||||
c.Fatalf("Missing proper output: %s", result.Combined())
|
c.Fatalf("Missing proper output: %s", result.Combined())
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIBuildSuite) TestBuildFromOfficialNames(c *testing.T) {
|
func (s *DockerCLIBuildSuite) TestBuildFromOfficialNames(c *testing.T) {
|
||||||
|
@ -3859,7 +3831,6 @@ func (s *DockerCLIBuildSuite) TestBuildSpaces(c *testing.T) {
|
||||||
if strings.ReplaceAll(e1, " ", "") != strings.ReplaceAll(e2, " ", "") {
|
if strings.ReplaceAll(e1, " ", "") != strings.ReplaceAll(e2, " ", "") {
|
||||||
c.Fatalf("Build 4's error wasn't the same as build 1's\n1:%s\n4:%s", result1.Error, result2.Error)
|
c.Fatalf("Build 4's error wasn't the same as build 1's\n1:%s\n4:%s", result1.Error, result2.Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIBuildSuite) TestBuildSpacesWithQuotes(c *testing.T) {
|
func (s *DockerCLIBuildSuite) TestBuildSpacesWithQuotes(c *testing.T) {
|
||||||
|
@ -3937,7 +3908,6 @@ func (s *DockerCLIBuildSuite) TestBuildMissingArgs(c *testing.T) {
|
||||||
Err: cmd + " requires",
|
Err: cmd + " requires",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIBuildSuite) TestBuildEmptyScratch(c *testing.T) {
|
func (s *DockerCLIBuildSuite) TestBuildEmptyScratch(c *testing.T) {
|
||||||
|
@ -4109,7 +4079,6 @@ func (s *DockerCLIBuildSuite) TestBuildBuildTimeArg(c *testing.T) {
|
||||||
ARG %s
|
ARG %s
|
||||||
RUN echo $%s
|
RUN echo $%s
|
||||||
CMD echo $%s`, envKey, envKey, envKey)
|
CMD echo $%s`, envKey, envKey, envKey)
|
||||||
|
|
||||||
}
|
}
|
||||||
buildImage(imgName,
|
buildImage(imgName,
|
||||||
cli.WithFlags("--build-arg", fmt.Sprintf("%s=%s", envKey, envVal)),
|
cli.WithFlags("--build-arg", fmt.Sprintf("%s=%s", envKey, envVal)),
|
||||||
|
@ -4846,7 +4815,6 @@ func (s *DockerCLIBuildSuite) TestBuildFollowSymlinkToDir(c *testing.T) {
|
||||||
assert.Assert(c, !strings.Contains(result.Combined(), "Using cache"))
|
assert.Assert(c, !strings.Contains(result.Combined(), "Using cache"))
|
||||||
out = cli.DockerCmd(c, "run", "--rm", name, "cat", "abc", "def").Combined()
|
out = cli.DockerCmd(c, "run", "--rm", name, "cat", "abc", "def").Combined()
|
||||||
assert.Assert(c, cmp.Regexp("^barbax$", out))
|
assert.Assert(c, cmp.Regexp("^barbax$", out))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TestBuildSymlinkBasename tests that target file gets basename from symlink,
|
// TestBuildSymlinkBasename tests that target file gets basename from symlink,
|
||||||
|
@ -4869,7 +4837,6 @@ func (s *DockerCLIBuildSuite) TestBuildSymlinkBasename(c *testing.T) {
|
||||||
|
|
||||||
out := cli.DockerCmd(c, "run", "--rm", name, "cat", "asymlink").Combined()
|
out := cli.DockerCmd(c, "run", "--rm", name, "cat", "asymlink").Combined()
|
||||||
assert.Assert(c, cmp.Regexp("^bar$", out))
|
assert.Assert(c, cmp.Regexp("^bar$", out))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// #17827
|
// #17827
|
||||||
|
@ -5374,7 +5341,6 @@ func (s *DockerCLIBuildSuite) TestBuildCmdShellArgsEscaped(c *testing.T) {
|
||||||
if res != `["ipconfig"]` {
|
if res != `["ipconfig"]` {
|
||||||
c.Fatalf("CMD incorrect in Config.Cmd: got %v", res)
|
c.Fatalf("CMD incorrect in Config.Cmd: got %v", res)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test case for #24912.
|
// Test case for #24912.
|
||||||
|
@ -5614,7 +5580,6 @@ func (s *DockerCLIBuildSuite) TestBuildWithExtraHostInvalidFormat(c *testing.T)
|
||||||
ExitCode: 125,
|
ExitCode: 125,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIBuildSuite) TestBuildMultiStageCopyFromSyntax(c *testing.T) {
|
func (s *DockerCLIBuildSuite) TestBuildMultiStageCopyFromSyntax(c *testing.T) {
|
||||||
|
|
|
@ -237,7 +237,6 @@ func (s *DockerRegistrySuite) TestListImagesWithoutDigests(c *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerRegistrySuite) TestListImagesWithDigests(c *testing.T) {
|
func (s *DockerRegistrySuite) TestListImagesWithDigests(c *testing.T) {
|
||||||
|
|
||||||
// setup image1
|
// setup image1
|
||||||
digest1, err := setupImageWithTag(c, "tag1")
|
digest1, err := setupImageWithTag(c, "tag1")
|
||||||
assert.NilError(c, err, "error setting up image")
|
assert.NilError(c, err, "error setting up image")
|
||||||
|
@ -330,7 +329,7 @@ func (s *DockerRegistrySuite) TestListDanglingImagesWithDigests(c *testing.T) {
|
||||||
assert.Assert(c, re1.MatchString(out), "expected %q: %s", re1.String(), out)
|
assert.Assert(c, re1.MatchString(out), "expected %q: %s", re1.String(), out)
|
||||||
// setup image2
|
// setup image2
|
||||||
digest2, err := setupImageWithTag(c, "dangle2")
|
digest2, err := setupImageWithTag(c, "dangle2")
|
||||||
//error setting up image
|
// error setting up image
|
||||||
assert.NilError(c, err)
|
assert.NilError(c, err)
|
||||||
imageReference2 := fmt.Sprintf("%s@%s", repoName, digest2)
|
imageReference2 := fmt.Sprintf("%s@%s", repoName, digest2)
|
||||||
c.Logf("imageReference2 = %s", imageReference2)
|
c.Logf("imageReference2 = %s", imageReference2)
|
||||||
|
|
|
@ -61,7 +61,6 @@ func (s *DockerCLICreateSuite) TestCreateArgs(c *testing.T) {
|
||||||
if len(cont.Args) != len(expected) || b {
|
if len(cont.Args) != len(expected) || b {
|
||||||
c.Fatalf("Unexpected args. Expected %v, received: %v", expected, cont.Args)
|
c.Fatalf("Unexpected args. Expected %v, received: %v", expected, cont.Args)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure we can grow the container's rootfs at creation time.
|
// Make sure we can grow the container's rootfs at creation time.
|
||||||
|
@ -135,9 +134,7 @@ func (s *DockerCLICreateSuite) TestCreateWithPortRange(c *testing.T) {
|
||||||
for k, v := range cont.HostConfig.PortBindings {
|
for k, v := range cont.HostConfig.PortBindings {
|
||||||
assert.Equal(c, len(v), 1, fmt.Sprintf("Expected 1 ports binding, for the port %s but found %s", k, v))
|
assert.Equal(c, len(v), 1, fmt.Sprintf("Expected 1 ports binding, for the port %s but found %s", k, v))
|
||||||
assert.Equal(c, k.Port(), v[0].HostPort, fmt.Sprintf("Expected host port %s to match published port %s", k.Port(), v[0].HostPort))
|
assert.Equal(c, k.Port(), v[0].HostPort, fmt.Sprintf("Expected host port %s to match published port %s", k.Port(), v[0].HostPort))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLICreateSuite) TestCreateWithLargePortRange(c *testing.T) {
|
func (s *DockerCLICreateSuite) TestCreateWithLargePortRange(c *testing.T) {
|
||||||
|
@ -165,7 +162,6 @@ func (s *DockerCLICreateSuite) TestCreateWithLargePortRange(c *testing.T) {
|
||||||
assert.Equal(c, len(v), 1)
|
assert.Equal(c, len(v), 1)
|
||||||
assert.Equal(c, k.Port(), v[0].HostPort, fmt.Sprintf("Expected host port %s to match published port %s", k.Port(), v[0].HostPort))
|
assert.Equal(c, k.Port(), v[0].HostPort, fmt.Sprintf("Expected host port %s to match published port %s", k.Port(), v[0].HostPort))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// "test123" should be printed by docker create + start
|
// "test123" should be printed by docker create + start
|
||||||
|
@ -194,7 +190,6 @@ func (s *DockerCLICreateSuite) TestCreateVolumesCreated(c *testing.T) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.Fatalf("Error statting volume host path: %q", err)
|
c.Fatalf("Error statting volume host path: %q", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLICreateSuite) TestCreateLabels(c *testing.T) {
|
func (s *DockerCLICreateSuite) TestCreateLabels(c *testing.T) {
|
||||||
|
|
|
@ -172,7 +172,6 @@ func (s *DockerDaemonSuite) TestDaemonRestartUnlessStopped(c *testing.T) {
|
||||||
|
|
||||||
// both running
|
// both running
|
||||||
testRun(map[string]bool{"top1": true, "top2": true, "exit": true}, "After second daemon restart: ")
|
testRun(map[string]bool{"top1": true, "top2": true, "exit": true}, "After second daemon restart: ")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerDaemonSuite) TestDaemonRestartOnFailure(c *testing.T) {
|
func (s *DockerDaemonSuite) TestDaemonRestartOnFailure(c *testing.T) {
|
||||||
|
@ -979,7 +978,6 @@ func (s *DockerDaemonSuite) TestDaemonLinksIpTablesRulesWhenLinkAndUnlink(c *tes
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerDaemonSuite) TestDaemonUlimitDefaults(c *testing.T) {
|
func (s *DockerDaemonSuite) TestDaemonUlimitDefaults(c *testing.T) {
|
||||||
|
|
||||||
s.d.StartWithBusybox(c, "--default-ulimit", "nofile=42:42", "--default-ulimit", "nproc=1024:1024")
|
s.d.StartWithBusybox(c, "--default-ulimit", "nofile=42:42", "--default-ulimit", "nproc=1024:1024")
|
||||||
|
|
||||||
out, err := s.d.Cmd("run", "--ulimit", "nproc=2048", "--name=test", "busybox", "/bin/sh", "-c", "echo $(ulimit -n); echo $(ulimit -u)")
|
out, err := s.d.Cmd("run", "--ulimit", "nproc=2048", "--name=test", "busybox", "/bin/sh", "-c", "echo $(ulimit -n); echo $(ulimit -u)")
|
||||||
|
@ -1992,7 +1990,6 @@ func (s *DockerDaemonSuite) TestDaemonRestartWithKilledRunningContainer(t *testi
|
||||||
if out != "143" {
|
if out != "143" {
|
||||||
t.Fatalf("Expected exit code '%s' got '%s' for container '%s'\n", "143", out, cid)
|
t.Fatalf("Expected exit code '%s' got '%s' for container '%s'\n", "143", out, cid)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// os.Kill should kill daemon ungracefully, leaving behind live containers.
|
// os.Kill should kill daemon ungracefully, leaving behind live containers.
|
||||||
|
|
|
@ -117,7 +117,6 @@ func (s *DockerCLIEventSuite) TestEventsContainerEventsAttrSort(c *testing.T) {
|
||||||
if matches["eventType"] == "container" && matches["action"] == "create" {
|
if matches["eventType"] == "container" && matches["action"] == "create" {
|
||||||
matchedEvents++
|
matchedEvents++
|
||||||
assert.Check(c, strings.Contains(out, "(image=busybox, name=container-events-test)"), "Event attributes not sorted")
|
assert.Check(c, strings.Contains(out, "(image=busybox, name=container-events-test)"), "Event attributes not sorted")
|
||||||
|
|
||||||
} else if matches["eventType"] == "container" && matches["action"] == "start" {
|
} else if matches["eventType"] == "container" && matches["action"] == "start" {
|
||||||
matchedEvents++
|
matchedEvents++
|
||||||
assert.Check(c, strings.Contains(out, "(image=busybox, name=container-events-test)"), "Event attributes not sorted")
|
assert.Check(c, strings.Contains(out, "(image=busybox, name=container-events-test)"), "Event attributes not sorted")
|
||||||
|
|
|
@ -391,7 +391,6 @@ func (s *DockerCLIEventSuite) TestEventsFilterNetworkID(c *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerDaemonSuite) TestDaemonEvents(c *testing.T) {
|
func (s *DockerDaemonSuite) TestDaemonEvents(c *testing.T) {
|
||||||
|
|
||||||
// daemon config file
|
// daemon config file
|
||||||
configFilePath := "test.json"
|
configFilePath := "test.json"
|
||||||
defer os.Remove(configFilePath)
|
defer os.Remove(configFilePath)
|
||||||
|
@ -439,7 +438,6 @@ func (s *DockerDaemonSuite) TestDaemonEvents(c *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerDaemonSuite) TestDaemonEventsWithFilters(c *testing.T) {
|
func (s *DockerDaemonSuite) TestDaemonEventsWithFilters(c *testing.T) {
|
||||||
|
|
||||||
// daemon config file
|
// daemon config file
|
||||||
configFilePath := "test.json"
|
configFilePath := "test.json"
|
||||||
defer os.Remove(configFilePath)
|
defer os.Remove(configFilePath)
|
||||||
|
|
|
@ -76,7 +76,6 @@ func (s *DockerCLIExecSuite) TestExecInteractive(c *testing.T) {
|
||||||
case <-time.After(1 * time.Second):
|
case <-time.After(1 * time.Second):
|
||||||
c.Fatal("docker exec failed to exit on stdin close")
|
c.Fatal("docker exec failed to exit on stdin close")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIExecSuite) TestExecAfterContainerRestart(c *testing.T) {
|
func (s *DockerCLIExecSuite) TestExecAfterContainerRestart(c *testing.T) {
|
||||||
|
|
|
@ -152,7 +152,6 @@ func (s *DockerCLIHealthSuite) TestHealth(c *testing.T) {
|
||||||
out, _ = dockerCmd(c, "inspect",
|
out, _ = dockerCmd(c, "inspect",
|
||||||
"--format={{.Config.Healthcheck.Test}}", imageName)
|
"--format={{.Config.Healthcheck.Test}}", imageName)
|
||||||
assert.Equal(c, out, "[CMD cat /my status]\n")
|
assert.Equal(c, out, "[CMD cat /my status]\n")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GitHub #33021
|
// GitHub #33021
|
||||||
|
@ -175,5 +174,4 @@ ENTRYPOINT /bin/sh -c "sleep 600"`))
|
||||||
// Start
|
// Start
|
||||||
dockerCmd(c, "start", name)
|
dockerCmd(c, "start", name)
|
||||||
waitForHealthStatus(c, name, "starting", "healthy")
|
waitForHealthStatus(c, name, "starting", "healthy")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,6 @@ LABEL label.Z="Z"`))
|
||||||
actualValue := actualValues[i]
|
actualValue := actualValues[i]
|
||||||
assert.Assert(c, strings.Contains(actualValue, echoValue))
|
assert.Assert(c, strings.Contains(actualValue, echoValue))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIHistorySuite) TestHistoryExistentImage(c *testing.T) {
|
func (s *DockerCLIHistorySuite) TestHistoryExistentImage(c *testing.T) {
|
||||||
|
|
|
@ -91,7 +91,6 @@ func (s *DockerCLIInspectSuite) TestInspectStatus(c *testing.T) {
|
||||||
dockerCmd(c, "stop", out)
|
dockerCmd(c, "stop", out)
|
||||||
inspectOut = inspectField(c, out, "State.Status")
|
inspectOut = inspectField(c, out, "State.Status")
|
||||||
assert.Equal(c, inspectOut, "exited")
|
assert.Equal(c, inspectOut, "exited")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIInspectSuite) TestInspectTypeFlagContainer(c *testing.T) {
|
func (s *DockerCLIInspectSuite) TestInspectTypeFlagContainer(c *testing.T) {
|
||||||
|
@ -148,7 +147,7 @@ func (s *DockerCLIInspectSuite) TestInspectImageFilterInt(c *testing.T) {
|
||||||
size, err := strconv.Atoi(out)
|
size, err := strconv.Atoi(out)
|
||||||
assert.Assert(c, err == nil, "failed to inspect size of the image: %s, %v", out, err)
|
assert.Assert(c, err == nil, "failed to inspect size of the image: %s, %v", out, err)
|
||||||
|
|
||||||
//now see if the size turns out to be the same
|
// now see if the size turns out to be the same
|
||||||
formatStr := fmt.Sprintf("--format={{eq .Size %d}}", size)
|
formatStr := fmt.Sprintf("--format={{eq .Size %d}}", size)
|
||||||
out, _ = dockerCmd(c, "inspect", formatStr, imageTest)
|
out, _ = dockerCmd(c, "inspect", formatStr, imageTest)
|
||||||
result, err := strconv.ParseBool(strings.TrimSuffix(out, "\n"))
|
result, err := strconv.ParseBool(strings.TrimSuffix(out, "\n"))
|
||||||
|
@ -170,7 +169,7 @@ func (s *DockerCLIInspectSuite) TestInspectContainerFilterInt(c *testing.T) {
|
||||||
exitCode, err := strconv.Atoi(out)
|
exitCode, err := strconv.Atoi(out)
|
||||||
assert.Assert(c, err == nil, "failed to inspect exitcode of the container: %s, %v", out, err)
|
assert.Assert(c, err == nil, "failed to inspect exitcode of the container: %s, %v", out, err)
|
||||||
|
|
||||||
//now get the exit code to verify
|
// now get the exit code to verify
|
||||||
formatStr := fmt.Sprintf("--format={{eq .State.ExitCode %d}}", exitCode)
|
formatStr := fmt.Sprintf("--format={{eq .State.ExitCode %d}}", exitCode)
|
||||||
out, _ = dockerCmd(c, "inspect", formatStr, id)
|
out, _ = dockerCmd(c, "inspect", formatStr, id)
|
||||||
inspectResult, err := strconv.ParseBool(strings.TrimSuffix(out, "\n"))
|
inspectResult, err := strconv.ParseBool(strings.TrimSuffix(out, "\n"))
|
||||||
|
|
|
@ -100,7 +100,6 @@ func (s *DockerCLILinksSuite) TestLinksPingLinkedContainersAfterRename(c *testin
|
||||||
dockerCmd(c, "run", "--rm", "--link", "container_new:alias1", "--link", "container2:alias2", "busybox", "sh", "-c", "ping -c 1 alias1 -W 1 && ping -c 1 alias2 -W 1")
|
dockerCmd(c, "run", "--rm", "--link", "container_new:alias1", "--link", "container2:alias2", "busybox", "sh", "-c", "ping -c 1 alias1 -W 1 && ping -c 1 alias2 -W 1")
|
||||||
dockerCmd(c, "kill", idA)
|
dockerCmd(c, "kill", idA)
|
||||||
dockerCmd(c, "kill", idB)
|
dockerCmd(c, "kill", idB)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLILinksSuite) TestLinksInspectLinksStarted(c *testing.T) {
|
func (s *DockerCLILinksSuite) TestLinksInspectLinksStarted(c *testing.T) {
|
||||||
|
@ -147,7 +146,6 @@ func (s *DockerCLILinksSuite) TestLinksNotStartedParentNotFail(c *testing.T) {
|
||||||
dockerCmd(c, "create", "--name=first", "busybox", "top")
|
dockerCmd(c, "create", "--name=first", "busybox", "top")
|
||||||
dockerCmd(c, "create", "--name=second", "--link=first:first", "busybox", "top")
|
dockerCmd(c, "create", "--name=second", "--link=first:first", "busybox", "top")
|
||||||
dockerCmd(c, "start", "first")
|
dockerCmd(c, "start", "first")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLILinksSuite) TestLinksHostsFilesInject(c *testing.T) {
|
func (s *DockerCLILinksSuite) TestLinksHostsFilesInject(c *testing.T) {
|
||||||
|
|
|
@ -56,7 +56,6 @@ func (s *DockerNetworkSuite) SetUpSuite(c *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func setupRemoteNetworkDrivers(c *testing.T, mux *http.ServeMux, url, netDrv, ipamDrv string) {
|
func setupRemoteNetworkDrivers(c *testing.T, mux *http.ServeMux, url, netDrv, ipamDrv string) {
|
||||||
|
|
||||||
mux.HandleFunc("/Plugin.Activate", func(w http.ResponseWriter, r *http.Request) {
|
mux.HandleFunc("/Plugin.Activate", func(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Set("Content-Type", "application/vnd.docker.plugins.v1+json")
|
w.Header().Set("Content-Type", "application/vnd.docker.plugins.v1+json")
|
||||||
fmt.Fprintf(w, `{"Implements": ["%s", "%s"]}`, driverapi.NetworkPluginEndpointType, ipamapi.PluginEndpointType)
|
fmt.Fprintf(w, `{"Implements": ["%s", "%s"]}`, driverapi.NetworkPluginEndpointType, ipamapi.PluginEndpointType)
|
||||||
|
@ -759,7 +758,6 @@ func (s *DockerNetworkSuite) TestDockerNetworkDriverOptions(c *testing.T) {
|
||||||
assert.Equal(c, opts["opt2"], "drv2")
|
assert.Equal(c, opts["opt2"], "drv2")
|
||||||
dockerCmd(c, "network", "rm", "testopt")
|
dockerCmd(c, "network", "rm", "testopt")
|
||||||
assertNwNotAvailable(c, "testopt")
|
assertNwNotAvailable(c, "testopt")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerNetworkSuite) TestDockerPluginV2NetworkDriver(c *testing.T) {
|
func (s *DockerNetworkSuite) TestDockerPluginV2NetworkDriver(c *testing.T) {
|
||||||
|
@ -782,7 +780,6 @@ func (s *DockerNetworkSuite) TestDockerPluginV2NetworkDriver(c *testing.T) {
|
||||||
assertNwIsAvailable(c, "v2net")
|
assertNwIsAvailable(c, "v2net")
|
||||||
dockerCmd(c, "network", "rm", "v2net")
|
dockerCmd(c, "network", "rm", "v2net")
|
||||||
assertNwNotAvailable(c, "v2net")
|
assertNwNotAvailable(c, "v2net")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerDaemonSuite) TestDockerNetworkNoDiscoveryDefaultBridgeNetwork(c *testing.T) {
|
func (s *DockerDaemonSuite) TestDockerNetworkNoDiscoveryDefaultBridgeNetwork(c *testing.T) {
|
||||||
|
|
|
@ -38,7 +38,6 @@ func pruneNetworkAndVerify(c *testing.T, d *daemon.Daemon, kept, pruned []string
|
||||||
assert.NilError(c, err)
|
assert.NilError(c, err)
|
||||||
return out, ""
|
return out, ""
|
||||||
}, checker.Contains(s)), poll.WithTimeout(defaultReconciliationTimeout))
|
}, checker.Contains(s)), poll.WithTimeout(defaultReconciliationTimeout))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, s := range pruned {
|
for _, s := range pruned {
|
||||||
|
|
|
@ -130,7 +130,6 @@ func (s *DockerCLIPsSuite) TestPsListContainersBase(c *testing.T) {
|
||||||
|
|
||||||
out, _ = dockerCmd(c, "ps", "-f", "since="+firstID, "-f", "before="+fourthID, "-n=1")
|
out, _ = dockerCmd(c, "ps", "-f", "since="+firstID, "-f", "before="+fourthID, "-n=1")
|
||||||
assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, fmt.Sprintf("SINCE filter, BEFORE filter, LIMIT: Container list is not in the correct order: \n%s", out))
|
assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, fmt.Sprintf("SINCE filter, BEFORE filter, LIMIT: Container list is not in the correct order: \n%s", out))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func assertContainerList(out string, expected []string) bool {
|
func assertContainerList(out string, expected []string) bool {
|
||||||
|
@ -602,7 +601,6 @@ func (s *DockerCLIPsSuite) TestPsImageIDAfterUpdate(c *testing.T) {
|
||||||
f := strings.Fields(line)
|
f := strings.Fields(line)
|
||||||
assert.Equal(c, f[1], originalImageID)
|
assert.Equal(c, f[1], originalImageID)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerCLIPsSuite) TestPsNotShowPortsOfStoppedContainer(c *testing.T) {
|
func (s *DockerCLIPsSuite) TestPsNotShowPortsOfStoppedContainer(c *testing.T) {
|
||||||
|
|
|
@ -120,7 +120,6 @@ func (s *DockerHubPullSuite) TestPullNonExistingImage(c *testing.T) {
|
||||||
assert.Assert(c, !strings.Contains(record.out, "unauthorized"), `message should not contain "unauthorized"`)
|
assert.Assert(c, !strings.Contains(record.out, "unauthorized"), `message should not contain "unauthorized"`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TestPullFromCentralRegistryImplicitRefParts pulls an image from the central registry and verifies
|
// TestPullFromCentralRegistryImplicitRefParts pulls an image from the central registry and verifies
|
||||||
|
|
|
@ -63,13 +63,11 @@ func (s *DockerCLIRmiSuite) TestRmiTag(c *testing.T) {
|
||||||
{
|
{
|
||||||
imagesAfter, _ := dockerCmd(c, "images", "-a")
|
imagesAfter, _ := dockerCmd(c, "images", "-a")
|
||||||
assert.Equal(c, strings.Count(imagesAfter, "\n"), strings.Count(imagesBefore, "\n")+1, fmt.Sprintf("before: %q\n\nafter: %q\n", imagesBefore, imagesAfter))
|
assert.Equal(c, strings.Count(imagesAfter, "\n"), strings.Count(imagesBefore, "\n")+1, fmt.Sprintf("before: %q\n\nafter: %q\n", imagesBefore, imagesAfter))
|
||||||
|
|
||||||
}
|
}
|
||||||
dockerCmd(c, "rmi", "utest:tag1")
|
dockerCmd(c, "rmi", "utest:tag1")
|
||||||
{
|
{
|
||||||
imagesAfter, _ := dockerCmd(c, "images", "-a")
|
imagesAfter, _ := dockerCmd(c, "images", "-a")
|
||||||
assert.Equal(c, strings.Count(imagesAfter, "\n"), strings.Count(imagesBefore, "\n"), fmt.Sprintf("before: %q\n\nafter: %q\n", imagesBefore, imagesAfter))
|
assert.Equal(c, strings.Count(imagesAfter, "\n"), strings.Count(imagesBefore, "\n"), fmt.Sprintf("before: %q\n\nafter: %q\n", imagesBefore, imagesAfter))
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,6 @@ func (s *DockerCLIRunSuite) TestRunLookupGoogleDNS(c *testing.T) {
|
||||||
} else {
|
} else {
|
||||||
dockerCmd(c, "run", "busybox", "nslookup", "google.com")
|
dockerCmd(c, "run", "busybox", "nslookup", "google.com")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// the exit code should be 0
|
// the exit code should be 0
|
||||||
|
@ -355,7 +354,6 @@ func (s *DockerCLIRunSuite) TestRunWithDaemonFlags(c *testing.T) {
|
||||||
|
|
||||||
// Regression test for #4979
|
// Regression test for #4979
|
||||||
func (s *DockerCLIRunSuite) TestRunWithVolumesFromExited(c *testing.T) {
|
func (s *DockerCLIRunSuite) TestRunWithVolumesFromExited(c *testing.T) {
|
||||||
|
|
||||||
var (
|
var (
|
||||||
out string
|
out string
|
||||||
exitCode int
|
exitCode int
|
||||||
|
|
|
@ -137,5 +137,4 @@ func (s *DockerSwarmSuite) TestServiceHealthStart(c *testing.T) {
|
||||||
task = d.GetTask(c, task.ID)
|
task = d.GetTask(c, task.ID)
|
||||||
return task.Status.State, ""
|
return task.Status.State, ""
|
||||||
}, checker.Equals(swarm.TaskStateRunning)), poll.WithTimeout(defaultReconciliationTimeout))
|
}, checker.Equals(swarm.TaskStateRunning)), poll.WithTimeout(defaultReconciliationTimeout))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -615,7 +615,6 @@ const globalNetworkPlugin = "global-network-plugin"
|
||||||
const globalIPAMPlugin = "global-ipam-plugin"
|
const globalIPAMPlugin = "global-ipam-plugin"
|
||||||
|
|
||||||
func setupRemoteGlobalNetworkPlugin(c *testing.T, mux *http.ServeMux, url, netDrv, ipamDrv string) {
|
func setupRemoteGlobalNetworkPlugin(c *testing.T, mux *http.ServeMux, url, netDrv, ipamDrv string) {
|
||||||
|
|
||||||
mux.HandleFunc("/Plugin.Activate", func(w http.ResponseWriter, r *http.Request) {
|
mux.HandleFunc("/Plugin.Activate", func(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Set("Content-Type", "application/vnd.docker.plugins.v1+json")
|
w.Header().Set("Content-Type", "application/vnd.docker.plugins.v1+json")
|
||||||
fmt.Fprintf(w, `{"Implements": ["%s", "%s"]}`, driverapi.NetworkPluginEndpointType, ipamapi.PluginEndpointType)
|
fmt.Fprintf(w, `{"Implements": ["%s", "%s"]}`, driverapi.NetworkPluginEndpointType, ipamapi.PluginEndpointType)
|
||||||
|
@ -923,7 +922,6 @@ func (s *DockerSwarmSuite) TestSwarmServiceNetworkUpdate(c *testing.T) {
|
||||||
result.Assert(c, icmd.Success)
|
result.Assert(c, icmd.Success)
|
||||||
|
|
||||||
poll.WaitOn(c, pollCheck(c, d.CheckRunningTaskNetworks, checker.DeepEquals(map[string]int{barNetwork: 1, bazNetwork: 1})), poll.WithTimeout(defaultReconciliationTimeout))
|
poll.WaitOn(c, pollCheck(c, d.CheckRunningTaskNetworks, checker.DeepEquals(map[string]int{barNetwork: 1, bazNetwork: 1})), poll.WithTimeout(defaultReconciliationTimeout))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerSwarmSuite) TestDNSConfig(c *testing.T) {
|
func (s *DockerSwarmSuite) TestDNSConfig(c *testing.T) {
|
||||||
|
|
|
@ -104,5 +104,4 @@ func (s *DockerSwarmSuite) TestSwarmNetworkPluginV2(c *testing.T) {
|
||||||
assert.NilError(c, err)
|
assert.NilError(c, err)
|
||||||
|
|
||||||
poll.WaitOn(c, pollCheck(c, d1.CheckRunningTaskImages, checker.DeepEquals(map[string]int{image: 1})), poll.WithTimeout(defaultReconciliationTimeout))
|
poll.WaitOn(c, pollCheck(c, d1.CheckRunningTaskImages, checker.DeepEquals(map[string]int{image: 1})), poll.WithTimeout(defaultReconciliationTimeout))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,7 +109,6 @@ func TestConfigList(t *testing.T) {
|
||||||
})
|
})
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
assert.Check(t, is.DeepEqual(configNamesFromList(entries), tc.expected))
|
assert.Check(t, is.DeepEqual(configNamesFromList(entries), tc.expected))
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -169,7 +169,6 @@ func TestDaemonHostGatewayIP(t *testing.T) {
|
||||||
assert.Check(t, is.Contains(res.Stdout(), "6.7.8.9"))
|
assert.Check(t, is.Contains(res.Stdout(), "6.7.8.9"))
|
||||||
c.ContainerRemove(ctx, cID, types.ContainerRemoveOptions{Force: true})
|
c.ContainerRemove(ctx, cID, types.ContainerRemoveOptions{Force: true})
|
||||||
d.Stop(t)
|
d.Stop(t)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TestRestartDaemonWithRestartingContainer simulates a case where a container is in "restarting" state when
|
// TestRestartDaemonWithRestartingContainer simulates a case where a container is in "restarting" state when
|
||||||
|
|
|
@ -170,7 +170,6 @@ func testLogs(t *testing.T, logDriver string) {
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.DeepEqual(t, stdoutStr, tC.expectedOut)
|
assert.DeepEqual(t, stdoutStr, tC.expectedOut)
|
||||||
|
|
|
@ -122,7 +122,6 @@ func TestDaemonRestartKillContainers(t *testing.T) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
time.Sleep(2 * time.Second)
|
time.Sleep(2 * time.Second)
|
||||||
|
|
||||||
}
|
}
|
||||||
assert.Equal(t, expected, running, "got unexpected running state, expected %v, got: %v", expected, running)
|
assert.Equal(t, expected, running, "got unexpected running state, expected %v, got: %v", expected, running)
|
||||||
|
|
||||||
|
@ -209,5 +208,4 @@ func TestContainerWithAutoRemoveCanBeRestarted(t *testing.T) {
|
||||||
poll.WaitOn(t, testContainer.IsRemoved(ctx, cli, cID))
|
poll.WaitOn(t, testContainer.IsRemoved(ctx, cli, cID))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -241,5 +241,4 @@ func TestWaitRestartedContainer(t *testing.T) {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,5 +37,4 @@ func Overlay2Supported(kernelVersion string) bool {
|
||||||
}
|
}
|
||||||
requiredV := kernel.VersionInfo{Kernel: 4}
|
requiredV := kernel.VersionInfo{Kernel: 4}
|
||||||
return kernel.CompareKernelVersion(*daemonV, requiredV) > -1
|
return kernel.CompareKernelVersion(*daemonV, requiredV) > -1
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,7 +96,6 @@ func TestDaemonDefaultNetworkPools(t *testing.T) {
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
assert.Equal(t, out.IPAM.Config[0].Subnet, "175.33.1.0/24")
|
assert.Equal(t, out.IPAM.Config[0].Subnet, "175.33.1.0/24")
|
||||||
delInterface(t, defaultNetworkBridge)
|
delInterface(t, defaultNetworkBridge)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDaemonRestartWithExistingNetwork(t *testing.T) {
|
func TestDaemonRestartWithExistingNetwork(t *testing.T) {
|
||||||
|
@ -454,5 +453,4 @@ func TestServiceWithDefaultAddressPoolInit(t *testing.T) {
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
err = d.SwarmLeave(t, true)
|
err = d.SwarmLeave(t, true)
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,5 +88,4 @@ func TestReadPluginNoRead(t *testing.T) {
|
||||||
assert.Assert(t, strings.TrimSpace(buf.String()) == "hello world", buf.Bytes())
|
assert.Assert(t, strings.TrimSpace(buf.String()) == "hello world", buf.Bytes())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,7 +109,6 @@ func TestSecretList(t *testing.T) {
|
||||||
})
|
})
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
assert.Check(t, is.DeepEqual(secretNamesFromList(entries), tc.expected))
|
assert.Check(t, is.DeepEqual(secretNamesFromList(entries), tc.expected))
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -398,7 +398,6 @@ func TestCreateServiceSysctls(t *testing.T) {
|
||||||
// net.ipv4.ip_nonlocal_bind is, we can verify that setting the sysctl
|
// net.ipv4.ip_nonlocal_bind is, we can verify that setting the sysctl
|
||||||
// options works
|
// options works
|
||||||
for _, expected := range []string{"0", "1"} {
|
for _, expected := range []string{"0", "1"} {
|
||||||
|
|
||||||
// store the map we're going to be using everywhere.
|
// store the map we're going to be using everywhere.
|
||||||
expectedSysctls := map[string]string{"net.ipv4.ip_nonlocal_bind": expected}
|
expectedSysctls := map[string]string{"net.ipv4.ip_nonlocal_bind": expected}
|
||||||
|
|
||||||
|
|
|
@ -104,5 +104,4 @@ func TestServiceListWithStatuses(t *testing.T) {
|
||||||
assert.Check(t, is.Equal(service.ServiceStatus.DesiredTasks, replicas))
|
assert.Check(t, is.Equal(service.ServiceStatus.DesiredTasks, replicas))
|
||||||
assert.Check(t, is.Equal(service.ServiceStatus.RunningTasks, replicas))
|
assert.Check(t, is.Equal(service.ServiceStatus.RunningTasks, replicas))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,6 @@ func TestEventsExecDie(t *testing.T) {
|
||||||
case <-time.After(time.Second * 3):
|
case <-time.After(time.Second * 3):
|
||||||
t.Fatal("timeout hit")
|
t.Fatal("timeout hit")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test case for #18888: Events messages have been switched from generic
|
// Test case for #18888: Events messages have been switched from generic
|
||||||
|
|
|
@ -63,5 +63,4 @@ func TestLayerSize(t *testing.T) {
|
||||||
if expected := len(content1) + len(content2); int(layer2Size) != expected {
|
if expected := len(content1) + len(content2); int(layer2Size) != expected {
|
||||||
t.Fatalf("Unexpected size %d, expected %d", layer2Size, expected)
|
t.Fatalf("Unexpected size %d, expected %d", layer2Size, expected)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,10 +55,8 @@ func DevicesFromPath(pathOnHost, pathInContainer, cgroupPermissions string) (dev
|
||||||
// if the device is not a device node
|
// if the device is not a device node
|
||||||
// try to see if it's a directory holding many devices
|
// try to see if it's a directory holding many devices
|
||||||
if err == devices.ErrNotADevice {
|
if err == devices.ErrNotADevice {
|
||||||
|
|
||||||
// check if it is a directory
|
// check if it is a directory
|
||||||
if src, e := os.Stat(resolvedPathOnHost); e == nil && src.IsDir() {
|
if src, e := os.Stat(resolvedPathOnHost); e == nil && src.IsDir() {
|
||||||
|
|
||||||
// mount the internal devices recursively
|
// mount the internal devices recursively
|
||||||
// TODO check if additional errors should be handled or logged
|
// TODO check if additional errors should be handled or logged
|
||||||
_ = filepath.Walk(resolvedPathOnHost, func(dpath string, f os.FileInfo, _ error) error {
|
_ = filepath.Walk(resolvedPathOnHost, func(dpath string, f os.FileInfo, _ error) error {
|
||||||
|
|
|
@ -16,5 +16,4 @@ func TestAddressPoolOpt(t *testing.T) {
|
||||||
if err := poolopt.Set(invalidAddresspoolString); err == nil {
|
if err := poolopt.Set(invalidAddresspoolString); err == nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,6 @@ func TestValidateIPAddress(t *testing.T) {
|
||||||
if ret, err := ValidateIPAddress(`random invalid string`); err == nil || ret != "" {
|
if ret, err := ValidateIPAddress(`random invalid string`); err == nil || ret != "" {
|
||||||
t.Fatalf("ValidateIPAddress(`random invalid string`) got %s %s", ret, err)
|
t.Fatalf("ValidateIPAddress(`random invalid string`) got %s %s", ret, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMapOpts(t *testing.T) {
|
func TestMapOpts(t *testing.T) {
|
||||||
|
@ -89,7 +88,6 @@ func TestListOptsWithoutValidator(t *testing.T) {
|
||||||
if len(mapListOpts) != 1 {
|
if len(mapListOpts) != 1 {
|
||||||
t.Errorf("Expected [map[bar:{}]], got [%v]", mapListOpts)
|
t.Errorf("Expected [map[bar:{}]], got [%v]", mapListOpts)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestListOptsWithValidator(t *testing.T) {
|
func TestListOptsWithValidator(t *testing.T) {
|
||||||
|
@ -264,7 +262,6 @@ func TestValidateLabel(t *testing.T) {
|
||||||
assert.Check(t, is.Equal(result, testCase.expectedResult))
|
assert.Check(t, is.Equal(result, testCase.expectedResult))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -385,7 +385,6 @@ func ReplaceFileTarWrapper(inputTarStream io.ReadCloser, mods map[string]TarModi
|
||||||
}
|
}
|
||||||
|
|
||||||
pipeWriter.Close()
|
pipeWriter.Close()
|
||||||
|
|
||||||
}()
|
}()
|
||||||
return pipeReader
|
return pipeReader
|
||||||
}
|
}
|
||||||
|
@ -772,7 +771,6 @@ func createTarFile(path, extractDir string, hdr *tar.Header, reader io.Reader, L
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(errors) > 0 {
|
if len(errors) > 0 {
|
||||||
|
|
|
@ -61,7 +61,6 @@ func checkOpaqueness(t *testing.T, path string, opaque string) {
|
||||||
if string(xattrOpaque) != opaque {
|
if string(xattrOpaque) != opaque {
|
||||||
t.Fatalf("Unexpected opaque value: %q, expected %q", string(xattrOpaque), opaque)
|
t.Fatalf("Unexpected opaque value: %q, expected %q", string(xattrOpaque), opaque)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkOverlayWhiteout(t *testing.T, path string) {
|
func checkOverlayWhiteout(t *testing.T, path string) {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue