This repository was archived by the owner on Oct 13, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
6d8fbac
Configure log-format earlier, and small refactor
thaJeztah Nov 24, 2018
1bda75e
migrated container wait integration tests from integration-cli to int…
adshmh Jul 23, 2018
5cde2dd
[18.09] integration/internal: add new test options
AkihiroSuda Oct 10, 2018
7985bd8
integration/container: add a base test for C/R
avagin Dec 29, 2018
4ac5dba
Fix CheckpointList
avagin Dec 29, 2018
9fa7f6c
Temporarily disable TestCheckpoint
thaJeztah Apr 1, 2019
9f02d3b
integration: change network.CreateNoError signature to fix linting
thaJeztah Jun 6, 2019
c82cbe9
integration: change container.Create signature to fix linting
thaJeztah Jun 6, 2019
85c5aab
integration: change container.Run signature to fix linting
thaJeztah Jun 6, 2019
2eb2aaf
integration: change createAmbiguousNetworks signature to fix linting
thaJeztah Jun 6, 2019
e91e9c3
integration: change testGraphDriver signature to fix linting
thaJeztah Jun 6, 2019
4005149
integration: get tests to compile again
Jun 12, 2019
e9bd47a
Revert "integration: have container.Create call compile"
thaJeztah Oct 8, 2019
4aae081
Revert "Fixing integration test"
thaJeztah Oct 8, 2019
a5620fc
TestServiceWithDefaultAddressPoolInit
selansen Sep 13, 2018
93de6ed
Add TC to check dyanmic subnet for ingress network
Sep 20, 2019
8c60be3
integration-cli/build: don't panic
kolyshkin Dec 21, 2018
e42b14a
*: remove interfacer linter from CI
cyphar Mar 12, 2019
5c1aea7
integration-cli: don't build -test images if they already exist
cyphar Mar 12, 2019
6cc5e98
internal: test/env: switch to assert.TestingT
cyphar Mar 12, 2019
266674a
Integration: remove unneeded platform check for IPVLAN tests
thaJeztah Jun 28, 2019
989a8a6
Integration: IPVlan add missing import comment
thaJeztah Jun 28, 2019
4ecaa08
Integration: exclude IPVlan test-suite on Windows
thaJeztah Jul 11, 2019
bd195d0
Integration: remove redundant kernel version check for MACVlan
thaJeztah Jun 28, 2019
e5493c4
Integration: MACVlan add missing import comment and build-tag
thaJeztah Jun 28, 2019
3ca37e6
integration-cli: remove ExecSupport check
thaJeztah Jul 8, 2019
0a071f7
integration-cli: remove defaultSleepImage constant
thaJeztah Jul 8, 2019
9fc8134
integration-cli: remove unused requirements utils
thaJeztah Jul 8, 2019
4fb6f3f
Add containerd.WithTimeout(60*time.Second) to match old calls
Aug 22, 2018
cbd8227
Add (hidden) flags to set containerd namespaces
cpuguy83 Jul 11, 2019
34024ad
integration: fix cleanup of raft data
thaJeztah Jul 12, 2019
0f2b3f6
Optimize test daemon startup
cpuguy83 Apr 17, 2019
0ba4e3e
Add log entries for daemon startup/shutdown
cpuguy83 Apr 19, 2019
b773f3c
Improve select for daemon restart tests
crosbymichael Jul 2, 2019
81966d1
Don't log test initial test daemon ping failures
cpuguy83 Jul 12, 2019
7fb18ca
Fix Microsecond -> Milisecond.
cpuguy83 Jul 13, 2019
943bb6a
DockerSwarmSuite lock portIndex to work around race
thaJeztah Jul 13, 2019
bc63fef
Be more conservative for Windows in TestFrequency for Splunk
ddebroy Jul 17, 2019
743c961
Testing: create new daemon (only) if needed
thaJeztah Dec 24, 2018
72c8a91
integration: run build session tests on non-experimental
thaJeztah Jul 17, 2019
99725d6
integration-cli: increase healthcheck timeout
tonistiigi Jul 18, 2019
5905728
Retry service updates on out of sequence errors
dperny Jul 18, 2019
147c94d
integration-cli: remove redundant "testrequires"
thaJeztah Jul 19, 2019
48bfa1d
Add `FromClient` to test env execution
cpuguy83 Jul 24, 2019
03c4cf7
Better logging for swarm tests
cpuguy83 Jul 24, 2019
e1dc7f1
hack: Remove inContainer check, it wasn't useful
seemethere Jul 24, 2019
0de5218
Fix flaky TestServiceWithDefaultAddressPoolInit
Aug 5, 2019
8c69826
Move defer method to the top right after New is called
Aug 15, 2019
eed1ea0
Windows:Disable 2 restart test when Hyper-V
Feb 22, 2019
033474e
integration-cli/requirements: Skip windows specific isolation require…
Snorch Aug 7, 2019
baae46a
Dockerfile: update CRIU to v3.12
thaJeztah Aug 14, 2019
47c2af9
pkg/term: refactor TestEscapeProxyRead
thaJeztah Aug 27, 2019
81f3399
integration: windows.ps1: turn defender error into a warning
thaJeztah Aug 27, 2019
63c9022
LCOW: Log stderr on failures
Mar 8, 2018
fa1a38d
TestDispatch: refactor to use subtests again, and fix linting (struct…
thaJeztah Aug 27, 2019
27e9144
integration-cli: getContainerCount() fix trimming prefix
thaJeztah Aug 28, 2019
6e6c1ac
Fix docker inspect for dutimgVersion
StefanScherer Aug 30, 2019
b5a2940
integration-cli: fix some bashism's in Dockerfiles
thaJeztah Sep 2, 2019
d01572e
TestBuildSquashParent: fix non-standard comparisson
thaJeztah Sep 2, 2019
0f8e14d
hack/make/binary-daemon: fix some linting issues
thaJeztah Aug 31, 2019
49afe72
TestCase: use `icmd.RunCmd` instead `icmd.StartCmd`
tao12345666333 Sep 2, 2019
bec7a85
hack/ci/windows.ps1: explicitly set exit code to result of tests
thaJeztah Sep 2, 2019
5ed27d1
hack/ci/windows.ps1 print all environment variables to check how Jenk…
thaJeztah Sep 6, 2019
69ee162
integration-cli: update TestCreateWithWorkdir for Hyper-V isolation
thaJeztah Sep 4, 2019
65dc979
hack/ci/windows.ps1: add support for DOCKER_STORAGE_OPTS
thaJeztah Sep 4, 2019
2cf0f0a
hack/ci/windows.ps1: stop tailing logs after stopping the daemon
thaJeztah Sep 6, 2019
ef77905
Fix Service TTY test so signal handlers work
cpuguy83 Sep 9, 2019
9544f87
integration-cli: swarm.RestartNode(); don't load busybox again
thaJeztah Sep 9, 2019
9bc5695
integration-cli: add daemon.StartNodeWithBusybox function
thaJeztah Sep 9, 2019
6e1a428
Windows: skip flaky TestLogBlocking
thaJeztah Sep 9, 2019
d236d18
awslogs: fix flaky TestLogBlocking unit test
samuelkarp Sep 20, 2019
a6d21bd
Fix more signal handling issues in tests.
cpuguy83 Sep 9, 2019
d88eaeb
Disable TestPsListContainersFilterExited (Windows)
Sep 17, 2019
b739525
integration-cli: run goimports
Sep 19, 2019
5766d99
[18.09] change c.Skip() to testRequires()
thaJeztah Oct 8, 2019
c3bc5d2
hack/test/unit: fix custom TESTFLAGS not working
thaJeztah Sep 13, 2019
9826c3e
[18.09] TEMPORARILY DISABLE FLAKY TEST CHECK
thaJeztah Oct 23, 2019
d4a5e65
TESTING: SKIP TestSwarmVolumePlugin
thaJeztah Oct 24, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Dockerfile
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,7 +36,7 @@ RUN sed -ri "s/(httpredir|deb).debian.org/${APT_MIRROR:-deb.debian.org}/g" /etc/
FROM base AS criu
ARG DEBIAN_FRONTEND
# Install CRIU for checkpoint/restore support
ENV CRIU_VERSION 3.6
ENV CRIU_VERSION 3.12
# Install dependency packages specific to criu
RUN apt-get update && apt-get install -y --no-install-recommends \
libnet-dev \
Expand DownExpand Up@@ -251,6 +251,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
zip \
bzip2 \
xz-utils \
libprotobuf-c1 \
libnet1 \
libnl-3-200 \
&& rm -rf /var/lib/apt/lists/*

RUN pip3 install yamllint==1.16.0
Expand Down
80 changes: 38 additions & 42 deletions builder/dockerfile/evaluator_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,7 @@ package dockerfile // import "github.com/docker/docker/builder/dockerfile"

import (
"os"
"runtime"
"testing"

"github.com/docker/docker/builder/remotecontext"
Expand All@@ -23,8 +24,11 @@ func init() {
reexec.Init()
}

func initDispatchTestCases() []dispatchTestCase {
dispatchTestCases := []dispatchTestCase{
func TestDispatch(t *testing.T) {
if runtime.GOOS != "windows" {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
}
testCases := []dispatchTestCase{
{
name: "ADD multiple files to file",
cmd: &instructions.AddCommand{SourcesAndDest: instructions.SourcesAndDest{
Expand DownExpand Up@@ -91,54 +95,46 @@ func initDispatchTestCases() []dispatchTestCase {
}},
expectedError: "source can't be a URL for COPY",
files: nil,
}}

return dispatchTestCases
}

func TestDispatch(t *testing.T) {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
testCases := initDispatchTestCases()

for _, testCase := range testCases {
executeTestCase(t, testCase)
},
}
}

func executeTestCase(t *testing.T, testCase dispatchTestCase) {
contextDir, cleanup := createTestTempDir(t, "", "builder-dockerfile-test")
defer cleanup()
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
contextDir, cleanup := createTestTempDir(t, "", "builder-dockerfile-test")
defer cleanup()

for filename, content := range testCase.files {
createTestTempFile(t, contextDir, filename, content, 0777)
}
for filename, content := range tc.files {
createTestTempFile(t, contextDir, filename, content, 0777)
}

tarStream, err := archive.Tar(contextDir, archive.Uncompressed)
tarStream, err := archive.Tar(contextDir, archive.Uncompressed)

if err != nil {
t.Fatalf("Error when creating tar stream: %s", err)
}
if err != nil {
t.Fatalf("Error when creating tar stream: %s", err)
}

defer func() {
if err = tarStream.Close(); err != nil {
t.Fatalf("Error when closing tar stream: %s", err)
}
}()
defer func() {
if err = tarStream.Close(); err != nil {
t.Fatalf("Error when closing tar stream: %s", err)
}
}()

context, err := remotecontext.FromArchive(tarStream)
context, err := remotecontext.FromArchive(tarStream)

if err != nil {
t.Fatalf("Error when creating tar context: %s", err)
}
if err != nil {
t.Fatalf("Error when creating tar context: %s", err)
}

defer func() {
if err = context.Close(); err != nil {
t.Fatalf("Error when closing tar context: %s", err)
}
}()
defer func() {
if err = context.Close(); err != nil {
t.Fatalf("Error when closing tar context: %s", err)
}
}()

b := newBuilderWithMockBackend()
sb := newDispatchRequest(b, '`', context, NewBuildArgs(make(map[string]*string)), newStagesBuildResults())
err = dispatch(sb, testCase.cmd)
assert.Check(t, is.ErrorContains(err, testCase.expectedError))
b := newBuilderWithMockBackend()
sb := newDispatchRequest(b, '`', context, NewBuildArgs(make(map[string]*string)), newStagesBuildResults())
err = dispatch(sb, tc.cmd)
assert.Check(t, is.ErrorContains(err, tc.expectedError))
})
}
}
9 changes: 7 additions & 2 deletions builder/dockerfile/internals_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -47,6 +47,9 @@ func TestDockerfileOutsideTheBuildContext(t *testing.T) {
defer cleanup()

expectedError := "Forbidden path outside the build context: ../../Dockerfile ()"
if runtime.GOOS == "windows" {
expectedError = "failed to resolve scoped path ../../Dockerfile ()"
}

readAndCheckDockerfile(t, "DockerfileOutsideTheBuildContext", contextDir, "../../Dockerfile", expectedError)
}
Expand All@@ -61,7 +64,9 @@ func TestNonExistingDockerfile(t *testing.T) {
}

func readAndCheckDockerfile(t *testing.T, testName, contextDir, dockerfilePath, expectedError string) {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
if runtime.GOOS != "windows" {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
}
tarStream, err := archive.Tar(contextDir, archive.Uncompressed)
assert.NilError(t, err)

Expand All@@ -80,7 +85,7 @@ func readAndCheckDockerfile(t *testing.T, testName, contextDir, dockerfilePath,
Source: tarStream,
}
_, _, err = remotecontext.Detect(config)
assert.Check(t, is.Error(err, expectedError))
assert.Check(t, is.ErrorContains(err, expectedError))
}

func TestCopyRunConfig(t *testing.T) {
Expand Down
9 changes: 9 additions & 0 deletions cmd/dockerd/config.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,8 +3,10 @@ package main
import (
"runtime"

"github.com/docker/docker/daemon"
"github.com/docker/docker/daemon/config"
"github.com/docker/docker/opts"
"github.com/docker/docker/plugin/executor/containerd"
"github.com/docker/docker/registry"
"github.com/spf13/pflag"
)
Expand DownExpand Up@@ -80,6 +82,13 @@ func installCommonConfigFlags(conf *config.Config, flags *pflag.FlagSet) {

conf.MaxConcurrentDownloads = &maxConcurrentDownloads
conf.MaxConcurrentUploads = &maxConcurrentUploads

flags.StringVar(&conf.ContainerdNamespace, "containerd-namespace", daemon.ContainersNamespace, "Containerd namespace to use")
if err := flags.MarkHidden("containerd-namespace"); err != nil {
return
}
flags.StringVar(&conf.ContainerdPluginNamespace, "containerd-plugins-namespace", containerd.PluginNamespace, "Containerd namespace to use for plugins")
flags.MarkHidden("containerd-plugins-namespace")
}

func installRegistryServiceFlags(options *registry.ServiceOptions, flags *pflag.FlagSet) {
Expand Down
36 changes: 27 additions & 9 deletions cmd/dockerd/daemon.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -83,6 +83,13 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
if cli.Config, err = loadDaemonCliConfig(opts); err != nil {
return err
}

if err := configureDaemonLogs(cli.Config); err != nil {
return err
}

logrus.Info("Starting up")

cli.configFile = &opts.configFile
cli.flags = opts.flags

Expand All@@ -94,12 +101,6 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
logrus.Warn("Running experimental build")
}

logrus.SetFormatter(&logrus.TextFormatter{
TimestampFormat: jsonmessage.RFC3339NanoFixed,
DisableColors: cli.Config.RawLogs,
FullTimestamp: true,
})

system.InitLCOW(cli.Config.Experimental)

if err := setDefaultUmask(); err != nil {
Expand DownExpand Up@@ -249,6 +250,7 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
return fmt.Errorf("Shutting down due to ServeAPI error: %v", errAPI)
}

logrus.Info("Daemon shutdown complete")
return nil
}

Expand DownExpand Up@@ -471,9 +473,6 @@ func loadDaemonCliConfig(opts *daemonOptions) (*config.Config, error) {
conf.TLS = true
}

// ensure that the log level is the one set after merging configurations
setLogLevel(conf.LogLevel)

return conf, nil
}

Expand DownExpand Up@@ -670,3 +669,22 @@ func systemContainerdRunning() bool {
_, err := os.Lstat(containerddefaults.DefaultAddress)
return err == nil
}

// configureDaemonLogs sets the logrus logging level and formatting
func configureDaemonLogs(conf *config.Config) error {
if conf.LogLevel != "" {
lvl, err := logrus.ParseLevel(conf.LogLevel)
if err != nil {
return fmt.Errorf("unable to parse logging level: %s", conf.LogLevel)
}
logrus.SetLevel(lvl)
} else {
logrus.SetLevel(logrus.InfoLevel)
}
logrus.SetFormatter(&logrus.TextFormatter{
TimestampFormat: jsonmessage.RFC3339NanoFixed,
DisableColors: conf.RawLogs,
FullTimestamp: true,
})
return nil
}
20 changes: 19 additions & 1 deletion cmd/dockerd/daemon_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,7 +146,6 @@ func TestLoadDaemonCliConfigWithLogLevel(t *testing.T) {
assert.NilError(t, err)
assert.Assert(t, loadedConfig != nil)
assert.Check(t, is.Equal("warn", loadedConfig.LogLevel))
assert.Check(t, is.Equal(logrus.WarnLevel, logrus.GetLevel()))
}

func TestLoadDaemonConfigWithEmbeddedOptions(t *testing.T) {
Expand DownExpand Up@@ -180,3 +179,22 @@ func TestLoadDaemonConfigWithRegistryOptions(t *testing.T) {
assert.Check(t, is.Len(loadedConfig.Mirrors, 1))
assert.Check(t, is.Len(loadedConfig.InsecureRegistries, 1))
}

func TestConfigureDaemonLogs(t *testing.T) {
conf := &config.Config{}
err := configureDaemonLogs(conf)
assert.NilError(t, err)
assert.Check(t, is.Equal(logrus.InfoLevel, logrus.GetLevel()))

conf.LogLevel = "warn"
err = configureDaemonLogs(conf)
assert.NilError(t, err)
assert.Check(t, is.Equal(logrus.WarnLevel, logrus.GetLevel()))

conf.LogLevel = "foobar"
err = configureDaemonLogs(conf)
assert.Error(t, err, "unable to parse logging level: foobar")

// log level should not be changed after a failure
assert.Check(t, is.Equal(logrus.WarnLevel, logrus.GetLevel()))
}
7 changes: 7 additions & 0 deletions cmd/dockerd/docker.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ import (
"github.com/docker/docker/cli"
"github.com/docker/docker/daemon/config"
"github.com/docker/docker/dockerversion"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/docker/pkg/reexec"
"github.com/docker/docker/pkg/term"
"github.com/moby/buildkit/util/apicaps"
Expand DownExpand Up@@ -54,6 +55,12 @@ func main() {
return
}

// initial log formatting; this setting is updated after the daemon configuration is loaded.
logrus.SetFormatter(&logrus.TextFormatter{
TimestampFormat: jsonmessage.RFC3339NanoFixed,
FullTimestamp: true,
})

// Set terminal emulation based on platform as required.
_, stdout, stderr := term.StdStreams()

Expand Down
16 changes: 0 additions & 16 deletions cmd/dockerd/options.go
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
package main

import (
"fmt"
"os"
"path/filepath"

cliconfig "github.com/docker/docker/cli/config"
"github.com/docker/docker/daemon/config"
"github.com/docker/docker/opts"
"github.com/docker/go-connections/tlsconfig"
"github.com/sirupsen/logrus"
"github.com/spf13/pflag"
)

Expand DownExpand Up@@ -106,17 +104,3 @@ func (o *daemonOptions) SetDefaultOptions(flags *pflag.FlagSet) {
}
}
}

// setLogLevel sets the logrus logging level
func setLogLevel(logLevel string) {
if logLevel != "" {
lvl, err := logrus.ParseLevel(logLevel)
if err != nil {
fmt.Fprintf(os.Stderr, "Unable to parse logging level: %s\n", logLevel)
os.Exit(1)
}
logrus.SetLevel(lvl)
} else {
logrus.SetLevel(logrus.InfoLevel)
}
}
11 changes: 1 addition & 10 deletions daemon/checkpoint.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,6 @@ package daemon // import "github.com/docker/docker/daemon"

import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"os"
Expand DownExpand Up@@ -127,15 +126,7 @@ func (daemon *Daemon) CheckpointList(name string, config types.CheckpointListOpt
if !d.IsDir() {
continue
}
path := filepath.Join(checkpointDir, d.Name(), "config.json")
data, err := ioutil.ReadFile(path)
if err != nil {
return nil, err
}
var cpt types.Checkpoint
if err := json.Unmarshal(data, &cpt); err != nil {
return nil, err
}
cpt := types.Checkpoint{Name: d.Name()}
out = append(out, cpt)
}

Expand Down
3 changes: 3 additions & 0 deletions daemon/config/config.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -229,6 +229,9 @@ type CommonConfig struct {
Features map[string]bool `json:"features,omitempty"`

Builder BuilderConfig `json:"builder,omitempty"`

ContainerdNamespace string `json:"containerd-namespace,omitempty"`
ContainerdPluginNamespace string `json:"containerd-plugin-namespace,omitempty"`
}

// IsValueSet returns true if a configuration value
Expand Down
2 changes: 1 addition & 1 deletion daemon/container_operations.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -813,7 +813,7 @@ func (daemon *Daemon) connectToNetwork(container *container.Container, idOrName
return nil
}

func updateJoinInfo(networkSettings *network.Settings, n libnetwork.Network, ep libnetwork.Endpoint) error { // nolint: interfacer
func updateJoinInfo(networkSettings *network.Settings, n libnetwork.Network, ep libnetwork.Endpoint) error {
if ep == nil {
return errors.New("invalid enppoint whhile building portmap info")
}
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
6d8fbac
Configure log-format earlier, and small refactor
thaJeztah Nov 24, 2018
1bda75e
migrated container wait integration tests from integration-cli to int…
adshmh Jul 23, 2018
5cde2dd
[18.09] integration/internal: add new test options
AkihiroSuda Oct 10, 2018
7985bd8
integration/container: add a base test for C/R
avagin Dec 29, 2018
4ac5dba
Fix CheckpointList
avagin Dec 29, 2018
9fa7f6c
Temporarily disable TestCheckpoint
thaJeztah Apr 1, 2019
9f02d3b
integration: change network.CreateNoError signature to fix linting
thaJeztah Jun 6, 2019
c82cbe9
integration: change container.Create signature to fix linting
thaJeztah Jun 6, 2019
85c5aab
integration: change container.Run signature to fix linting
thaJeztah Jun 6, 2019
2eb2aaf
integration: change createAmbiguousNetworks signature to fix linting
thaJeztah Jun 6, 2019
e91e9c3
integration: change testGraphDriver signature to fix linting
thaJeztah Jun 6, 2019
4005149
integration: get tests to compile again
Jun 12, 2019
e9bd47a
Revert "integration: have container.Create call compile"
thaJeztah Oct 8, 2019
4aae081
Revert "Fixing integration test"
thaJeztah Oct 8, 2019
a5620fc
TestServiceWithDefaultAddressPoolInit
selansen Sep 13, 2018
93de6ed
Add TC to check dyanmic subnet for ingress network
Sep 20, 2019
8c60be3
integration-cli/build: don't panic
kolyshkin Dec 21, 2018
e42b14a
*: remove interfacer linter from CI
cyphar Mar 12, 2019
5c1aea7
integration-cli: don't build -test images if they already exist
cyphar Mar 12, 2019
6cc5e98
internal: test/env: switch to assert.TestingT
cyphar Mar 12, 2019
266674a
Integration: remove unneeded platform check for IPVLAN tests
thaJeztah Jun 28, 2019
989a8a6
Integration: IPVlan add missing import comment
thaJeztah Jun 28, 2019
4ecaa08
Integration: exclude IPVlan test-suite on Windows
thaJeztah Jul 11, 2019
bd195d0
Integration: remove redundant kernel version check for MACVlan
thaJeztah Jun 28, 2019
e5493c4
Integration: MACVlan add missing import comment and build-tag
thaJeztah Jun 28, 2019
3ca37e6
integration-cli: remove ExecSupport check
thaJeztah Jul 8, 2019
0a071f7
integration-cli: remove defaultSleepImage constant
thaJeztah Jul 8, 2019
9fc8134
integration-cli: remove unused requirements utils
thaJeztah Jul 8, 2019
4fb6f3f
Add containerd.WithTimeout(60*time.Second) to match old calls
Aug 22, 2018
cbd8227
Add (hidden) flags to set containerd namespaces
cpuguy83 Jul 11, 2019
34024ad
integration: fix cleanup of raft data
thaJeztah Jul 12, 2019
0f2b3f6
Optimize test daemon startup
cpuguy83 Apr 17, 2019
0ba4e3e
Add log entries for daemon startup/shutdown
cpuguy83 Apr 19, 2019
b773f3c
Improve select for daemon restart tests
crosbymichael Jul 2, 2019
81966d1
Don't log test initial test daemon ping failures
cpuguy83 Jul 12, 2019
7fb18ca
Fix Microsecond -> Milisecond.
cpuguy83 Jul 13, 2019
943bb6a
DockerSwarmSuite lock portIndex to work around race
thaJeztah Jul 13, 2019
bc63fef
Be more conservative for Windows in TestFrequency for Splunk
ddebroy Jul 17, 2019
743c961
Testing: create new daemon (only) if needed
thaJeztah Dec 24, 2018
72c8a91
integration: run build session tests on non-experimental
thaJeztah Jul 17, 2019
99725d6
integration-cli: increase healthcheck timeout
tonistiigi Jul 18, 2019
5905728
Retry service updates on out of sequence errors
dperny Jul 18, 2019
147c94d
integration-cli: remove redundant "testrequires"
thaJeztah Jul 19, 2019
48bfa1d
Add `FromClient` to test env execution
cpuguy83 Jul 24, 2019
03c4cf7
Better logging for swarm tests
cpuguy83 Jul 24, 2019
e1dc7f1
hack: Remove inContainer check, it wasn't useful
seemethere Jul 24, 2019
0de5218
Fix flaky TestServiceWithDefaultAddressPoolInit
Aug 5, 2019
8c69826
Move defer method to the top right after New is called
Aug 15, 2019
eed1ea0
Windows:Disable 2 restart test when Hyper-V
Feb 22, 2019
033474e
integration-cli/requirements: Skip windows specific isolation require…
Snorch Aug 7, 2019
baae46a
Dockerfile: update CRIU to v3.12
thaJeztah Aug 14, 2019
47c2af9
pkg/term: refactor TestEscapeProxyRead
thaJeztah Aug 27, 2019
81f3399
integration: windows.ps1: turn defender error into a warning
thaJeztah Aug 27, 2019
63c9022
LCOW: Log stderr on failures
Mar 8, 2018
fa1a38d
TestDispatch: refactor to use subtests again, and fix linting (struct…
thaJeztah Aug 27, 2019
27e9144
integration-cli: getContainerCount() fix trimming prefix
thaJeztah Aug 28, 2019
6e6c1ac
Fix docker inspect for dutimgVersion
StefanScherer Aug 30, 2019
b5a2940
integration-cli: fix some bashism's in Dockerfiles
thaJeztah Sep 2, 2019
d01572e
TestBuildSquashParent: fix non-standard comparisson
thaJeztah Sep 2, 2019
0f8e14d
hack/make/binary-daemon: fix some linting issues
thaJeztah Aug 31, 2019
49afe72
TestCase: use `icmd.RunCmd` instead `icmd.StartCmd`
tao12345666333 Sep 2, 2019
bec7a85
hack/ci/windows.ps1: explicitly set exit code to result of tests
thaJeztah Sep 2, 2019
5ed27d1
hack/ci/windows.ps1 print all environment variables to check how Jenk…
thaJeztah Sep 6, 2019
69ee162
integration-cli: update TestCreateWithWorkdir for Hyper-V isolation
thaJeztah Sep 4, 2019
65dc979
hack/ci/windows.ps1: add support for DOCKER_STORAGE_OPTS
thaJeztah Sep 4, 2019
2cf0f0a
hack/ci/windows.ps1: stop tailing logs after stopping the daemon
thaJeztah Sep 6, 2019
ef77905
Fix Service TTY test so signal handlers work
cpuguy83 Sep 9, 2019
9544f87
integration-cli: swarm.RestartNode(); don't load busybox again
thaJeztah Sep 9, 2019
9bc5695
integration-cli: add daemon.StartNodeWithBusybox function
thaJeztah Sep 9, 2019
6e1a428
Windows: skip flaky TestLogBlocking
thaJeztah Sep 9, 2019
d236d18
awslogs: fix flaky TestLogBlocking unit test
samuelkarp Sep 20, 2019
a6d21bd
Fix more signal handling issues in tests.
cpuguy83 Sep 9, 2019
d88eaeb
Disable TestPsListContainersFilterExited (Windows)
Sep 17, 2019
b739525
integration-cli: run goimports
Sep 19, 2019
5766d99
[18.09] change c.Skip() to testRequires()
thaJeztah Oct 8, 2019
c3bc5d2
hack/test/unit: fix custom TESTFLAGS not working
thaJeztah Sep 13, 2019
9826c3e
[18.09] TEMPORARILY DISABLE FLAKY TEST CHECK
thaJeztah Oct 23, 2019
d4a5e65
TESTING: SKIP TestSwarmVolumePlugin
thaJeztah Oct 24, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Dockerfile
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,7 +36,7 @@ RUN sed -ri "s/(httpredir|deb).debian.org/${APT_MIRROR:-deb.debian.org}/g" /etc/
FROM base AS criu
ARG DEBIAN_FRONTEND
# Install CRIU for checkpoint/restore support
ENV CRIU_VERSION 3.6
ENV CRIU_VERSION 3.12
# Install dependency packages specific to criu
RUN apt-get update && apt-get install -y --no-install-recommends \
libnet-dev \
Expand DownExpand Up@@ -251,6 +251,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
zip \
bzip2 \
xz-utils \
libprotobuf-c1 \
libnet1 \
libnl-3-200 \
&& rm -rf /var/lib/apt/lists/*

RUN pip3 install yamllint==1.16.0
Expand Down
80 changes: 38 additions & 42 deletions builder/dockerfile/evaluator_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,7 @@ package dockerfile // import "github.com/docker/docker/builder/dockerfile"

import (
"os"
"runtime"
"testing"

"github.com/docker/docker/builder/remotecontext"
Expand All@@ -23,8 +24,11 @@ func init() {
reexec.Init()
}

func initDispatchTestCases() []dispatchTestCase {
dispatchTestCases := []dispatchTestCase{
func TestDispatch(t *testing.T) {
if runtime.GOOS != "windows" {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
}
testCases := []dispatchTestCase{
{
name: "ADD multiple files to file",
cmd: &instructions.AddCommand{SourcesAndDest: instructions.SourcesAndDest{
Expand DownExpand Up@@ -91,54 +95,46 @@ func initDispatchTestCases() []dispatchTestCase {
}},
expectedError: "source can't be a URL for COPY",
files: nil,
}}

return dispatchTestCases
}

func TestDispatch(t *testing.T) {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
testCases := initDispatchTestCases()

for _, testCase := range testCases {
executeTestCase(t, testCase)
},
}
}

func executeTestCase(t *testing.T, testCase dispatchTestCase) {
contextDir, cleanup := createTestTempDir(t, "", "builder-dockerfile-test")
defer cleanup()
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
contextDir, cleanup := createTestTempDir(t, "", "builder-dockerfile-test")
defer cleanup()

for filename, content := range testCase.files {
createTestTempFile(t, contextDir, filename, content, 0777)
}
for filename, content := range tc.files {
createTestTempFile(t, contextDir, filename, content, 0777)
}

tarStream, err := archive.Tar(contextDir, archive.Uncompressed)
tarStream, err := archive.Tar(contextDir, archive.Uncompressed)

if err != nil {
t.Fatalf("Error when creating tar stream: %s", err)
}
if err != nil {
t.Fatalf("Error when creating tar stream: %s", err)
}

defer func() {
if err = tarStream.Close(); err != nil {
t.Fatalf("Error when closing tar stream: %s", err)
}
}()
defer func() {
if err = tarStream.Close(); err != nil {
t.Fatalf("Error when closing tar stream: %s", err)
}
}()

context, err := remotecontext.FromArchive(tarStream)
context, err := remotecontext.FromArchive(tarStream)

if err != nil {
t.Fatalf("Error when creating tar context: %s", err)
}
if err != nil {
t.Fatalf("Error when creating tar context: %s", err)
}

defer func() {
if err = context.Close(); err != nil {
t.Fatalf("Error when closing tar context: %s", err)
}
}()
defer func() {
if err = context.Close(); err != nil {
t.Fatalf("Error when closing tar context: %s", err)
}
}()

b := newBuilderWithMockBackend()
sb := newDispatchRequest(b, '`', context, NewBuildArgs(make(map[string]*string)), newStagesBuildResults())
err = dispatch(sb, testCase.cmd)
assert.Check(t, is.ErrorContains(err, testCase.expectedError))
b := newBuilderWithMockBackend()
sb := newDispatchRequest(b, '`', context, NewBuildArgs(make(map[string]*string)), newStagesBuildResults())
err = dispatch(sb, tc.cmd)
assert.Check(t, is.ErrorContains(err, tc.expectedError))
})
}
}
9 changes: 7 additions & 2 deletions builder/dockerfile/internals_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -47,6 +47,9 @@ func TestDockerfileOutsideTheBuildContext(t *testing.T) {
defer cleanup()

expectedError := "Forbidden path outside the build context: ../../Dockerfile ()"
if runtime.GOOS == "windows" {
expectedError = "failed to resolve scoped path ../../Dockerfile ()"
}

readAndCheckDockerfile(t, "DockerfileOutsideTheBuildContext", contextDir, "../../Dockerfile", expectedError)
}
Expand All@@ -61,7 +64,9 @@ func TestNonExistingDockerfile(t *testing.T) {
}

func readAndCheckDockerfile(t *testing.T, testName, contextDir, dockerfilePath, expectedError string) {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
if runtime.GOOS != "windows" {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
}
tarStream, err := archive.Tar(contextDir, archive.Uncompressed)
assert.NilError(t, err)

Expand All@@ -80,7 +85,7 @@ func readAndCheckDockerfile(t *testing.T, testName, contextDir, dockerfilePath,
Source: tarStream,
}
_, _, err = remotecontext.Detect(config)
assert.Check(t, is.Error(err, expectedError))
assert.Check(t, is.ErrorContains(err, expectedError))
}

func TestCopyRunConfig(t *testing.T) {
Expand Down
9 changes: 9 additions & 0 deletions cmd/dockerd/config.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,8 +3,10 @@ package main
import (
"runtime"

"github.com/docker/docker/daemon"
"github.com/docker/docker/daemon/config"
"github.com/docker/docker/opts"
"github.com/docker/docker/plugin/executor/containerd"
"github.com/docker/docker/registry"
"github.com/spf13/pflag"
)
Expand DownExpand Up@@ -80,6 +82,13 @@ func installCommonConfigFlags(conf *config.Config, flags *pflag.FlagSet) {

conf.MaxConcurrentDownloads = &maxConcurrentDownloads
conf.MaxConcurrentUploads = &maxConcurrentUploads

flags.StringVar(&conf.ContainerdNamespace, "containerd-namespace", daemon.ContainersNamespace, "Containerd namespace to use")
if err := flags.MarkHidden("containerd-namespace"); err != nil {
return
}
flags.StringVar(&conf.ContainerdPluginNamespace, "containerd-plugins-namespace", containerd.PluginNamespace, "Containerd namespace to use for plugins")
flags.MarkHidden("containerd-plugins-namespace")
}

func installRegistryServiceFlags(options *registry.ServiceOptions, flags *pflag.FlagSet) {
Expand Down
36 changes: 27 additions & 9 deletions cmd/dockerd/daemon.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -83,6 +83,13 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
if cli.Config, err = loadDaemonCliConfig(opts); err != nil {
return err
}

if err := configureDaemonLogs(cli.Config); err != nil {
return err
}

logrus.Info("Starting up")

cli.configFile = &opts.configFile
cli.flags = opts.flags

Expand All@@ -94,12 +101,6 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
logrus.Warn("Running experimental build")
}

logrus.SetFormatter(&logrus.TextFormatter{
TimestampFormat: jsonmessage.RFC3339NanoFixed,
DisableColors: cli.Config.RawLogs,
FullTimestamp: true,
})

system.InitLCOW(cli.Config.Experimental)

if err := setDefaultUmask(); err != nil {
Expand DownExpand Up@@ -249,6 +250,7 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
return fmt.Errorf("Shutting down due to ServeAPI error: %v", errAPI)
}

logrus.Info("Daemon shutdown complete")
return nil
}

Expand DownExpand Up@@ -471,9 +473,6 @@ func loadDaemonCliConfig(opts *daemonOptions) (*config.Config, error) {
conf.TLS = true
}

// ensure that the log level is the one set after merging configurations
setLogLevel(conf.LogLevel)

return conf, nil
}

Expand DownExpand Up@@ -670,3 +669,22 @@ func systemContainerdRunning() bool {
_, err := os.Lstat(containerddefaults.DefaultAddress)
return err == nil
}

// configureDaemonLogs sets the logrus logging level and formatting
func configureDaemonLogs(conf *config.Config) error {
if conf.LogLevel != "" {
lvl, err := logrus.ParseLevel(conf.LogLevel)
if err != nil {
return fmt.Errorf("unable to parse logging level: %s", conf.LogLevel)
}
logrus.SetLevel(lvl)
} else {
logrus.SetLevel(logrus.InfoLevel)
}
logrus.SetFormatter(&logrus.TextFormatter{
TimestampFormat: jsonmessage.RFC3339NanoFixed,
DisableColors: conf.RawLogs,
FullTimestamp: true,
})
return nil
}
20 changes: 19 additions & 1 deletion cmd/dockerd/daemon_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,7 +146,6 @@ func TestLoadDaemonCliConfigWithLogLevel(t *testing.T) {
assert.NilError(t, err)
assert.Assert(t, loadedConfig != nil)
assert.Check(t, is.Equal("warn", loadedConfig.LogLevel))
assert.Check(t, is.Equal(logrus.WarnLevel, logrus.GetLevel()))
}

func TestLoadDaemonConfigWithEmbeddedOptions(t *testing.T) {
Expand DownExpand Up@@ -180,3 +179,22 @@ func TestLoadDaemonConfigWithRegistryOptions(t *testing.T) {
assert.Check(t, is.Len(loadedConfig.Mirrors, 1))
assert.Check(t, is.Len(loadedConfig.InsecureRegistries, 1))
}

func TestConfigureDaemonLogs(t *testing.T) {
conf := &config.Config{}
err := configureDaemonLogs(conf)
assert.NilError(t, err)
assert.Check(t, is.Equal(logrus.InfoLevel, logrus.GetLevel()))

conf.LogLevel = "warn"
err = configureDaemonLogs(conf)
assert.NilError(t, err)
assert.Check(t, is.Equal(logrus.WarnLevel, logrus.GetLevel()))

conf.LogLevel = "foobar"
err = configureDaemonLogs(conf)
assert.Error(t, err, "unable to parse logging level: foobar")

// log level should not be changed after a failure
assert.Check(t, is.Equal(logrus.WarnLevel, logrus.GetLevel()))
}
7 changes: 7 additions & 0 deletions cmd/dockerd/docker.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ import (
"github.com/docker/docker/cli"
"github.com/docker/docker/daemon/config"
"github.com/docker/docker/dockerversion"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/docker/pkg/reexec"
"github.com/docker/docker/pkg/term"
"github.com/moby/buildkit/util/apicaps"
Expand DownExpand Up@@ -54,6 +55,12 @@ func main() {
return
}

// initial log formatting; this setting is updated after the daemon configuration is loaded.
logrus.SetFormatter(&logrus.TextFormatter{
TimestampFormat: jsonmessage.RFC3339NanoFixed,
FullTimestamp: true,
})

// Set terminal emulation based on platform as required.
_, stdout, stderr := term.StdStreams()

Expand Down
16 changes: 0 additions & 16 deletions cmd/dockerd/options.go
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
package main

import (
"fmt"
"os"
"path/filepath"

cliconfig "github.com/docker/docker/cli/config"
"github.com/docker/docker/daemon/config"
"github.com/docker/docker/opts"
"github.com/docker/go-connections/tlsconfig"
"github.com/sirupsen/logrus"
"github.com/spf13/pflag"
)

Expand DownExpand Up@@ -106,17 +104,3 @@ func (o *daemonOptions) SetDefaultOptions(flags *pflag.FlagSet) {
}
}
}

// setLogLevel sets the logrus logging level
func setLogLevel(logLevel string) {
if logLevel != "" {
lvl, err := logrus.ParseLevel(logLevel)
if err != nil {
fmt.Fprintf(os.Stderr, "Unable to parse logging level: %s\n", logLevel)
os.Exit(1)
}
logrus.SetLevel(lvl)
} else {
logrus.SetLevel(logrus.InfoLevel)
}
}
11 changes: 1 addition & 10 deletions daemon/checkpoint.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,6 @@ package daemon // import "github.com/docker/docker/daemon"

import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"os"
Expand DownExpand Up@@ -127,15 +126,7 @@ func (daemon *Daemon) CheckpointList(name string, config types.CheckpointListOpt
if !d.IsDir() {
continue
}
path := filepath.Join(checkpointDir, d.Name(), "config.json")
data, err := ioutil.ReadFile(path)
if err != nil {
return nil, err
}
var cpt types.Checkpoint
if err := json.Unmarshal(data, &cpt); err != nil {
return nil, err
}
cpt := types.Checkpoint{Name: d.Name()}
out = append(out, cpt)
}

Expand Down
3 changes: 3 additions & 0 deletions daemon/config/config.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -229,6 +229,9 @@ type CommonConfig struct {
Features map[string]bool `json:"features,omitempty"`

Builder BuilderConfig `json:"builder,omitempty"`

ContainerdNamespace string `json:"containerd-namespace,omitempty"`
ContainerdPluginNamespace string `json:"containerd-plugin-namespace,omitempty"`
}

// IsValueSet returns true if a configuration value
Expand Down
2 changes: 1 addition & 1 deletion daemon/container_operations.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -813,7 +813,7 @@ func (daemon *Daemon) connectToNetwork(container *container.Container, idOrName
return nil
}

func updateJoinInfo(networkSettings *network.Settings, n libnetwork.Network, ep libnetwork.Endpoint) error { // nolint: interfacer
func updateJoinInfo(networkSettings *network.Settings, n libnetwork.Network, ep libnetwork.Endpoint) error {
if ep == nil {
return errors.New("invalid enppoint whhile building portmap info")
}
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
6d8fbac
Configure log-format earlier, and small refactor
thaJeztah Nov 24, 2018
1bda75e
migrated container wait integration tests from integration-cli to int…
adshmh Jul 23, 2018
5cde2dd
[18.09] integration/internal: add new test options
AkihiroSuda Oct 10, 2018
7985bd8
integration/container: add a base test for C/R
avagin Dec 29, 2018
4ac5dba
Fix CheckpointList
avagin Dec 29, 2018
9fa7f6c
Temporarily disable TestCheckpoint
thaJeztah Apr 1, 2019
9f02d3b
integration: change network.CreateNoError signature to fix linting
thaJeztah Jun 6, 2019
c82cbe9
integration: change container.Create signature to fix linting
thaJeztah Jun 6, 2019
85c5aab
integration: change container.Run signature to fix linting
thaJeztah Jun 6, 2019
2eb2aaf
integration: change createAmbiguousNetworks signature to fix linting
thaJeztah Jun 6, 2019
e91e9c3
integration: change testGraphDriver signature to fix linting
thaJeztah Jun 6, 2019
4005149
integration: get tests to compile again
Jun 12, 2019
e9bd47a
Revert "integration: have container.Create call compile"
thaJeztah Oct 8, 2019
4aae081
Revert "Fixing integration test"
thaJeztah Oct 8, 2019
a5620fc
TestServiceWithDefaultAddressPoolInit
selansen Sep 13, 2018
93de6ed
Add TC to check dyanmic subnet for ingress network
Sep 20, 2019
8c60be3
integration-cli/build: don't panic
kolyshkin Dec 21, 2018
e42b14a
*: remove interfacer linter from CI
cyphar Mar 12, 2019
5c1aea7
integration-cli: don't build -test images if they already exist
cyphar Mar 12, 2019
6cc5e98
internal: test/env: switch to assert.TestingT
cyphar Mar 12, 2019
266674a
Integration: remove unneeded platform check for IPVLAN tests
thaJeztah Jun 28, 2019
989a8a6
Integration: IPVlan add missing import comment
thaJeztah Jun 28, 2019
4ecaa08
Integration: exclude IPVlan test-suite on Windows
thaJeztah Jul 11, 2019
bd195d0
Integration: remove redundant kernel version check for MACVlan
thaJeztah Jun 28, 2019
e5493c4
Integration: MACVlan add missing import comment and build-tag
thaJeztah Jun 28, 2019
3ca37e6
integration-cli: remove ExecSupport check
thaJeztah Jul 8, 2019
0a071f7
integration-cli: remove defaultSleepImage constant
thaJeztah Jul 8, 2019
9fc8134
integration-cli: remove unused requirements utils
thaJeztah Jul 8, 2019
4fb6f3f
Add containerd.WithTimeout(60*time.Second) to match old calls
Aug 22, 2018
cbd8227
Add (hidden) flags to set containerd namespaces
cpuguy83 Jul 11, 2019
34024ad
integration: fix cleanup of raft data
thaJeztah Jul 12, 2019
0f2b3f6
Optimize test daemon startup
cpuguy83 Apr 17, 2019
0ba4e3e
Add log entries for daemon startup/shutdown
cpuguy83 Apr 19, 2019
b773f3c
Improve select for daemon restart tests
crosbymichael Jul 2, 2019
81966d1
Don't log test initial test daemon ping failures
cpuguy83 Jul 12, 2019
7fb18ca
Fix Microsecond -> Milisecond.
cpuguy83 Jul 13, 2019
943bb6a
DockerSwarmSuite lock portIndex to work around race
thaJeztah Jul 13, 2019
bc63fef
Be more conservative for Windows in TestFrequency for Splunk
ddebroy Jul 17, 2019
743c961
Testing: create new daemon (only) if needed
thaJeztah Dec 24, 2018
72c8a91
integration: run build session tests on non-experimental
thaJeztah Jul 17, 2019
99725d6
integration-cli: increase healthcheck timeout
tonistiigi Jul 18, 2019
5905728
Retry service updates on out of sequence errors
dperny Jul 18, 2019
147c94d
integration-cli: remove redundant "testrequires"
thaJeztah Jul 19, 2019
48bfa1d
Add `FromClient` to test env execution
cpuguy83 Jul 24, 2019
03c4cf7
Better logging for swarm tests
cpuguy83 Jul 24, 2019
e1dc7f1
hack: Remove inContainer check, it wasn't useful
seemethere Jul 24, 2019
0de5218
Fix flaky TestServiceWithDefaultAddressPoolInit
Aug 5, 2019
8c69826
Move defer method to the top right after New is called
Aug 15, 2019
eed1ea0
Windows:Disable 2 restart test when Hyper-V
Feb 22, 2019
033474e
integration-cli/requirements: Skip windows specific isolation require…
Snorch Aug 7, 2019
baae46a
Dockerfile: update CRIU to v3.12
thaJeztah Aug 14, 2019
47c2af9
pkg/term: refactor TestEscapeProxyRead
thaJeztah Aug 27, 2019
81f3399
integration: windows.ps1: turn defender error into a warning
thaJeztah Aug 27, 2019
63c9022
LCOW: Log stderr on failures
Mar 8, 2018
fa1a38d
TestDispatch: refactor to use subtests again, and fix linting (struct…
thaJeztah Aug 27, 2019
27e9144
integration-cli: getContainerCount() fix trimming prefix
thaJeztah Aug 28, 2019
6e6c1ac
Fix docker inspect for dutimgVersion
StefanScherer Aug 30, 2019
b5a2940
integration-cli: fix some bashism's in Dockerfiles
thaJeztah Sep 2, 2019
d01572e
TestBuildSquashParent: fix non-standard comparisson
thaJeztah Sep 2, 2019
0f8e14d
hack/make/binary-daemon: fix some linting issues
thaJeztah Aug 31, 2019
49afe72
TestCase: use `icmd.RunCmd` instead `icmd.StartCmd`
tao12345666333 Sep 2, 2019
bec7a85
hack/ci/windows.ps1: explicitly set exit code to result of tests
thaJeztah Sep 2, 2019
5ed27d1
hack/ci/windows.ps1 print all environment variables to check how Jenk…
thaJeztah Sep 6, 2019
69ee162
integration-cli: update TestCreateWithWorkdir for Hyper-V isolation
thaJeztah Sep 4, 2019
65dc979
hack/ci/windows.ps1: add support for DOCKER_STORAGE_OPTS
thaJeztah Sep 4, 2019
2cf0f0a
hack/ci/windows.ps1: stop tailing logs after stopping the daemon
thaJeztah Sep 6, 2019
ef77905
Fix Service TTY test so signal handlers work
cpuguy83 Sep 9, 2019
9544f87
integration-cli: swarm.RestartNode(); don't load busybox again
thaJeztah Sep 9, 2019
9bc5695
integration-cli: add daemon.StartNodeWithBusybox function
thaJeztah Sep 9, 2019
6e1a428
Windows: skip flaky TestLogBlocking
thaJeztah Sep 9, 2019
d236d18
awslogs: fix flaky TestLogBlocking unit test
samuelkarp Sep 20, 2019
a6d21bd
Fix more signal handling issues in tests.
cpuguy83 Sep 9, 2019
d88eaeb
Disable TestPsListContainersFilterExited (Windows)
Sep 17, 2019
b739525
integration-cli: run goimports
Sep 19, 2019
5766d99
[18.09] change c.Skip() to testRequires()
thaJeztah Oct 8, 2019
c3bc5d2
hack/test/unit: fix custom TESTFLAGS not working
thaJeztah Sep 13, 2019
9826c3e
[18.09] TEMPORARILY DISABLE FLAKY TEST CHECK
thaJeztah Oct 23, 2019
d4a5e65
TESTING: SKIP TestSwarmVolumePlugin
thaJeztah Oct 24, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Dockerfile
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,7 +36,7 @@ RUN sed -ri "s/(httpredir|deb).debian.org/${APT_MIRROR:-deb.debian.org}/g" /etc/
FROM base AS criu
ARG DEBIAN_FRONTEND
# Install CRIU for checkpoint/restore support
ENV CRIU_VERSION 3.6
ENV CRIU_VERSION 3.12
# Install dependency packages specific to criu
RUN apt-get update && apt-get install -y --no-install-recommends \
libnet-dev \
Expand DownExpand Up@@ -251,6 +251,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
zip \
bzip2 \
xz-utils \
libprotobuf-c1 \
libnet1 \
libnl-3-200 \
&& rm -rf /var/lib/apt/lists/*

RUN pip3 install yamllint==1.16.0
Expand Down
80 changes: 38 additions & 42 deletions builder/dockerfile/evaluator_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,7 @@ package dockerfile // import "github.com/docker/docker/builder/dockerfile"

import (
"os"
"runtime"
"testing"

"github.com/docker/docker/builder/remotecontext"
Expand All@@ -23,8 +24,11 @@ func init() {
reexec.Init()
}

func initDispatchTestCases() []dispatchTestCase {
dispatchTestCases := []dispatchTestCase{
func TestDispatch(t *testing.T) {
if runtime.GOOS != "windows" {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
}
testCases := []dispatchTestCase{
{
name: "ADD multiple files to file",
cmd: &instructions.AddCommand{SourcesAndDest: instructions.SourcesAndDest{
Expand DownExpand Up@@ -91,54 +95,46 @@ func initDispatchTestCases() []dispatchTestCase {
}},
expectedError: "source can't be a URL for COPY",
files: nil,
}}

return dispatchTestCases
}

func TestDispatch(t *testing.T) {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
testCases := initDispatchTestCases()

for _, testCase := range testCases {
executeTestCase(t, testCase)
},
}
}

func executeTestCase(t *testing.T, testCase dispatchTestCase) {
contextDir, cleanup := createTestTempDir(t, "", "builder-dockerfile-test")
defer cleanup()
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
contextDir, cleanup := createTestTempDir(t, "", "builder-dockerfile-test")
defer cleanup()

for filename, content := range testCase.files {
createTestTempFile(t, contextDir, filename, content, 0777)
}
for filename, content := range tc.files {
createTestTempFile(t, contextDir, filename, content, 0777)
}

tarStream, err := archive.Tar(contextDir, archive.Uncompressed)
tarStream, err := archive.Tar(contextDir, archive.Uncompressed)

if err != nil {
t.Fatalf("Error when creating tar stream: %s", err)
}
if err != nil {
t.Fatalf("Error when creating tar stream: %s", err)
}

defer func() {
if err = tarStream.Close(); err != nil {
t.Fatalf("Error when closing tar stream: %s", err)
}
}()
defer func() {
if err = tarStream.Close(); err != nil {
t.Fatalf("Error when closing tar stream: %s", err)
}
}()

context, err := remotecontext.FromArchive(tarStream)
context, err := remotecontext.FromArchive(tarStream)

if err != nil {
t.Fatalf("Error when creating tar context: %s", err)
}
if err != nil {
t.Fatalf("Error when creating tar context: %s", err)
}

defer func() {
if err = context.Close(); err != nil {
t.Fatalf("Error when closing tar context: %s", err)
}
}()
defer func() {
if err = context.Close(); err != nil {
t.Fatalf("Error when closing tar context: %s", err)
}
}()

b := newBuilderWithMockBackend()
sb := newDispatchRequest(b, '`', context, NewBuildArgs(make(map[string]*string)), newStagesBuildResults())
err = dispatch(sb, testCase.cmd)
assert.Check(t, is.ErrorContains(err, testCase.expectedError))
b := newBuilderWithMockBackend()
sb := newDispatchRequest(b, '`', context, NewBuildArgs(make(map[string]*string)), newStagesBuildResults())
err = dispatch(sb, tc.cmd)
assert.Check(t, is.ErrorContains(err, tc.expectedError))
})
}
}
9 changes: 7 additions & 2 deletions builder/dockerfile/internals_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -47,6 +47,9 @@ func TestDockerfileOutsideTheBuildContext(t *testing.T) {
defer cleanup()

expectedError := "Forbidden path outside the build context: ../../Dockerfile ()"
if runtime.GOOS == "windows" {
expectedError = "failed to resolve scoped path ../../Dockerfile ()"
}

readAndCheckDockerfile(t, "DockerfileOutsideTheBuildContext", contextDir, "../../Dockerfile", expectedError)
}
Expand All@@ -61,7 +64,9 @@ func TestNonExistingDockerfile(t *testing.T) {
}

func readAndCheckDockerfile(t *testing.T, testName, contextDir, dockerfilePath, expectedError string) {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
if runtime.GOOS != "windows" {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
}
tarStream, err := archive.Tar(contextDir, archive.Uncompressed)
assert.NilError(t, err)

Expand All@@ -80,7 +85,7 @@ func readAndCheckDockerfile(t *testing.T, testName, contextDir, dockerfilePath,
Source: tarStream,
}
_, _, err = remotecontext.Detect(config)
assert.Check(t, is.Error(err, expectedError))
assert.Check(t, is.ErrorContains(err, expectedError))
}

func TestCopyRunConfig(t *testing.T) {
Expand Down
9 changes: 9 additions & 0 deletions cmd/dockerd/config.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,8 +3,10 @@ package main
import (
"runtime"

"github.com/docker/docker/daemon"
"github.com/docker/docker/daemon/config"
"github.com/docker/docker/opts"
"github.com/docker/docker/plugin/executor/containerd"
"github.com/docker/docker/registry"
"github.com/spf13/pflag"
)
Expand DownExpand Up@@ -80,6 +82,13 @@ func installCommonConfigFlags(conf *config.Config, flags *pflag.FlagSet) {

conf.MaxConcurrentDownloads = &maxConcurrentDownloads
conf.MaxConcurrentUploads = &maxConcurrentUploads

flags.StringVar(&conf.ContainerdNamespace, "containerd-namespace", daemon.ContainersNamespace, "Containerd namespace to use")
if err := flags.MarkHidden("containerd-namespace"); err != nil {
return
}
flags.StringVar(&conf.ContainerdPluginNamespace, "containerd-plugins-namespace", containerd.PluginNamespace, "Containerd namespace to use for plugins")
flags.MarkHidden("containerd-plugins-namespace")
}

func installRegistryServiceFlags(options *registry.ServiceOptions, flags *pflag.FlagSet) {
Expand Down
36 changes: 27 additions & 9 deletions cmd/dockerd/daemon.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -83,6 +83,13 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
if cli.Config, err = loadDaemonCliConfig(opts); err != nil {
return err
}

if err := configureDaemonLogs(cli.Config); err != nil {
return err
}

logrus.Info("Starting up")

cli.configFile = &opts.configFile
cli.flags = opts.flags

Expand All@@ -94,12 +101,6 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
logrus.Warn("Running experimental build")
}

logrus.SetFormatter(&logrus.TextFormatter{
TimestampFormat: jsonmessage.RFC3339NanoFixed,
DisableColors: cli.Config.RawLogs,
FullTimestamp: true,
})

system.InitLCOW(cli.Config.Experimental)

if err := setDefaultUmask(); err != nil {
Expand DownExpand Up@@ -249,6 +250,7 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
return fmt.Errorf("Shutting down due to ServeAPI error: %v", errAPI)
}

logrus.Info("Daemon shutdown complete")
return nil
}

Expand DownExpand Up@@ -471,9 +473,6 @@ func loadDaemonCliConfig(opts *daemonOptions) (*config.Config, error) {
conf.TLS = true
}

// ensure that the log level is the one set after merging configurations
setLogLevel(conf.LogLevel)

return conf, nil
}

Expand DownExpand Up@@ -670,3 +669,22 @@ func systemContainerdRunning() bool {
_, err := os.Lstat(containerddefaults.DefaultAddress)
return err == nil
}

// configureDaemonLogs sets the logrus logging level and formatting
func configureDaemonLogs(conf *config.Config) error {
if conf.LogLevel != "" {
lvl, err := logrus.ParseLevel(conf.LogLevel)
if err != nil {
return fmt.Errorf("unable to parse logging level: %s", conf.LogLevel)
}
logrus.SetLevel(lvl)
} else {
logrus.SetLevel(logrus.InfoLevel)
}
logrus.SetFormatter(&logrus.TextFormatter{
TimestampFormat: jsonmessage.RFC3339NanoFixed,
DisableColors: conf.RawLogs,
FullTimestamp: true,
})
return nil
}
20 changes: 19 additions & 1 deletion cmd/dockerd/daemon_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,7 +146,6 @@ func TestLoadDaemonCliConfigWithLogLevel(t *testing.T) {
assert.NilError(t, err)
assert.Assert(t, loadedConfig != nil)
assert.Check(t, is.Equal("warn", loadedConfig.LogLevel))
assert.Check(t, is.Equal(logrus.WarnLevel, logrus.GetLevel()))
}

func TestLoadDaemonConfigWithEmbeddedOptions(t *testing.T) {
Expand DownExpand Up@@ -180,3 +179,22 @@ func TestLoadDaemonConfigWithRegistryOptions(t *testing.T) {
assert.Check(t, is.Len(loadedConfig.Mirrors, 1))
assert.Check(t, is.Len(loadedConfig.InsecureRegistries, 1))
}

func TestConfigureDaemonLogs(t *testing.T) {
conf := &config.Config{}
err := configureDaemonLogs(conf)
assert.NilError(t, err)
assert.Check(t, is.Equal(logrus.InfoLevel, logrus.GetLevel()))

conf.LogLevel = "warn"
err = configureDaemonLogs(conf)
assert.NilError(t, err)
assert.Check(t, is.Equal(logrus.WarnLevel, logrus.GetLevel()))

conf.LogLevel = "foobar"
err = configureDaemonLogs(conf)
assert.Error(t, err, "unable to parse logging level: foobar")

// log level should not be changed after a failure
assert.Check(t, is.Equal(logrus.WarnLevel, logrus.GetLevel()))
}
7 changes: 7 additions & 0 deletions cmd/dockerd/docker.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ import (
"github.com/docker/docker/cli"
"github.com/docker/docker/daemon/config"
"github.com/docker/docker/dockerversion"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/docker/pkg/reexec"
"github.com/docker/docker/pkg/term"
"github.com/moby/buildkit/util/apicaps"
Expand DownExpand Up@@ -54,6 +55,12 @@ func main() {
return
}

// initial log formatting; this setting is updated after the daemon configuration is loaded.
logrus.SetFormatter(&logrus.TextFormatter{
TimestampFormat: jsonmessage.RFC3339NanoFixed,
FullTimestamp: true,
})

// Set terminal emulation based on platform as required.
_, stdout, stderr := term.StdStreams()

Expand Down
16 changes: 0 additions & 16 deletions cmd/dockerd/options.go
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
package main

import (
"fmt"
"os"
"path/filepath"

cliconfig "github.com/docker/docker/cli/config"
"github.com/docker/docker/daemon/config"
"github.com/docker/docker/opts"
"github.com/docker/go-connections/tlsconfig"
"github.com/sirupsen/logrus"
"github.com/spf13/pflag"
)

Expand DownExpand Up@@ -106,17 +104,3 @@ func (o *daemonOptions) SetDefaultOptions(flags *pflag.FlagSet) {
}
}
}

// setLogLevel sets the logrus logging level
func setLogLevel(logLevel string) {
if logLevel != "" {
lvl, err := logrus.ParseLevel(logLevel)
if err != nil {
fmt.Fprintf(os.Stderr, "Unable to parse logging level: %s\n", logLevel)
os.Exit(1)
}
logrus.SetLevel(lvl)
} else {
logrus.SetLevel(logrus.InfoLevel)
}
}
11 changes: 1 addition & 10 deletions daemon/checkpoint.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,6 @@ package daemon // import "github.com/docker/docker/daemon"

import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"os"
Expand DownExpand Up@@ -127,15 +126,7 @@ func (daemon *Daemon) CheckpointList(name string, config types.CheckpointListOpt
if !d.IsDir() {
continue
}
path := filepath.Join(checkpointDir, d.Name(), "config.json")
data, err := ioutil.ReadFile(path)
if err != nil {
return nil, err
}
var cpt types.Checkpoint
if err := json.Unmarshal(data, &cpt); err != nil {
return nil, err
}
cpt := types.Checkpoint{Name: d.Name()}
out = append(out, cpt)
}

Expand Down
3 changes: 3 additions & 0 deletions daemon/config/config.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -229,6 +229,9 @@ type CommonConfig struct {
Features map[string]bool `json:"features,omitempty"`

Builder BuilderConfig `json:"builder,omitempty"`

ContainerdNamespace string `json:"containerd-namespace,omitempty"`
ContainerdPluginNamespace string `json:"containerd-plugin-namespace,omitempty"`
}

// IsValueSet returns true if a configuration value
Expand Down
2 changes: 1 addition & 1 deletion daemon/container_operations.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -813,7 +813,7 @@ func (daemon *Daemon) connectToNetwork(container *container.Container, idOrName
return nil
}

func updateJoinInfo(networkSettings *network.Settings, n libnetwork.Network, ep libnetwork.Endpoint) error { // nolint: interfacer
func updateJoinInfo(networkSettings *network.Settings, n libnetwork.Network, ep libnetwork.Endpoint) error {
if ep == nil {
return errors.New("invalid enppoint whhile building portmap info")
}
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
6d8fbac
Configure log-format earlier, and small refactor
thaJeztah Nov 24, 2018
1bda75e
migrated container wait integration tests from integration-cli to int…
adshmh Jul 23, 2018
5cde2dd
[18.09] integration/internal: add new test options
AkihiroSuda Oct 10, 2018
7985bd8
integration/container: add a base test for C/R
avagin Dec 29, 2018
4ac5dba
Fix CheckpointList
avagin Dec 29, 2018
9fa7f6c
Temporarily disable TestCheckpoint
thaJeztah Apr 1, 2019
9f02d3b
integration: change network.CreateNoError signature to fix linting
thaJeztah Jun 6, 2019
c82cbe9
integration: change container.Create signature to fix linting
thaJeztah Jun 6, 2019
85c5aab
integration: change container.Run signature to fix linting
thaJeztah Jun 6, 2019
2eb2aaf
integration: change createAmbiguousNetworks signature to fix linting
thaJeztah Jun 6, 2019
e91e9c3
integration: change testGraphDriver signature to fix linting
thaJeztah Jun 6, 2019
4005149
integration: get tests to compile again
Jun 12, 2019
e9bd47a
Revert "integration: have container.Create call compile"
thaJeztah Oct 8, 2019
4aae081
Revert "Fixing integration test"
thaJeztah Oct 8, 2019
a5620fc
TestServiceWithDefaultAddressPoolInit
selansen Sep 13, 2018
93de6ed
Add TC to check dyanmic subnet for ingress network
Sep 20, 2019
8c60be3
integration-cli/build: don't panic
kolyshkin Dec 21, 2018
e42b14a
*: remove interfacer linter from CI
cyphar Mar 12, 2019
5c1aea7
integration-cli: don't build -test images if they already exist
cyphar Mar 12, 2019
6cc5e98
internal: test/env: switch to assert.TestingT
cyphar Mar 12, 2019
266674a
Integration: remove unneeded platform check for IPVLAN tests
thaJeztah Jun 28, 2019
989a8a6
Integration: IPVlan add missing import comment
thaJeztah Jun 28, 2019
4ecaa08
Integration: exclude IPVlan test-suite on Windows
thaJeztah Jul 11, 2019
bd195d0
Integration: remove redundant kernel version check for MACVlan
thaJeztah Jun 28, 2019
e5493c4
Integration: MACVlan add missing import comment and build-tag
thaJeztah Jun 28, 2019
3ca37e6
integration-cli: remove ExecSupport check
thaJeztah Jul 8, 2019
0a071f7
integration-cli: remove defaultSleepImage constant
thaJeztah Jul 8, 2019
9fc8134
integration-cli: remove unused requirements utils
thaJeztah Jul 8, 2019
4fb6f3f
Add containerd.WithTimeout(60*time.Second) to match old calls
Aug 22, 2018
cbd8227
Add (hidden) flags to set containerd namespaces
cpuguy83 Jul 11, 2019
34024ad
integration: fix cleanup of raft data
thaJeztah Jul 12, 2019
0f2b3f6
Optimize test daemon startup
cpuguy83 Apr 17, 2019
0ba4e3e
Add log entries for daemon startup/shutdown
cpuguy83 Apr 19, 2019
b773f3c
Improve select for daemon restart tests
crosbymichael Jul 2, 2019
81966d1
Don't log test initial test daemon ping failures
cpuguy83 Jul 12, 2019
7fb18ca
Fix Microsecond -> Milisecond.
cpuguy83 Jul 13, 2019
943bb6a
DockerSwarmSuite lock portIndex to work around race
thaJeztah Jul 13, 2019
bc63fef
Be more conservative for Windows in TestFrequency for Splunk
ddebroy Jul 17, 2019
743c961
Testing: create new daemon (only) if needed
thaJeztah Dec 24, 2018
72c8a91
integration: run build session tests on non-experimental
thaJeztah Jul 17, 2019
99725d6
integration-cli: increase healthcheck timeout
tonistiigi Jul 18, 2019
5905728
Retry service updates on out of sequence errors
dperny Jul 18, 2019
147c94d
integration-cli: remove redundant "testrequires"
thaJeztah Jul 19, 2019
48bfa1d
Add `FromClient` to test env execution
cpuguy83 Jul 24, 2019
03c4cf7
Better logging for swarm tests
cpuguy83 Jul 24, 2019
e1dc7f1
hack: Remove inContainer check, it wasn't useful
seemethere Jul 24, 2019
0de5218
Fix flaky TestServiceWithDefaultAddressPoolInit
Aug 5, 2019
8c69826
Move defer method to the top right after New is called
Aug 15, 2019
eed1ea0
Windows:Disable 2 restart test when Hyper-V
Feb 22, 2019
033474e
integration-cli/requirements: Skip windows specific isolation require…
Snorch Aug 7, 2019
baae46a
Dockerfile: update CRIU to v3.12
thaJeztah Aug 14, 2019
47c2af9
pkg/term: refactor TestEscapeProxyRead
thaJeztah Aug 27, 2019
81f3399
integration: windows.ps1: turn defender error into a warning
thaJeztah Aug 27, 2019
63c9022
LCOW: Log stderr on failures
Mar 8, 2018
fa1a38d
TestDispatch: refactor to use subtests again, and fix linting (struct…
thaJeztah Aug 27, 2019
27e9144
integration-cli: getContainerCount() fix trimming prefix
thaJeztah Aug 28, 2019
6e6c1ac
Fix docker inspect for dutimgVersion
StefanScherer Aug 30, 2019
b5a2940
integration-cli: fix some bashism's in Dockerfiles
thaJeztah Sep 2, 2019
d01572e
TestBuildSquashParent: fix non-standard comparisson
thaJeztah Sep 2, 2019
0f8e14d
hack/make/binary-daemon: fix some linting issues
thaJeztah Aug 31, 2019
49afe72
TestCase: use `icmd.RunCmd` instead `icmd.StartCmd`
tao12345666333 Sep 2, 2019
bec7a85
hack/ci/windows.ps1: explicitly set exit code to result of tests
thaJeztah Sep 2, 2019
5ed27d1
hack/ci/windows.ps1 print all environment variables to check how Jenk…
thaJeztah Sep 6, 2019
69ee162
integration-cli: update TestCreateWithWorkdir for Hyper-V isolation
thaJeztah Sep 4, 2019
65dc979
hack/ci/windows.ps1: add support for DOCKER_STORAGE_OPTS
thaJeztah Sep 4, 2019
2cf0f0a
hack/ci/windows.ps1: stop tailing logs after stopping the daemon
thaJeztah Sep 6, 2019
ef77905
Fix Service TTY test so signal handlers work
cpuguy83 Sep 9, 2019
9544f87
integration-cli: swarm.RestartNode(); don't load busybox again
thaJeztah Sep 9, 2019
9bc5695
integration-cli: add daemon.StartNodeWithBusybox function
thaJeztah Sep 9, 2019
6e1a428
Windows: skip flaky TestLogBlocking
thaJeztah Sep 9, 2019
d236d18
awslogs: fix flaky TestLogBlocking unit test
samuelkarp Sep 20, 2019
a6d21bd
Fix more signal handling issues in tests.
cpuguy83 Sep 9, 2019
d88eaeb
Disable TestPsListContainersFilterExited (Windows)
Sep 17, 2019
b739525
integration-cli: run goimports
Sep 19, 2019
5766d99
[18.09] change c.Skip() to testRequires()
thaJeztah Oct 8, 2019
c3bc5d2
hack/test/unit: fix custom TESTFLAGS not working
thaJeztah Sep 13, 2019
9826c3e
[18.09] TEMPORARILY DISABLE FLAKY TEST CHECK
thaJeztah Oct 23, 2019
d4a5e65
TESTING: SKIP TestSwarmVolumePlugin
thaJeztah Oct 24, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Dockerfile
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,7 +36,7 @@ RUN sed -ri "s/(httpredir|deb).debian.org/${APT_MIRROR:-deb.debian.org}/g" /etc/
FROM base AS criu
ARG DEBIAN_FRONTEND
# Install CRIU for checkpoint/restore support
ENV CRIU_VERSION 3.6
ENV CRIU_VERSION 3.12
# Install dependency packages specific to criu
RUN apt-get update && apt-get install -y --no-install-recommends \
libnet-dev \
Expand DownExpand Up@@ -251,6 +251,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
zip \
bzip2 \
xz-utils \
libprotobuf-c1 \
libnet1 \
libnl-3-200 \
&& rm -rf /var/lib/apt/lists/*

RUN pip3 install yamllint==1.16.0
Expand Down
80 changes: 38 additions & 42 deletions builder/dockerfile/evaluator_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,7 @@ package dockerfile // import "github.com/docker/docker/builder/dockerfile"

import (
"os"
"runtime"
"testing"

"github.com/docker/docker/builder/remotecontext"
Expand All@@ -23,8 +24,11 @@ func init() {
reexec.Init()
}

func initDispatchTestCases() []dispatchTestCase {
dispatchTestCases := []dispatchTestCase{
func TestDispatch(t *testing.T) {
if runtime.GOOS != "windows" {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
}
testCases := []dispatchTestCase{
{
name: "ADD multiple files to file",
cmd: &instructions.AddCommand{SourcesAndDest: instructions.SourcesAndDest{
Expand DownExpand Up@@ -91,54 +95,46 @@ func initDispatchTestCases() []dispatchTestCase {
}},
expectedError: "source can't be a URL for COPY",
files: nil,
}}

return dispatchTestCases
}

func TestDispatch(t *testing.T) {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
testCases := initDispatchTestCases()

for _, testCase := range testCases {
executeTestCase(t, testCase)
},
}
}

func executeTestCase(t *testing.T, testCase dispatchTestCase) {
contextDir, cleanup := createTestTempDir(t, "", "builder-dockerfile-test")
defer cleanup()
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
contextDir, cleanup := createTestTempDir(t, "", "builder-dockerfile-test")
defer cleanup()

for filename, content := range testCase.files {
createTestTempFile(t, contextDir, filename, content, 0777)
}
for filename, content := range tc.files {
createTestTempFile(t, contextDir, filename, content, 0777)
}

tarStream, err := archive.Tar(contextDir, archive.Uncompressed)
tarStream, err := archive.Tar(contextDir, archive.Uncompressed)

if err != nil {
t.Fatalf("Error when creating tar stream: %s", err)
}
if err != nil {
t.Fatalf("Error when creating tar stream: %s", err)
}

defer func() {
if err = tarStream.Close(); err != nil {
t.Fatalf("Error when closing tar stream: %s", err)
}
}()
defer func() {
if err = tarStream.Close(); err != nil {
t.Fatalf("Error when closing tar stream: %s", err)
}
}()

context, err := remotecontext.FromArchive(tarStream)
context, err := remotecontext.FromArchive(tarStream)

if err != nil {
t.Fatalf("Error when creating tar context: %s", err)
}
if err != nil {
t.Fatalf("Error when creating tar context: %s", err)
}

defer func() {
if err = context.Close(); err != nil {
t.Fatalf("Error when closing tar context: %s", err)
}
}()
defer func() {
if err = context.Close(); err != nil {
t.Fatalf("Error when closing tar context: %s", err)
}
}()

b := newBuilderWithMockBackend()
sb := newDispatchRequest(b, '`', context, NewBuildArgs(make(map[string]*string)), newStagesBuildResults())
err = dispatch(sb, testCase.cmd)
assert.Check(t, is.ErrorContains(err, testCase.expectedError))
b := newBuilderWithMockBackend()
sb := newDispatchRequest(b, '`', context, NewBuildArgs(make(map[string]*string)), newStagesBuildResults())
err = dispatch(sb, tc.cmd)
assert.Check(t, is.ErrorContains(err, tc.expectedError))
})
}
}
9 changes: 7 additions & 2 deletions builder/dockerfile/internals_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -47,6 +47,9 @@ func TestDockerfileOutsideTheBuildContext(t *testing.T) {
defer cleanup()

expectedError := "Forbidden path outside the build context: ../../Dockerfile ()"
if runtime.GOOS == "windows" {
expectedError = "failed to resolve scoped path ../../Dockerfile ()"
}

readAndCheckDockerfile(t, "DockerfileOutsideTheBuildContext", contextDir, "../../Dockerfile", expectedError)
}
Expand All@@ -61,7 +64,9 @@ func TestNonExistingDockerfile(t *testing.T) {
}

func readAndCheckDockerfile(t *testing.T, testName, contextDir, dockerfilePath, expectedError string) {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
if runtime.GOOS != "windows" {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
}
tarStream, err := archive.Tar(contextDir, archive.Uncompressed)
assert.NilError(t, err)

Expand All@@ -80,7 +85,7 @@ func readAndCheckDockerfile(t *testing.T, testName, contextDir, dockerfilePath,
Source: tarStream,
}
_, _, err = remotecontext.Detect(config)
assert.Check(t, is.Error(err, expectedError))
assert.Check(t, is.ErrorContains(err, expectedError))
}

func TestCopyRunConfig(t *testing.T) {
Expand Down
9 changes: 9 additions & 0 deletions cmd/dockerd/config.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,8 +3,10 @@ package main
import (
"runtime"

"github.com/docker/docker/daemon"
"github.com/docker/docker/daemon/config"
"github.com/docker/docker/opts"
"github.com/docker/docker/plugin/executor/containerd"
"github.com/docker/docker/registry"
"github.com/spf13/pflag"
)
Expand DownExpand Up@@ -80,6 +82,13 @@ func installCommonConfigFlags(conf *config.Config, flags *pflag.FlagSet) {

conf.MaxConcurrentDownloads = &maxConcurrentDownloads
conf.MaxConcurrentUploads = &maxConcurrentUploads

flags.StringVar(&conf.ContainerdNamespace, "containerd-namespace", daemon.ContainersNamespace, "Containerd namespace to use")
if err := flags.MarkHidden("containerd-namespace"); err != nil {
return
}
flags.StringVar(&conf.ContainerdPluginNamespace, "containerd-plugins-namespace", containerd.PluginNamespace, "Containerd namespace to use for plugins")
flags.MarkHidden("containerd-plugins-namespace")
}

func installRegistryServiceFlags(options *registry.ServiceOptions, flags *pflag.FlagSet) {
Expand Down
36 changes: 27 additions & 9 deletions cmd/dockerd/daemon.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -83,6 +83,13 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
if cli.Config, err = loadDaemonCliConfig(opts); err != nil {
return err
}

if err := configureDaemonLogs(cli.Config); err != nil {
return err
}

logrus.Info("Starting up")

cli.configFile = &opts.configFile
cli.flags = opts.flags

Expand All@@ -94,12 +101,6 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
logrus.Warn("Running experimental build")
}

logrus.SetFormatter(&logrus.TextFormatter{
TimestampFormat: jsonmessage.RFC3339NanoFixed,
DisableColors: cli.Config.RawLogs,
FullTimestamp: true,
})

system.InitLCOW(cli.Config.Experimental)

if err := setDefaultUmask(); err != nil {
Expand DownExpand Up@@ -249,6 +250,7 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
return fmt.Errorf("Shutting down due to ServeAPI error: %v", errAPI)
}

logrus.Info("Daemon shutdown complete")
return nil
}

Expand DownExpand Up@@ -471,9 +473,6 @@ func loadDaemonCliConfig(opts *daemonOptions) (*config.Config, error) {
conf.TLS = true
}

// ensure that the log level is the one set after merging configurations
setLogLevel(conf.LogLevel)

return conf, nil
}

Expand DownExpand Up@@ -670,3 +669,22 @@ func systemContainerdRunning() bool {
_, err := os.Lstat(containerddefaults.DefaultAddress)
return err == nil
}

// configureDaemonLogs sets the logrus logging level and formatting
func configureDaemonLogs(conf *config.Config) error {
if conf.LogLevel != "" {
lvl, err := logrus.ParseLevel(conf.LogLevel)
if err != nil {
return fmt.Errorf("unable to parse logging level: %s", conf.LogLevel)
}
logrus.SetLevel(lvl)
} else {
logrus.SetLevel(logrus.InfoLevel)
}
logrus.SetFormatter(&logrus.TextFormatter{
TimestampFormat: jsonmessage.RFC3339NanoFixed,
DisableColors: conf.RawLogs,
FullTimestamp: true,
})
return nil
}
20 changes: 19 additions & 1 deletion cmd/dockerd/daemon_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,7 +146,6 @@ func TestLoadDaemonCliConfigWithLogLevel(t *testing.T) {
assert.NilError(t, err)
assert.Assert(t, loadedConfig != nil)
assert.Check(t, is.Equal("warn", loadedConfig.LogLevel))
assert.Check(t, is.Equal(logrus.WarnLevel, logrus.GetLevel()))
}

func TestLoadDaemonConfigWithEmbeddedOptions(t *testing.T) {
Expand DownExpand Up@@ -180,3 +179,22 @@ func TestLoadDaemonConfigWithRegistryOptions(t *testing.T) {
assert.Check(t, is.Len(loadedConfig.Mirrors, 1))
assert.Check(t, is.Len(loadedConfig.InsecureRegistries, 1))
}

func TestConfigureDaemonLogs(t *testing.T) {
conf := &config.Config{}
err := configureDaemonLogs(conf)
assert.NilError(t, err)
assert.Check(t, is.Equal(logrus.InfoLevel, logrus.GetLevel()))

conf.LogLevel = "warn"
err = configureDaemonLogs(conf)
assert.NilError(t, err)
assert.Check(t, is.Equal(logrus.WarnLevel, logrus.GetLevel()))

conf.LogLevel = "foobar"
err = configureDaemonLogs(conf)
assert.Error(t, err, "unable to parse logging level: foobar")

// log level should not be changed after a failure
assert.Check(t, is.Equal(logrus.WarnLevel, logrus.GetLevel()))
}
7 changes: 7 additions & 0 deletions cmd/dockerd/docker.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ import (
"github.com/docker/docker/cli"
"github.com/docker/docker/daemon/config"
"github.com/docker/docker/dockerversion"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/docker/pkg/reexec"
"github.com/docker/docker/pkg/term"
"github.com/moby/buildkit/util/apicaps"
Expand DownExpand Up@@ -54,6 +55,12 @@ func main() {
return
}

// initial log formatting; this setting is updated after the daemon configuration is loaded.
logrus.SetFormatter(&logrus.TextFormatter{
TimestampFormat: jsonmessage.RFC3339NanoFixed,
FullTimestamp: true,
})

// Set terminal emulation based on platform as required.
_, stdout, stderr := term.StdStreams()

Expand Down
16 changes: 0 additions & 16 deletions cmd/dockerd/options.go
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
package main

import (
"fmt"
"os"
"path/filepath"

cliconfig "github.com/docker/docker/cli/config"
"github.com/docker/docker/daemon/config"
"github.com/docker/docker/opts"
"github.com/docker/go-connections/tlsconfig"
"github.com/sirupsen/logrus"
"github.com/spf13/pflag"
)

Expand DownExpand Up@@ -106,17 +104,3 @@ func (o *daemonOptions) SetDefaultOptions(flags *pflag.FlagSet) {
}
}
}

// setLogLevel sets the logrus logging level
func setLogLevel(logLevel string) {
if logLevel != "" {
lvl, err := logrus.ParseLevel(logLevel)
if err != nil {
fmt.Fprintf(os.Stderr, "Unable to parse logging level: %s\n", logLevel)
os.Exit(1)
}
logrus.SetLevel(lvl)
} else {
logrus.SetLevel(logrus.InfoLevel)
}
}
11 changes: 1 addition & 10 deletions daemon/checkpoint.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,6 @@ package daemon // import "github.com/docker/docker/daemon"

import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"os"
Expand DownExpand Up@@ -127,15 +126,7 @@ func (daemon *Daemon) CheckpointList(name string, config types.CheckpointListOpt
if !d.IsDir() {
continue
}
path := filepath.Join(checkpointDir, d.Name(), "config.json")
data, err := ioutil.ReadFile(path)
if err != nil {
return nil, err
}
var cpt types.Checkpoint
if err := json.Unmarshal(data, &cpt); err != nil {
return nil, err
}
cpt := types.Checkpoint{Name: d.Name()}
out = append(out, cpt)
}

Expand Down
3 changes: 3 additions & 0 deletions daemon/config/config.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -229,6 +229,9 @@ type CommonConfig struct {
Features map[string]bool `json:"features,omitempty"`

Builder BuilderConfig `json:"builder,omitempty"`

ContainerdNamespace string `json:"containerd-namespace,omitempty"`
ContainerdPluginNamespace string `json:"containerd-plugin-namespace,omitempty"`
}

// IsValueSet returns true if a configuration value
Expand Down
2 changes: 1 addition & 1 deletion daemon/container_operations.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -813,7 +813,7 @@ func (daemon *Daemon) connectToNetwork(container *container.Container, idOrName
return nil
}

func updateJoinInfo(networkSettings *network.Settings, n libnetwork.Network, ep libnetwork.Endpoint) error { // nolint: interfacer
func updateJoinInfo(networkSettings *network.Settings, n libnetwork.Network, ep libnetwork.Endpoint) error {
if ep == nil {
return errors.New("invalid enppoint whhile building portmap info")
}
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
6d8fbac
Configure log-format earlier, and small refactor
thaJeztah Nov 24, 2018
1bda75e
migrated container wait integration tests from integration-cli to int…
adshmh Jul 23, 2018
5cde2dd
[18.09] integration/internal: add new test options
AkihiroSuda Oct 10, 2018
7985bd8
integration/container: add a base test for C/R
avagin Dec 29, 2018
4ac5dba
Fix CheckpointList
avagin Dec 29, 2018
9fa7f6c
Temporarily disable TestCheckpoint
thaJeztah Apr 1, 2019
9f02d3b
integration: change network.CreateNoError signature to fix linting
thaJeztah Jun 6, 2019
c82cbe9
integration: change container.Create signature to fix linting
thaJeztah Jun 6, 2019
85c5aab
integration: change container.Run signature to fix linting
thaJeztah Jun 6, 2019
2eb2aaf
integration: change createAmbiguousNetworks signature to fix linting
thaJeztah Jun 6, 2019
e91e9c3
integration: change testGraphDriver signature to fix linting
thaJeztah Jun 6, 2019
4005149
integration: get tests to compile again
Jun 12, 2019
e9bd47a
Revert "integration: have container.Create call compile"
thaJeztah Oct 8, 2019
4aae081
Revert "Fixing integration test"
thaJeztah Oct 8, 2019
a5620fc
TestServiceWithDefaultAddressPoolInit
selansen Sep 13, 2018
93de6ed
Add TC to check dyanmic subnet for ingress network
Sep 20, 2019
8c60be3
integration-cli/build: don't panic
kolyshkin Dec 21, 2018
e42b14a
*: remove interfacer linter from CI
cyphar Mar 12, 2019
5c1aea7
integration-cli: don't build -test images if they already exist
cyphar Mar 12, 2019
6cc5e98
internal: test/env: switch to assert.TestingT
cyphar Mar 12, 2019
266674a
Integration: remove unneeded platform check for IPVLAN tests
thaJeztah Jun 28, 2019
989a8a6
Integration: IPVlan add missing import comment
thaJeztah Jun 28, 2019
4ecaa08
Integration: exclude IPVlan test-suite on Windows
thaJeztah Jul 11, 2019
bd195d0
Integration: remove redundant kernel version check for MACVlan
thaJeztah Jun 28, 2019
e5493c4
Integration: MACVlan add missing import comment and build-tag
thaJeztah Jun 28, 2019
3ca37e6
integration-cli: remove ExecSupport check
thaJeztah Jul 8, 2019
0a071f7
integration-cli: remove defaultSleepImage constant
thaJeztah Jul 8, 2019
9fc8134
integration-cli: remove unused requirements utils
thaJeztah Jul 8, 2019
4fb6f3f
Add containerd.WithTimeout(60*time.Second) to match old calls
Aug 22, 2018
cbd8227
Add (hidden) flags to set containerd namespaces
cpuguy83 Jul 11, 2019
34024ad
integration: fix cleanup of raft data
thaJeztah Jul 12, 2019
0f2b3f6
Optimize test daemon startup
cpuguy83 Apr 17, 2019
0ba4e3e
Add log entries for daemon startup/shutdown
cpuguy83 Apr 19, 2019
b773f3c
Improve select for daemon restart tests
crosbymichael Jul 2, 2019
81966d1
Don't log test initial test daemon ping failures
cpuguy83 Jul 12, 2019
7fb18ca
Fix Microsecond -> Milisecond.
cpuguy83 Jul 13, 2019
943bb6a
DockerSwarmSuite lock portIndex to work around race
thaJeztah Jul 13, 2019
bc63fef
Be more conservative for Windows in TestFrequency for Splunk
ddebroy Jul 17, 2019
743c961
Testing: create new daemon (only) if needed
thaJeztah Dec 24, 2018
72c8a91
integration: run build session tests on non-experimental
thaJeztah Jul 17, 2019
99725d6
integration-cli: increase healthcheck timeout
tonistiigi Jul 18, 2019
5905728
Retry service updates on out of sequence errors
dperny Jul 18, 2019
147c94d
integration-cli: remove redundant "testrequires"
thaJeztah Jul 19, 2019
48bfa1d
Add `FromClient` to test env execution
cpuguy83 Jul 24, 2019
03c4cf7
Better logging for swarm tests
cpuguy83 Jul 24, 2019
e1dc7f1
hack: Remove inContainer check, it wasn't useful
seemethere Jul 24, 2019
0de5218
Fix flaky TestServiceWithDefaultAddressPoolInit
Aug 5, 2019
8c69826
Move defer method to the top right after New is called
Aug 15, 2019
eed1ea0
Windows:Disable 2 restart test when Hyper-V
Feb 22, 2019
033474e
integration-cli/requirements: Skip windows specific isolation require…
Snorch Aug 7, 2019
baae46a
Dockerfile: update CRIU to v3.12
thaJeztah Aug 14, 2019
47c2af9
pkg/term: refactor TestEscapeProxyRead
thaJeztah Aug 27, 2019
81f3399
integration: windows.ps1: turn defender error into a warning
thaJeztah Aug 27, 2019
63c9022
LCOW: Log stderr on failures
Mar 8, 2018
fa1a38d
TestDispatch: refactor to use subtests again, and fix linting (struct…
thaJeztah Aug 27, 2019
27e9144
integration-cli: getContainerCount() fix trimming prefix
thaJeztah Aug 28, 2019
6e6c1ac
Fix docker inspect for dutimgVersion
StefanScherer Aug 30, 2019
b5a2940
integration-cli: fix some bashism's in Dockerfiles
thaJeztah Sep 2, 2019
d01572e
TestBuildSquashParent: fix non-standard comparisson
thaJeztah Sep 2, 2019
0f8e14d
hack/make/binary-daemon: fix some linting issues
thaJeztah Aug 31, 2019
49afe72
TestCase: use `icmd.RunCmd` instead `icmd.StartCmd`
tao12345666333 Sep 2, 2019
bec7a85
hack/ci/windows.ps1: explicitly set exit code to result of tests
thaJeztah Sep 2, 2019
5ed27d1
hack/ci/windows.ps1 print all environment variables to check how Jenk…
thaJeztah Sep 6, 2019
69ee162
integration-cli: update TestCreateWithWorkdir for Hyper-V isolation
thaJeztah Sep 4, 2019
65dc979
hack/ci/windows.ps1: add support for DOCKER_STORAGE_OPTS
thaJeztah Sep 4, 2019
2cf0f0a
hack/ci/windows.ps1: stop tailing logs after stopping the daemon
thaJeztah Sep 6, 2019
ef77905
Fix Service TTY test so signal handlers work
cpuguy83 Sep 9, 2019
9544f87
integration-cli: swarm.RestartNode(); don't load busybox again
thaJeztah Sep 9, 2019
9bc5695
integration-cli: add daemon.StartNodeWithBusybox function
thaJeztah Sep 9, 2019
6e1a428
Windows: skip flaky TestLogBlocking
thaJeztah Sep 9, 2019
d236d18
awslogs: fix flaky TestLogBlocking unit test
samuelkarp Sep 20, 2019
a6d21bd
Fix more signal handling issues in tests.
cpuguy83 Sep 9, 2019
d88eaeb
Disable TestPsListContainersFilterExited (Windows)
Sep 17, 2019
b739525
integration-cli: run goimports
Sep 19, 2019
5766d99
[18.09] change c.Skip() to testRequires()
thaJeztah Oct 8, 2019
c3bc5d2
hack/test/unit: fix custom TESTFLAGS not working
thaJeztah Sep 13, 2019
9826c3e
[18.09] TEMPORARILY DISABLE FLAKY TEST CHECK
thaJeztah Oct 23, 2019
d4a5e65
TESTING: SKIP TestSwarmVolumePlugin
thaJeztah Oct 24, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Dockerfile
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,7 +36,7 @@ RUN sed -ri "s/(httpredir|deb).debian.org/${APT_MIRROR:-deb.debian.org}/g" /etc/
FROM base AS criu
ARG DEBIAN_FRONTEND
# Install CRIU for checkpoint/restore support
ENV CRIU_VERSION 3.6
ENV CRIU_VERSION 3.12
# Install dependency packages specific to criu
RUN apt-get update && apt-get install -y --no-install-recommends \
libnet-dev \
Expand DownExpand Up@@ -251,6 +251,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
zip \
bzip2 \
xz-utils \
libprotobuf-c1 \
libnet1 \
libnl-3-200 \
&& rm -rf /var/lib/apt/lists/*

RUN pip3 install yamllint==1.16.0
Expand Down
80 changes: 38 additions & 42 deletions builder/dockerfile/evaluator_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,7 @@ package dockerfile // import "github.com/docker/docker/builder/dockerfile"

import (
"os"
"runtime"
"testing"

"github.com/docker/docker/builder/remotecontext"
Expand All@@ -23,8 +24,11 @@ func init() {
reexec.Init()
}

func initDispatchTestCases() []dispatchTestCase {
dispatchTestCases := []dispatchTestCase{
func TestDispatch(t *testing.T) {
if runtime.GOOS != "windows" {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
}
testCases := []dispatchTestCase{
{
name: "ADD multiple files to file",
cmd: &instructions.AddCommand{SourcesAndDest: instructions.SourcesAndDest{
Expand DownExpand Up@@ -91,54 +95,46 @@ func initDispatchTestCases() []dispatchTestCase {
}},
expectedError: "source can't be a URL for COPY",
files: nil,
}}

return dispatchTestCases
}

func TestDispatch(t *testing.T) {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
testCases := initDispatchTestCases()

for _, testCase := range testCases {
executeTestCase(t, testCase)
},
}
}

func executeTestCase(t *testing.T, testCase dispatchTestCase) {
contextDir, cleanup := createTestTempDir(t, "", "builder-dockerfile-test")
defer cleanup()
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
contextDir, cleanup := createTestTempDir(t, "", "builder-dockerfile-test")
defer cleanup()

for filename, content := range testCase.files {
createTestTempFile(t, contextDir, filename, content, 0777)
}
for filename, content := range tc.files {
createTestTempFile(t, contextDir, filename, content, 0777)
}

tarStream, err := archive.Tar(contextDir, archive.Uncompressed)
tarStream, err := archive.Tar(contextDir, archive.Uncompressed)

if err != nil {
t.Fatalf("Error when creating tar stream: %s", err)
}
if err != nil {
t.Fatalf("Error when creating tar stream: %s", err)
}

defer func() {
if err = tarStream.Close(); err != nil {
t.Fatalf("Error when closing tar stream: %s", err)
}
}()
defer func() {
if err = tarStream.Close(); err != nil {
t.Fatalf("Error when closing tar stream: %s", err)
}
}()

context, err := remotecontext.FromArchive(tarStream)
context, err := remotecontext.FromArchive(tarStream)

if err != nil {
t.Fatalf("Error when creating tar context: %s", err)
}
if err != nil {
t.Fatalf("Error when creating tar context: %s", err)
}

defer func() {
if err = context.Close(); err != nil {
t.Fatalf("Error when closing tar context: %s", err)
}
}()
defer func() {
if err = context.Close(); err != nil {
t.Fatalf("Error when closing tar context: %s", err)
}
}()

b := newBuilderWithMockBackend()
sb := newDispatchRequest(b, '`', context, NewBuildArgs(make(map[string]*string)), newStagesBuildResults())
err = dispatch(sb, testCase.cmd)
assert.Check(t, is.ErrorContains(err, testCase.expectedError))
b := newBuilderWithMockBackend()
sb := newDispatchRequest(b, '`', context, NewBuildArgs(make(map[string]*string)), newStagesBuildResults())
err = dispatch(sb, tc.cmd)
assert.Check(t, is.ErrorContains(err, tc.expectedError))
})
}
}
9 changes: 7 additions & 2 deletions builder/dockerfile/internals_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -47,6 +47,9 @@ func TestDockerfileOutsideTheBuildContext(t *testing.T) {
defer cleanup()

expectedError := "Forbidden path outside the build context: ../../Dockerfile ()"
if runtime.GOOS == "windows" {
expectedError = "failed to resolve scoped path ../../Dockerfile ()"
}

readAndCheckDockerfile(t, "DockerfileOutsideTheBuildContext", contextDir, "../../Dockerfile", expectedError)
}
Expand All@@ -61,7 +64,9 @@ func TestNonExistingDockerfile(t *testing.T) {
}

func readAndCheckDockerfile(t *testing.T, testName, contextDir, dockerfilePath, expectedError string) {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
if runtime.GOOS != "windows" {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
}
tarStream, err := archive.Tar(contextDir, archive.Uncompressed)
assert.NilError(t, err)

Expand All@@ -80,7 +85,7 @@ func readAndCheckDockerfile(t *testing.T, testName, contextDir, dockerfilePath,
Source: tarStream,
}
_, _, err = remotecontext.Detect(config)
assert.Check(t, is.Error(err, expectedError))
assert.Check(t, is.ErrorContains(err, expectedError))
}

func TestCopyRunConfig(t *testing.T) {
Expand Down
9 changes: 9 additions & 0 deletions cmd/dockerd/config.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,8 +3,10 @@ package main
import (
"runtime"

"github.com/docker/docker/daemon"
"github.com/docker/docker/daemon/config"
"github.com/docker/docker/opts"
"github.com/docker/docker/plugin/executor/containerd"
"github.com/docker/docker/registry"
"github.com/spf13/pflag"
)
Expand DownExpand Up@@ -80,6 +82,13 @@ func installCommonConfigFlags(conf *config.Config, flags *pflag.FlagSet) {

conf.MaxConcurrentDownloads = &maxConcurrentDownloads
conf.MaxConcurrentUploads = &maxConcurrentUploads

flags.StringVar(&conf.ContainerdNamespace, "containerd-namespace", daemon.ContainersNamespace, "Containerd namespace to use")
if err := flags.MarkHidden("containerd-namespace"); err != nil {
return
}
flags.StringVar(&conf.ContainerdPluginNamespace, "containerd-plugins-namespace", containerd.PluginNamespace, "Containerd namespace to use for plugins")
flags.MarkHidden("containerd-plugins-namespace")
}

func installRegistryServiceFlags(options *registry.ServiceOptions, flags *pflag.FlagSet) {
Expand Down
36 changes: 27 additions & 9 deletions cmd/dockerd/daemon.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -83,6 +83,13 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
if cli.Config, err = loadDaemonCliConfig(opts); err != nil {
return err
}

if err := configureDaemonLogs(cli.Config); err != nil {
return err
}

logrus.Info("Starting up")

cli.configFile = &opts.configFile
cli.flags = opts.flags

Expand All@@ -94,12 +101,6 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
logrus.Warn("Running experimental build")
}

logrus.SetFormatter(&logrus.TextFormatter{
TimestampFormat: jsonmessage.RFC3339NanoFixed,
DisableColors: cli.Config.RawLogs,
FullTimestamp: true,
})

system.InitLCOW(cli.Config.Experimental)

if err := setDefaultUmask(); err != nil {
Expand DownExpand Up@@ -249,6 +250,7 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
return fmt.Errorf("Shutting down due to ServeAPI error: %v", errAPI)
}

logrus.Info("Daemon shutdown complete")
return nil
}

Expand DownExpand Up@@ -471,9 +473,6 @@ func loadDaemonCliConfig(opts *daemonOptions) (*config.Config, error) {
conf.TLS = true
}

// ensure that the log level is the one set after merging configurations
setLogLevel(conf.LogLevel)

return conf, nil
}

Expand DownExpand Up@@ -670,3 +669,22 @@ func systemContainerdRunning() bool {
_, err := os.Lstat(containerddefaults.DefaultAddress)
return err == nil
}

// configureDaemonLogs sets the logrus logging level and formatting
func configureDaemonLogs(conf *config.Config) error {
if conf.LogLevel != "" {
lvl, err := logrus.ParseLevel(conf.LogLevel)
if err != nil {
return fmt.Errorf("unable to parse logging level: %s", conf.LogLevel)
}
logrus.SetLevel(lvl)
} else {
logrus.SetLevel(logrus.InfoLevel)
}
logrus.SetFormatter(&logrus.TextFormatter{
TimestampFormat: jsonmessage.RFC3339NanoFixed,
DisableColors: conf.RawLogs,
FullTimestamp: true,
})
return nil
}
20 changes: 19 additions & 1 deletion cmd/dockerd/daemon_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,7 +146,6 @@ func TestLoadDaemonCliConfigWithLogLevel(t *testing.T) {
assert.NilError(t, err)
assert.Assert(t, loadedConfig != nil)
assert.Check(t, is.Equal("warn", loadedConfig.LogLevel))
assert.Check(t, is.Equal(logrus.WarnLevel, logrus.GetLevel()))
}

func TestLoadDaemonConfigWithEmbeddedOptions(t *testing.T) {
Expand DownExpand Up@@ -180,3 +179,22 @@ func TestLoadDaemonConfigWithRegistryOptions(t *testing.T) {
assert.Check(t, is.Len(loadedConfig.Mirrors, 1))
assert.Check(t, is.Len(loadedConfig.InsecureRegistries, 1))
}

func TestConfigureDaemonLogs(t *testing.T) {
conf := &config.Config{}
err := configureDaemonLogs(conf)
assert.NilError(t, err)
assert.Check(t, is.Equal(logrus.InfoLevel, logrus.GetLevel()))

conf.LogLevel = "warn"
err = configureDaemonLogs(conf)
assert.NilError(t, err)
assert.Check(t, is.Equal(logrus.WarnLevel, logrus.GetLevel()))

conf.LogLevel = "foobar"
err = configureDaemonLogs(conf)
assert.Error(t, err, "unable to parse logging level: foobar")

// log level should not be changed after a failure
assert.Check(t, is.Equal(logrus.WarnLevel, logrus.GetLevel()))
}
7 changes: 7 additions & 0 deletions cmd/dockerd/docker.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ import (
"github.com/docker/docker/cli"
"github.com/docker/docker/daemon/config"
"github.com/docker/docker/dockerversion"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/docker/pkg/reexec"
"github.com/docker/docker/pkg/term"
"github.com/moby/buildkit/util/apicaps"
Expand DownExpand Up@@ -54,6 +55,12 @@ func main() {
return
}

// initial log formatting; this setting is updated after the daemon configuration is loaded.
logrus.SetFormatter(&logrus.TextFormatter{
TimestampFormat: jsonmessage.RFC3339NanoFixed,
FullTimestamp: true,
})

// Set terminal emulation based on platform as required.
_, stdout, stderr := term.StdStreams()

Expand Down
16 changes: 0 additions & 16 deletions cmd/dockerd/options.go
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
package main

import (
"fmt"
"os"
"path/filepath"

cliconfig "github.com/docker/docker/cli/config"
"github.com/docker/docker/daemon/config"
"github.com/docker/docker/opts"
"github.com/docker/go-connections/tlsconfig"
"github.com/sirupsen/logrus"
"github.com/spf13/pflag"
)

Expand DownExpand Up@@ -106,17 +104,3 @@ func (o *daemonOptions) SetDefaultOptions(flags *pflag.FlagSet) {
}
}
}

// setLogLevel sets the logrus logging level
func setLogLevel(logLevel string) {
if logLevel != "" {
lvl, err := logrus.ParseLevel(logLevel)
if err != nil {
fmt.Fprintf(os.Stderr, "Unable to parse logging level: %s\n", logLevel)
os.Exit(1)
}
logrus.SetLevel(lvl)
} else {
logrus.SetLevel(logrus.InfoLevel)
}
}
11 changes: 1 addition & 10 deletions daemon/checkpoint.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,6 @@ package daemon // import "github.com/docker/docker/daemon"

import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"os"
Expand DownExpand Up@@ -127,15 +126,7 @@ func (daemon *Daemon) CheckpointList(name string, config types.CheckpointListOpt
if !d.IsDir() {
continue
}
path := filepath.Join(checkpointDir, d.Name(), "config.json")
data, err := ioutil.ReadFile(path)
if err != nil {
return nil, err
}
var cpt types.Checkpoint
if err := json.Unmarshal(data, &cpt); err != nil {
return nil, err
}
cpt := types.Checkpoint{Name: d.Name()}
out = append(out, cpt)
}

Expand Down
3 changes: 3 additions & 0 deletions daemon/config/config.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -229,6 +229,9 @@ type CommonConfig struct {
Features map[string]bool `json:"features,omitempty"`

Builder BuilderConfig `json:"builder,omitempty"`

ContainerdNamespace string `json:"containerd-namespace,omitempty"`
ContainerdPluginNamespace string `json:"containerd-plugin-namespace,omitempty"`
}

// IsValueSet returns true if a configuration value
Expand Down
2 changes: 1 addition & 1 deletion daemon/container_operations.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -813,7 +813,7 @@ func (daemon *Daemon) connectToNetwork(container *container.Container, idOrName
return nil
}

func updateJoinInfo(networkSettings *network.Settings, n libnetwork.Network, ep libnetwork.Endpoint) error { // nolint: interfacer
func updateJoinInfo(networkSettings *network.Settings, n libnetwork.Network, ep libnetwork.Endpoint) error {
if ep == nil {
return errors.New("invalid enppoint whhile building portmap info")
}
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
6d8fbac
Configure log-format earlier, and small refactor
thaJeztah Nov 24, 2018
1bda75e
migrated container wait integration tests from integration-cli to int…
adshmh Jul 23, 2018
5cde2dd
[18.09] integration/internal: add new test options
AkihiroSuda Oct 10, 2018
7985bd8
integration/container: add a base test for C/R
avagin Dec 29, 2018
4ac5dba
Fix CheckpointList
avagin Dec 29, 2018
9fa7f6c
Temporarily disable TestCheckpoint
thaJeztah Apr 1, 2019
9f02d3b
integration: change network.CreateNoError signature to fix linting
thaJeztah Jun 6, 2019
c82cbe9
integration: change container.Create signature to fix linting
thaJeztah Jun 6, 2019
85c5aab
integration: change container.Run signature to fix linting
thaJeztah Jun 6, 2019
2eb2aaf
integration: change createAmbiguousNetworks signature to fix linting
thaJeztah Jun 6, 2019
e91e9c3
integration: change testGraphDriver signature to fix linting
thaJeztah Jun 6, 2019
4005149
integration: get tests to compile again
Jun 12, 2019
e9bd47a
Revert "integration: have container.Create call compile"
thaJeztah Oct 8, 2019
4aae081
Revert "Fixing integration test"
thaJeztah Oct 8, 2019
a5620fc
TestServiceWithDefaultAddressPoolInit
selansen Sep 13, 2018
93de6ed
Add TC to check dyanmic subnet for ingress network
Sep 20, 2019
8c60be3
integration-cli/build: don't panic
kolyshkin Dec 21, 2018
e42b14a
*: remove interfacer linter from CI
cyphar Mar 12, 2019
5c1aea7
integration-cli: don't build -test images if they already exist
cyphar Mar 12, 2019
6cc5e98
internal: test/env: switch to assert.TestingT
cyphar Mar 12, 2019
266674a
Integration: remove unneeded platform check for IPVLAN tests
thaJeztah Jun 28, 2019
989a8a6
Integration: IPVlan add missing import comment
thaJeztah Jun 28, 2019
4ecaa08
Integration: exclude IPVlan test-suite on Windows
thaJeztah Jul 11, 2019
bd195d0
Integration: remove redundant kernel version check for MACVlan
thaJeztah Jun 28, 2019
e5493c4
Integration: MACVlan add missing import comment and build-tag
thaJeztah Jun 28, 2019
3ca37e6
integration-cli: remove ExecSupport check
thaJeztah Jul 8, 2019
0a071f7
integration-cli: remove defaultSleepImage constant
thaJeztah Jul 8, 2019
9fc8134
integration-cli: remove unused requirements utils
thaJeztah Jul 8, 2019
4fb6f3f
Add containerd.WithTimeout(60*time.Second) to match old calls
Aug 22, 2018
cbd8227
Add (hidden) flags to set containerd namespaces
cpuguy83 Jul 11, 2019
34024ad
integration: fix cleanup of raft data
thaJeztah Jul 12, 2019
0f2b3f6
Optimize test daemon startup
cpuguy83 Apr 17, 2019
0ba4e3e
Add log entries for daemon startup/shutdown
cpuguy83 Apr 19, 2019
b773f3c
Improve select for daemon restart tests
crosbymichael Jul 2, 2019
81966d1
Don't log test initial test daemon ping failures
cpuguy83 Jul 12, 2019
7fb18ca
Fix Microsecond -> Milisecond.
cpuguy83 Jul 13, 2019
943bb6a
DockerSwarmSuite lock portIndex to work around race
thaJeztah Jul 13, 2019
bc63fef
Be more conservative for Windows in TestFrequency for Splunk
ddebroy Jul 17, 2019
743c961
Testing: create new daemon (only) if needed
thaJeztah Dec 24, 2018
72c8a91
integration: run build session tests on non-experimental
thaJeztah Jul 17, 2019
99725d6
integration-cli: increase healthcheck timeout
tonistiigi Jul 18, 2019
5905728
Retry service updates on out of sequence errors
dperny Jul 18, 2019
147c94d
integration-cli: remove redundant "testrequires"
thaJeztah Jul 19, 2019
48bfa1d
Add `FromClient` to test env execution
cpuguy83 Jul 24, 2019
03c4cf7
Better logging for swarm tests
cpuguy83 Jul 24, 2019
e1dc7f1
hack: Remove inContainer check, it wasn't useful
seemethere Jul 24, 2019
0de5218
Fix flaky TestServiceWithDefaultAddressPoolInit
Aug 5, 2019
8c69826
Move defer method to the top right after New is called
Aug 15, 2019
eed1ea0
Windows:Disable 2 restart test when Hyper-V
Feb 22, 2019
033474e
integration-cli/requirements: Skip windows specific isolation require…
Snorch Aug 7, 2019
baae46a
Dockerfile: update CRIU to v3.12
thaJeztah Aug 14, 2019
47c2af9
pkg/term: refactor TestEscapeProxyRead
thaJeztah Aug 27, 2019
81f3399
integration: windows.ps1: turn defender error into a warning
thaJeztah Aug 27, 2019
63c9022
LCOW: Log stderr on failures
Mar 8, 2018
fa1a38d
TestDispatch: refactor to use subtests again, and fix linting (struct…
thaJeztah Aug 27, 2019
27e9144
integration-cli: getContainerCount() fix trimming prefix
thaJeztah Aug 28, 2019
6e6c1ac
Fix docker inspect for dutimgVersion
StefanScherer Aug 30, 2019
b5a2940
integration-cli: fix some bashism's in Dockerfiles
thaJeztah Sep 2, 2019
d01572e
TestBuildSquashParent: fix non-standard comparisson
thaJeztah Sep 2, 2019
0f8e14d
hack/make/binary-daemon: fix some linting issues
thaJeztah Aug 31, 2019
49afe72
TestCase: use `icmd.RunCmd` instead `icmd.StartCmd`
tao12345666333 Sep 2, 2019
bec7a85
hack/ci/windows.ps1: explicitly set exit code to result of tests
thaJeztah Sep 2, 2019
5ed27d1
hack/ci/windows.ps1 print all environment variables to check how Jenk…
thaJeztah Sep 6, 2019
69ee162
integration-cli: update TestCreateWithWorkdir for Hyper-V isolation
thaJeztah Sep 4, 2019
65dc979
hack/ci/windows.ps1: add support for DOCKER_STORAGE_OPTS
thaJeztah Sep 4, 2019
2cf0f0a
hack/ci/windows.ps1: stop tailing logs after stopping the daemon
thaJeztah Sep 6, 2019
ef77905
Fix Service TTY test so signal handlers work
cpuguy83 Sep 9, 2019
9544f87
integration-cli: swarm.RestartNode(); don't load busybox again
thaJeztah Sep 9, 2019
9bc5695
integration-cli: add daemon.StartNodeWithBusybox function
thaJeztah Sep 9, 2019
6e1a428
Windows: skip flaky TestLogBlocking
thaJeztah Sep 9, 2019
d236d18
awslogs: fix flaky TestLogBlocking unit test
samuelkarp Sep 20, 2019
a6d21bd
Fix more signal handling issues in tests.
cpuguy83 Sep 9, 2019
d88eaeb
Disable TestPsListContainersFilterExited (Windows)
Sep 17, 2019
b739525
integration-cli: run goimports
Sep 19, 2019
5766d99
[18.09] change c.Skip() to testRequires()
thaJeztah Oct 8, 2019
c3bc5d2
hack/test/unit: fix custom TESTFLAGS not working
thaJeztah Sep 13, 2019
9826c3e
[18.09] TEMPORARILY DISABLE FLAKY TEST CHECK
thaJeztah Oct 23, 2019
d4a5e65
TESTING: SKIP TestSwarmVolumePlugin
thaJeztah Oct 24, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Dockerfile
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,7 +36,7 @@ RUN sed -ri "s/(httpredir|deb).debian.org/${APT_MIRROR:-deb.debian.org}/g" /etc/
FROM base AS criu
ARG DEBIAN_FRONTEND
# Install CRIU for checkpoint/restore support
ENV CRIU_VERSION 3.6
ENV CRIU_VERSION 3.12
# Install dependency packages specific to criu
RUN apt-get update && apt-get install -y --no-install-recommends \
libnet-dev \
Expand DownExpand Up@@ -251,6 +251,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
zip \
bzip2 \
xz-utils \
libprotobuf-c1 \
libnet1 \
libnl-3-200 \
&& rm -rf /var/lib/apt/lists/*

RUN pip3 install yamllint==1.16.0
Expand Down
80 changes: 38 additions & 42 deletions builder/dockerfile/evaluator_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,7 @@ package dockerfile // import "github.com/docker/docker/builder/dockerfile"

import (
"os"
"runtime"
"testing"

"github.com/docker/docker/builder/remotecontext"
Expand All@@ -23,8 +24,11 @@ func init() {
reexec.Init()
}

func initDispatchTestCases() []dispatchTestCase {
dispatchTestCases := []dispatchTestCase{
func TestDispatch(t *testing.T) {
if runtime.GOOS != "windows" {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
}
testCases := []dispatchTestCase{
{
name: "ADD multiple files to file",
cmd: &instructions.AddCommand{SourcesAndDest: instructions.SourcesAndDest{
Expand DownExpand Up@@ -91,54 +95,46 @@ func initDispatchTestCases() []dispatchTestCase {
}},
expectedError: "source can't be a URL for COPY",
files: nil,
}}

return dispatchTestCases
}

func TestDispatch(t *testing.T) {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
testCases := initDispatchTestCases()

for _, testCase := range testCases {
executeTestCase(t, testCase)
},
}
}

func executeTestCase(t *testing.T, testCase dispatchTestCase) {
contextDir, cleanup := createTestTempDir(t, "", "builder-dockerfile-test")
defer cleanup()
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
contextDir, cleanup := createTestTempDir(t, "", "builder-dockerfile-test")
defer cleanup()

for filename, content := range testCase.files {
createTestTempFile(t, contextDir, filename, content, 0777)
}
for filename, content := range tc.files {
createTestTempFile(t, contextDir, filename, content, 0777)
}

tarStream, err := archive.Tar(contextDir, archive.Uncompressed)
tarStream, err := archive.Tar(contextDir, archive.Uncompressed)

if err != nil {
t.Fatalf("Error when creating tar stream: %s", err)
}
if err != nil {
t.Fatalf("Error when creating tar stream: %s", err)
}

defer func() {
if err = tarStream.Close(); err != nil {
t.Fatalf("Error when closing tar stream: %s", err)
}
}()
defer func() {
if err = tarStream.Close(); err != nil {
t.Fatalf("Error when closing tar stream: %s", err)
}
}()

context, err := remotecontext.FromArchive(tarStream)
context, err := remotecontext.FromArchive(tarStream)

if err != nil {
t.Fatalf("Error when creating tar context: %s", err)
}
if err != nil {
t.Fatalf("Error when creating tar context: %s", err)
}

defer func() {
if err = context.Close(); err != nil {
t.Fatalf("Error when closing tar context: %s", err)
}
}()
defer func() {
if err = context.Close(); err != nil {
t.Fatalf("Error when closing tar context: %s", err)
}
}()

b := newBuilderWithMockBackend()
sb := newDispatchRequest(b, '`', context, NewBuildArgs(make(map[string]*string)), newStagesBuildResults())
err = dispatch(sb, testCase.cmd)
assert.Check(t, is.ErrorContains(err, testCase.expectedError))
b := newBuilderWithMockBackend()
sb := newDispatchRequest(b, '`', context, NewBuildArgs(make(map[string]*string)), newStagesBuildResults())
err = dispatch(sb, tc.cmd)
assert.Check(t, is.ErrorContains(err, tc.expectedError))
})
}
}
9 changes: 7 additions & 2 deletions builder/dockerfile/internals_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -47,6 +47,9 @@ func TestDockerfileOutsideTheBuildContext(t *testing.T) {
defer cleanup()

expectedError := "Forbidden path outside the build context: ../../Dockerfile ()"
if runtime.GOOS == "windows" {
expectedError = "failed to resolve scoped path ../../Dockerfile ()"
}

readAndCheckDockerfile(t, "DockerfileOutsideTheBuildContext", contextDir, "../../Dockerfile", expectedError)
}
Expand All@@ -61,7 +64,9 @@ func TestNonExistingDockerfile(t *testing.T) {
}

func readAndCheckDockerfile(t *testing.T, testName, contextDir, dockerfilePath, expectedError string) {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
if runtime.GOOS != "windows" {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
}
tarStream, err := archive.Tar(contextDir, archive.Uncompressed)
assert.NilError(t, err)

Expand All@@ -80,7 +85,7 @@ func readAndCheckDockerfile(t *testing.T, testName, contextDir, dockerfilePath,
Source: tarStream,
}
_, _, err = remotecontext.Detect(config)
assert.Check(t, is.Error(err, expectedError))
assert.Check(t, is.ErrorContains(err, expectedError))
}

func TestCopyRunConfig(t *testing.T) {
Expand Down
9 changes: 9 additions & 0 deletions cmd/dockerd/config.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,8 +3,10 @@ package main
import (
"runtime"

"github.com/docker/docker/daemon"
"github.com/docker/docker/daemon/config"
"github.com/docker/docker/opts"
"github.com/docker/docker/plugin/executor/containerd"
"github.com/docker/docker/registry"
"github.com/spf13/pflag"
)
Expand DownExpand Up@@ -80,6 +82,13 @@ func installCommonConfigFlags(conf *config.Config, flags *pflag.FlagSet) {

conf.MaxConcurrentDownloads = &maxConcurrentDownloads
conf.MaxConcurrentUploads = &maxConcurrentUploads

flags.StringVar(&conf.ContainerdNamespace, "containerd-namespace", daemon.ContainersNamespace, "Containerd namespace to use")
if err := flags.MarkHidden("containerd-namespace"); err != nil {
return
}
flags.StringVar(&conf.ContainerdPluginNamespace, "containerd-plugins-namespace", containerd.PluginNamespace, "Containerd namespace to use for plugins")
flags.MarkHidden("containerd-plugins-namespace")
}

func installRegistryServiceFlags(options *registry.ServiceOptions, flags *pflag.FlagSet) {
Expand Down
36 changes: 27 additions & 9 deletions cmd/dockerd/daemon.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -83,6 +83,13 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
if cli.Config, err = loadDaemonCliConfig(opts); err != nil {
return err
}

if err := configureDaemonLogs(cli.Config); err != nil {
return err
}

logrus.Info("Starting up")

cli.configFile = &opts.configFile
cli.flags = opts.flags

Expand All@@ -94,12 +101,6 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
logrus.Warn("Running experimental build")
}

logrus.SetFormatter(&logrus.TextFormatter{
TimestampFormat: jsonmessage.RFC3339NanoFixed,
DisableColors: cli.Config.RawLogs,
FullTimestamp: true,
})

system.InitLCOW(cli.Config.Experimental)

if err := setDefaultUmask(); err != nil {
Expand DownExpand Up@@ -249,6 +250,7 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
return fmt.Errorf("Shutting down due to ServeAPI error: %v", errAPI)
}

logrus.Info("Daemon shutdown complete")
return nil
}

Expand DownExpand Up@@ -471,9 +473,6 @@ func loadDaemonCliConfig(opts *daemonOptions) (*config.Config, error) {
conf.TLS = true
}

// ensure that the log level is the one set after merging configurations
setLogLevel(conf.LogLevel)

return conf, nil
}

Expand DownExpand Up@@ -670,3 +669,22 @@ func systemContainerdRunning() bool {
_, err := os.Lstat(containerddefaults.DefaultAddress)
return err == nil
}

// configureDaemonLogs sets the logrus logging level and formatting
func configureDaemonLogs(conf *config.Config) error {
if conf.LogLevel != "" {
lvl, err := logrus.ParseLevel(conf.LogLevel)
if err != nil {
return fmt.Errorf("unable to parse logging level: %s", conf.LogLevel)
}
logrus.SetLevel(lvl)
} else {
logrus.SetLevel(logrus.InfoLevel)
}
logrus.SetFormatter(&logrus.TextFormatter{
TimestampFormat: jsonmessage.RFC3339NanoFixed,
DisableColors: conf.RawLogs,
FullTimestamp: true,
})
return nil
}
20 changes: 19 additions & 1 deletion cmd/dockerd/daemon_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,7 +146,6 @@ func TestLoadDaemonCliConfigWithLogLevel(t *testing.T) {
assert.NilError(t, err)
assert.Assert(t, loadedConfig != nil)
assert.Check(t, is.Equal("warn", loadedConfig.LogLevel))
assert.Check(t, is.Equal(logrus.WarnLevel, logrus.GetLevel()))
}

func TestLoadDaemonConfigWithEmbeddedOptions(t *testing.T) {
Expand DownExpand Up@@ -180,3 +179,22 @@ func TestLoadDaemonConfigWithRegistryOptions(t *testing.T) {
assert.Check(t, is.Len(loadedConfig.Mirrors, 1))
assert.Check(t, is.Len(loadedConfig.InsecureRegistries, 1))
}

func TestConfigureDaemonLogs(t *testing.T) {
conf := &config.Config{}
err := configureDaemonLogs(conf)
assert.NilError(t, err)
assert.Check(t, is.Equal(logrus.InfoLevel, logrus.GetLevel()))

conf.LogLevel = "warn"
err = configureDaemonLogs(conf)
assert.NilError(t, err)
assert.Check(t, is.Equal(logrus.WarnLevel, logrus.GetLevel()))

conf.LogLevel = "foobar"
err = configureDaemonLogs(conf)
assert.Error(t, err, "unable to parse logging level: foobar")

// log level should not be changed after a failure
assert.Check(t, is.Equal(logrus.WarnLevel, logrus.GetLevel()))
}
7 changes: 7 additions & 0 deletions cmd/dockerd/docker.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ import (
"github.com/docker/docker/cli"
"github.com/docker/docker/daemon/config"
"github.com/docker/docker/dockerversion"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/docker/pkg/reexec"
"github.com/docker/docker/pkg/term"
"github.com/moby/buildkit/util/apicaps"
Expand DownExpand Up@@ -54,6 +55,12 @@ func main() {
return
}

// initial log formatting; this setting is updated after the daemon configuration is loaded.
logrus.SetFormatter(&logrus.TextFormatter{
TimestampFormat: jsonmessage.RFC3339NanoFixed,
FullTimestamp: true,
})

// Set terminal emulation based on platform as required.
_, stdout, stderr := term.StdStreams()

Expand Down
16 changes: 0 additions & 16 deletions cmd/dockerd/options.go
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
package main

import (
"fmt"
"os"
"path/filepath"

cliconfig "github.com/docker/docker/cli/config"
"github.com/docker/docker/daemon/config"
"github.com/docker/docker/opts"
"github.com/docker/go-connections/tlsconfig"
"github.com/sirupsen/logrus"
"github.com/spf13/pflag"
)

Expand DownExpand Up@@ -106,17 +104,3 @@ func (o *daemonOptions) SetDefaultOptions(flags *pflag.FlagSet) {
}
}
}

// setLogLevel sets the logrus logging level
func setLogLevel(logLevel string) {
if logLevel != "" {
lvl, err := logrus.ParseLevel(logLevel)
if err != nil {
fmt.Fprintf(os.Stderr, "Unable to parse logging level: %s\n", logLevel)
os.Exit(1)
}
logrus.SetLevel(lvl)
} else {
logrus.SetLevel(logrus.InfoLevel)
}
}
11 changes: 1 addition & 10 deletions daemon/checkpoint.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,6 @@ package daemon // import "github.com/docker/docker/daemon"

import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"os"
Expand DownExpand Up@@ -127,15 +126,7 @@ func (daemon *Daemon) CheckpointList(name string, config types.CheckpointListOpt
if !d.IsDir() {
continue
}
path := filepath.Join(checkpointDir, d.Name(), "config.json")
data, err := ioutil.ReadFile(path)
if err != nil {
return nil, err
}
var cpt types.Checkpoint
if err := json.Unmarshal(data, &cpt); err != nil {
return nil, err
}
cpt := types.Checkpoint{Name: d.Name()}
out = append(out, cpt)
}

Expand Down
3 changes: 3 additions & 0 deletions daemon/config/config.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -229,6 +229,9 @@ type CommonConfig struct {
Features map[string]bool `json:"features,omitempty"`

Builder BuilderConfig `json:"builder,omitempty"`

ContainerdNamespace string `json:"containerd-namespace,omitempty"`
ContainerdPluginNamespace string `json:"containerd-plugin-namespace,omitempty"`
}

// IsValueSet returns true if a configuration value
Expand Down
2 changes: 1 addition & 1 deletion daemon/container_operations.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -813,7 +813,7 @@ func (daemon *Daemon) connectToNetwork(container *container.Container, idOrName
return nil
}

func updateJoinInfo(networkSettings *network.Settings, n libnetwork.Network, ep libnetwork.Endpoint) error { // nolint: interfacer
func updateJoinInfo(networkSettings *network.Settings, n libnetwork.Network, ep libnetwork.Endpoint) error {
if ep == nil {
return errors.New("invalid enppoint whhile building portmap info")
}
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
6d8fbac
Configure log-format earlier, and small refactor
thaJeztah Nov 24, 2018
1bda75e
migrated container wait integration tests from integration-cli to int…
adshmh Jul 23, 2018
5cde2dd
[18.09] integration/internal: add new test options
AkihiroSuda Oct 10, 2018
7985bd8
integration/container: add a base test for C/R
avagin Dec 29, 2018
4ac5dba
Fix CheckpointList
avagin Dec 29, 2018
9fa7f6c
Temporarily disable TestCheckpoint
thaJeztah Apr 1, 2019
9f02d3b
integration: change network.CreateNoError signature to fix linting
thaJeztah Jun 6, 2019
c82cbe9
integration: change container.Create signature to fix linting
thaJeztah Jun 6, 2019
85c5aab
integration: change container.Run signature to fix linting
thaJeztah Jun 6, 2019
2eb2aaf
integration: change createAmbiguousNetworks signature to fix linting
thaJeztah Jun 6, 2019
e91e9c3
integration: change testGraphDriver signature to fix linting
thaJeztah Jun 6, 2019
4005149
integration: get tests to compile again
Jun 12, 2019
e9bd47a
Revert "integration: have container.Create call compile"
thaJeztah Oct 8, 2019
4aae081
Revert "Fixing integration test"
thaJeztah Oct 8, 2019
a5620fc
TestServiceWithDefaultAddressPoolInit
selansen Sep 13, 2018
93de6ed
Add TC to check dyanmic subnet for ingress network
Sep 20, 2019
8c60be3
integration-cli/build: don't panic
kolyshkin Dec 21, 2018
e42b14a
*: remove interfacer linter from CI
cyphar Mar 12, 2019
5c1aea7
integration-cli: don't build -test images if they already exist
cyphar Mar 12, 2019
6cc5e98
internal: test/env: switch to assert.TestingT
cyphar Mar 12, 2019
266674a
Integration: remove unneeded platform check for IPVLAN tests
thaJeztah Jun 28, 2019
989a8a6
Integration: IPVlan add missing import comment
thaJeztah Jun 28, 2019
4ecaa08
Integration: exclude IPVlan test-suite on Windows
thaJeztah Jul 11, 2019
bd195d0
Integration: remove redundant kernel version check for MACVlan
thaJeztah Jun 28, 2019
e5493c4
Integration: MACVlan add missing import comment and build-tag
thaJeztah Jun 28, 2019
3ca37e6
integration-cli: remove ExecSupport check
thaJeztah Jul 8, 2019
0a071f7
integration-cli: remove defaultSleepImage constant
thaJeztah Jul 8, 2019
9fc8134
integration-cli: remove unused requirements utils
thaJeztah Jul 8, 2019
4fb6f3f
Add containerd.WithTimeout(60*time.Second) to match old calls
Aug 22, 2018
cbd8227
Add (hidden) flags to set containerd namespaces
cpuguy83 Jul 11, 2019
34024ad
integration: fix cleanup of raft data
thaJeztah Jul 12, 2019
0f2b3f6
Optimize test daemon startup
cpuguy83 Apr 17, 2019
0ba4e3e
Add log entries for daemon startup/shutdown
cpuguy83 Apr 19, 2019
b773f3c
Improve select for daemon restart tests
crosbymichael Jul 2, 2019
81966d1
Don't log test initial test daemon ping failures
cpuguy83 Jul 12, 2019
7fb18ca
Fix Microsecond -> Milisecond.
cpuguy83 Jul 13, 2019
943bb6a
DockerSwarmSuite lock portIndex to work around race
thaJeztah Jul 13, 2019
bc63fef
Be more conservative for Windows in TestFrequency for Splunk
ddebroy Jul 17, 2019
743c961
Testing: create new daemon (only) if needed
thaJeztah Dec 24, 2018
72c8a91
integration: run build session tests on non-experimental
thaJeztah Jul 17, 2019
99725d6
integration-cli: increase healthcheck timeout
tonistiigi Jul 18, 2019
5905728
Retry service updates on out of sequence errors
dperny Jul 18, 2019
147c94d
integration-cli: remove redundant "testrequires"
thaJeztah Jul 19, 2019
48bfa1d
Add `FromClient` to test env execution
cpuguy83 Jul 24, 2019
03c4cf7
Better logging for swarm tests
cpuguy83 Jul 24, 2019
e1dc7f1
hack: Remove inContainer check, it wasn't useful
seemethere Jul 24, 2019
0de5218
Fix flaky TestServiceWithDefaultAddressPoolInit
Aug 5, 2019
8c69826
Move defer method to the top right after New is called
Aug 15, 2019
eed1ea0
Windows:Disable 2 restart test when Hyper-V
Feb 22, 2019
033474e
integration-cli/requirements: Skip windows specific isolation require…
Snorch Aug 7, 2019
baae46a
Dockerfile: update CRIU to v3.12
thaJeztah Aug 14, 2019
47c2af9
pkg/term: refactor TestEscapeProxyRead
thaJeztah Aug 27, 2019
81f3399
integration: windows.ps1: turn defender error into a warning
thaJeztah Aug 27, 2019
63c9022
LCOW: Log stderr on failures
Mar 8, 2018
fa1a38d
TestDispatch: refactor to use subtests again, and fix linting (struct…
thaJeztah Aug 27, 2019
27e9144
integration-cli: getContainerCount() fix trimming prefix
thaJeztah Aug 28, 2019
6e6c1ac
Fix docker inspect for dutimgVersion
StefanScherer Aug 30, 2019
b5a2940
integration-cli: fix some bashism's in Dockerfiles
thaJeztah Sep 2, 2019
d01572e
TestBuildSquashParent: fix non-standard comparisson
thaJeztah Sep 2, 2019
0f8e14d
hack/make/binary-daemon: fix some linting issues
thaJeztah Aug 31, 2019
49afe72
TestCase: use `icmd.RunCmd` instead `icmd.StartCmd`
tao12345666333 Sep 2, 2019
bec7a85
hack/ci/windows.ps1: explicitly set exit code to result of tests
thaJeztah Sep 2, 2019
5ed27d1
hack/ci/windows.ps1 print all environment variables to check how Jenk…
thaJeztah Sep 6, 2019
69ee162
integration-cli: update TestCreateWithWorkdir for Hyper-V isolation
thaJeztah Sep 4, 2019
65dc979
hack/ci/windows.ps1: add support for DOCKER_STORAGE_OPTS
thaJeztah Sep 4, 2019
2cf0f0a
hack/ci/windows.ps1: stop tailing logs after stopping the daemon
thaJeztah Sep 6, 2019
ef77905
Fix Service TTY test so signal handlers work
cpuguy83 Sep 9, 2019
9544f87
integration-cli: swarm.RestartNode(); don't load busybox again
thaJeztah Sep 9, 2019
9bc5695
integration-cli: add daemon.StartNodeWithBusybox function
thaJeztah Sep 9, 2019
6e1a428
Windows: skip flaky TestLogBlocking
thaJeztah Sep 9, 2019
d236d18
awslogs: fix flaky TestLogBlocking unit test
samuelkarp Sep 20, 2019
a6d21bd
Fix more signal handling issues in tests.
cpuguy83 Sep 9, 2019
d88eaeb
Disable TestPsListContainersFilterExited (Windows)
Sep 17, 2019
b739525
integration-cli: run goimports
Sep 19, 2019
5766d99
[18.09] change c.Skip() to testRequires()
thaJeztah Oct 8, 2019
c3bc5d2
hack/test/unit: fix custom TESTFLAGS not working
thaJeztah Sep 13, 2019
9826c3e
[18.09] TEMPORARILY DISABLE FLAKY TEST CHECK
thaJeztah Oct 23, 2019
d4a5e65
TESTING: SKIP TestSwarmVolumePlugin
thaJeztah Oct 24, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Dockerfile
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,7 +36,7 @@ RUN sed -ri "s/(httpredir|deb).debian.org/${APT_MIRROR:-deb.debian.org}/g" /etc/
FROM base AS criu
ARG DEBIAN_FRONTEND
# Install CRIU for checkpoint/restore support
ENV CRIU_VERSION 3.6
ENV CRIU_VERSION 3.12
# Install dependency packages specific to criu
RUN apt-get update && apt-get install -y --no-install-recommends \
libnet-dev \
Expand DownExpand Up@@ -251,6 +251,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
zip \
bzip2 \
xz-utils \
libprotobuf-c1 \
libnet1 \
libnl-3-200 \
&& rm -rf /var/lib/apt/lists/*

RUN pip3 install yamllint==1.16.0
Expand Down
80 changes: 38 additions & 42 deletions builder/dockerfile/evaluator_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,7 @@ package dockerfile // import "github.com/docker/docker/builder/dockerfile"

import (
"os"
"runtime"
"testing"

"github.com/docker/docker/builder/remotecontext"
Expand All@@ -23,8 +24,11 @@ func init() {
reexec.Init()
}

func initDispatchTestCases() []dispatchTestCase {
dispatchTestCases := []dispatchTestCase{
func TestDispatch(t *testing.T) {
if runtime.GOOS != "windows" {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
}
testCases := []dispatchTestCase{
{
name: "ADD multiple files to file",
cmd: &instructions.AddCommand{SourcesAndDest: instructions.SourcesAndDest{
Expand DownExpand Up@@ -91,54 +95,46 @@ func initDispatchTestCases() []dispatchTestCase {
}},
expectedError: "source can't be a URL for COPY",
files: nil,
}}

return dispatchTestCases
}

func TestDispatch(t *testing.T) {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
testCases := initDispatchTestCases()

for _, testCase := range testCases {
executeTestCase(t, testCase)
},
}
}

func executeTestCase(t *testing.T, testCase dispatchTestCase) {
contextDir, cleanup := createTestTempDir(t, "", "builder-dockerfile-test")
defer cleanup()
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
contextDir, cleanup := createTestTempDir(t, "", "builder-dockerfile-test")
defer cleanup()

for filename, content := range testCase.files {
createTestTempFile(t, contextDir, filename, content, 0777)
}
for filename, content := range tc.files {
createTestTempFile(t, contextDir, filename, content, 0777)
}

tarStream, err := archive.Tar(contextDir, archive.Uncompressed)
tarStream, err := archive.Tar(contextDir, archive.Uncompressed)

if err != nil {
t.Fatalf("Error when creating tar stream: %s", err)
}
if err != nil {
t.Fatalf("Error when creating tar stream: %s", err)
}

defer func() {
if err = tarStream.Close(); err != nil {
t.Fatalf("Error when closing tar stream: %s", err)
}
}()
defer func() {
if err = tarStream.Close(); err != nil {
t.Fatalf("Error when closing tar stream: %s", err)
}
}()

context, err := remotecontext.FromArchive(tarStream)
context, err := remotecontext.FromArchive(tarStream)

if err != nil {
t.Fatalf("Error when creating tar context: %s", err)
}
if err != nil {
t.Fatalf("Error when creating tar context: %s", err)
}

defer func() {
if err = context.Close(); err != nil {
t.Fatalf("Error when closing tar context: %s", err)
}
}()
defer func() {
if err = context.Close(); err != nil {
t.Fatalf("Error when closing tar context: %s", err)
}
}()

b := newBuilderWithMockBackend()
sb := newDispatchRequest(b, '`', context, NewBuildArgs(make(map[string]*string)), newStagesBuildResults())
err = dispatch(sb, testCase.cmd)
assert.Check(t, is.ErrorContains(err, testCase.expectedError))
b := newBuilderWithMockBackend()
sb := newDispatchRequest(b, '`', context, NewBuildArgs(make(map[string]*string)), newStagesBuildResults())
err = dispatch(sb, tc.cmd)
assert.Check(t, is.ErrorContains(err, tc.expectedError))
})
}
}
9 changes: 7 additions & 2 deletions builder/dockerfile/internals_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -47,6 +47,9 @@ func TestDockerfileOutsideTheBuildContext(t *testing.T) {
defer cleanup()

expectedError := "Forbidden path outside the build context: ../../Dockerfile ()"
if runtime.GOOS == "windows" {
expectedError = "failed to resolve scoped path ../../Dockerfile ()"
}

readAndCheckDockerfile(t, "DockerfileOutsideTheBuildContext", contextDir, "../../Dockerfile", expectedError)
}
Expand All@@ -61,7 +64,9 @@ func TestNonExistingDockerfile(t *testing.T) {
}

func readAndCheckDockerfile(t *testing.T, testName, contextDir, dockerfilePath, expectedError string) {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
if runtime.GOOS != "windows" {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
}
tarStream, err := archive.Tar(contextDir, archive.Uncompressed)
assert.NilError(t, err)

Expand All@@ -80,7 +85,7 @@ func readAndCheckDockerfile(t *testing.T, testName, contextDir, dockerfilePath,
Source: tarStream,
}
_, _, err = remotecontext.Detect(config)
assert.Check(t, is.Error(err, expectedError))
assert.Check(t, is.ErrorContains(err, expectedError))
}

func TestCopyRunConfig(t *testing.T) {
Expand Down
9 changes: 9 additions & 0 deletions cmd/dockerd/config.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,8 +3,10 @@ package main
import (
"runtime"

"github.com/docker/docker/daemon"
"github.com/docker/docker/daemon/config"
"github.com/docker/docker/opts"
"github.com/docker/docker/plugin/executor/containerd"
"github.com/docker/docker/registry"
"github.com/spf13/pflag"
)
Expand DownExpand Up@@ -80,6 +82,13 @@ func installCommonConfigFlags(conf *config.Config, flags *pflag.FlagSet) {

conf.MaxConcurrentDownloads = &maxConcurrentDownloads
conf.MaxConcurrentUploads = &maxConcurrentUploads

flags.StringVar(&conf.ContainerdNamespace, "containerd-namespace", daemon.ContainersNamespace, "Containerd namespace to use")
if err := flags.MarkHidden("containerd-namespace"); err != nil {
return
}
flags.StringVar(&conf.ContainerdPluginNamespace, "containerd-plugins-namespace", containerd.PluginNamespace, "Containerd namespace to use for plugins")
flags.MarkHidden("containerd-plugins-namespace")
}

func installRegistryServiceFlags(options *registry.ServiceOptions, flags *pflag.FlagSet) {
Expand Down
36 changes: 27 additions & 9 deletions cmd/dockerd/daemon.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -83,6 +83,13 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
if cli.Config, err = loadDaemonCliConfig(opts); err != nil {
return err
}

if err := configureDaemonLogs(cli.Config); err != nil {
return err
}

logrus.Info("Starting up")

cli.configFile = &opts.configFile
cli.flags = opts.flags

Expand All@@ -94,12 +101,6 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
logrus.Warn("Running experimental build")
}

logrus.SetFormatter(&logrus.TextFormatter{
TimestampFormat: jsonmessage.RFC3339NanoFixed,
DisableColors: cli.Config.RawLogs,
FullTimestamp: true,
})

system.InitLCOW(cli.Config.Experimental)

if err := setDefaultUmask(); err != nil {
Expand DownExpand Up@@ -249,6 +250,7 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
return fmt.Errorf("Shutting down due to ServeAPI error: %v", errAPI)
}

logrus.Info("Daemon shutdown complete")
return nil
}

Expand DownExpand Up@@ -471,9 +473,6 @@ func loadDaemonCliConfig(opts *daemonOptions) (*config.Config, error) {
conf.TLS = true
}

// ensure that the log level is the one set after merging configurations
setLogLevel(conf.LogLevel)

return conf, nil
}

Expand DownExpand Up@@ -670,3 +669,22 @@ func systemContainerdRunning() bool {
_, err := os.Lstat(containerddefaults.DefaultAddress)
return err == nil
}

// configureDaemonLogs sets the logrus logging level and formatting
func configureDaemonLogs(conf *config.Config) error {
if conf.LogLevel != "" {
lvl, err := logrus.ParseLevel(conf.LogLevel)
if err != nil {
return fmt.Errorf("unable to parse logging level: %s", conf.LogLevel)
}
logrus.SetLevel(lvl)
} else {
logrus.SetLevel(logrus.InfoLevel)
}
logrus.SetFormatter(&logrus.TextFormatter{
TimestampFormat: jsonmessage.RFC3339NanoFixed,
DisableColors: conf.RawLogs,
FullTimestamp: true,
})
return nil
}
20 changes: 19 additions & 1 deletion cmd/dockerd/daemon_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,7 +146,6 @@ func TestLoadDaemonCliConfigWithLogLevel(t *testing.T) {
assert.NilError(t, err)
assert.Assert(t, loadedConfig != nil)
assert.Check(t, is.Equal("warn", loadedConfig.LogLevel))
assert.Check(t, is.Equal(logrus.WarnLevel, logrus.GetLevel()))
}

func TestLoadDaemonConfigWithEmbeddedOptions(t *testing.T) {
Expand DownExpand Up@@ -180,3 +179,22 @@ func TestLoadDaemonConfigWithRegistryOptions(t *testing.T) {
assert.Check(t, is.Len(loadedConfig.Mirrors, 1))
assert.Check(t, is.Len(loadedConfig.InsecureRegistries, 1))
}

func TestConfigureDaemonLogs(t *testing.T) {
conf := &config.Config{}
err := configureDaemonLogs(conf)
assert.NilError(t, err)
assert.Check(t, is.Equal(logrus.InfoLevel, logrus.GetLevel()))

conf.LogLevel = "warn"
err = configureDaemonLogs(conf)
assert.NilError(t, err)
assert.Check(t, is.Equal(logrus.WarnLevel, logrus.GetLevel()))

conf.LogLevel = "foobar"
err = configureDaemonLogs(conf)
assert.Error(t, err, "unable to parse logging level: foobar")

// log level should not be changed after a failure
assert.Check(t, is.Equal(logrus.WarnLevel, logrus.GetLevel()))
}
7 changes: 7 additions & 0 deletions cmd/dockerd/docker.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ import (
"github.com/docker/docker/cli"
"github.com/docker/docker/daemon/config"
"github.com/docker/docker/dockerversion"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/docker/pkg/reexec"
"github.com/docker/docker/pkg/term"
"github.com/moby/buildkit/util/apicaps"
Expand DownExpand Up@@ -54,6 +55,12 @@ func main() {
return
}

// initial log formatting; this setting is updated after the daemon configuration is loaded.
logrus.SetFormatter(&logrus.TextFormatter{
TimestampFormat: jsonmessage.RFC3339NanoFixed,
FullTimestamp: true,
})

// Set terminal emulation based on platform as required.
_, stdout, stderr := term.StdStreams()

Expand Down
16 changes: 0 additions & 16 deletions cmd/dockerd/options.go
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
package main

import (
"fmt"
"os"
"path/filepath"

cliconfig "github.com/docker/docker/cli/config"
"github.com/docker/docker/daemon/config"
"github.com/docker/docker/opts"
"github.com/docker/go-connections/tlsconfig"
"github.com/sirupsen/logrus"
"github.com/spf13/pflag"
)

Expand DownExpand Up@@ -106,17 +104,3 @@ func (o *daemonOptions) SetDefaultOptions(flags *pflag.FlagSet) {
}
}
}

// setLogLevel sets the logrus logging level
func setLogLevel(logLevel string) {
if logLevel != "" {
lvl, err := logrus.ParseLevel(logLevel)
if err != nil {
fmt.Fprintf(os.Stderr, "Unable to parse logging level: %s\n", logLevel)
os.Exit(1)
}
logrus.SetLevel(lvl)
} else {
logrus.SetLevel(logrus.InfoLevel)
}
}
11 changes: 1 addition & 10 deletions daemon/checkpoint.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,6 @@ package daemon // import "github.com/docker/docker/daemon"

import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"os"
Expand DownExpand Up@@ -127,15 +126,7 @@ func (daemon *Daemon) CheckpointList(name string, config types.CheckpointListOpt
if !d.IsDir() {
continue
}
path := filepath.Join(checkpointDir, d.Name(), "config.json")
data, err := ioutil.ReadFile(path)
if err != nil {
return nil, err
}
var cpt types.Checkpoint
if err := json.Unmarshal(data, &cpt); err != nil {
return nil, err
}
cpt := types.Checkpoint{Name: d.Name()}
out = append(out, cpt)
}

Expand Down
3 changes: 3 additions & 0 deletions daemon/config/config.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -229,6 +229,9 @@ type CommonConfig struct {
Features map[string]bool `json:"features,omitempty"`

Builder BuilderConfig `json:"builder,omitempty"`

ContainerdNamespace string `json:"containerd-namespace,omitempty"`
ContainerdPluginNamespace string `json:"containerd-plugin-namespace,omitempty"`
}

// IsValueSet returns true if a configuration value
Expand Down
2 changes: 1 addition & 1 deletion daemon/container_operations.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -813,7 +813,7 @@ func (daemon *Daemon) connectToNetwork(container *container.Container, idOrName
return nil
}

func updateJoinInfo(networkSettings *network.Settings, n libnetwork.Network, ep libnetwork.Endpoint) error { // nolint: interfacer
func updateJoinInfo(networkSettings *network.Settings, n libnetwork.Network, ep libnetwork.Endpoint) error {
if ep == nil {
return errors.New("invalid enppoint whhile building portmap info")
}
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
6d8fbac
Configure log-format earlier, and small refactor
thaJeztah Nov 24, 2018
1bda75e
migrated container wait integration tests from integration-cli to int…
adshmh Jul 23, 2018
5cde2dd
[18.09] integration/internal: add new test options
AkihiroSuda Oct 10, 2018
7985bd8
integration/container: add a base test for C/R
avagin Dec 29, 2018
4ac5dba
Fix CheckpointList
avagin Dec 29, 2018
9fa7f6c
Temporarily disable TestCheckpoint
thaJeztah Apr 1, 2019
9f02d3b
integration: change network.CreateNoError signature to fix linting
thaJeztah Jun 6, 2019
c82cbe9
integration: change container.Create signature to fix linting
thaJeztah Jun 6, 2019
85c5aab
integration: change container.Run signature to fix linting
thaJeztah Jun 6, 2019
2eb2aaf
integration: change createAmbiguousNetworks signature to fix linting
thaJeztah Jun 6, 2019
e91e9c3
integration: change testGraphDriver signature to fix linting
thaJeztah Jun 6, 2019
4005149
integration: get tests to compile again
Jun 12, 2019
e9bd47a
Revert "integration: have container.Create call compile"
thaJeztah Oct 8, 2019
4aae081
Revert "Fixing integration test"
thaJeztah Oct 8, 2019
a5620fc
TestServiceWithDefaultAddressPoolInit
selansen Sep 13, 2018
93de6ed
Add TC to check dyanmic subnet for ingress network
Sep 20, 2019
8c60be3
integration-cli/build: don't panic
kolyshkin Dec 21, 2018
e42b14a
*: remove interfacer linter from CI
cyphar Mar 12, 2019
5c1aea7
integration-cli: don't build -test images if they already exist
cyphar Mar 12, 2019
6cc5e98
internal: test/env: switch to assert.TestingT
cyphar Mar 12, 2019
266674a
Integration: remove unneeded platform check for IPVLAN tests
thaJeztah Jun 28, 2019
989a8a6
Integration: IPVlan add missing import comment
thaJeztah Jun 28, 2019
4ecaa08
Integration: exclude IPVlan test-suite on Windows
thaJeztah Jul 11, 2019
bd195d0
Integration: remove redundant kernel version check for MACVlan
thaJeztah Jun 28, 2019
e5493c4
Integration: MACVlan add missing import comment and build-tag
thaJeztah Jun 28, 2019
3ca37e6
integration-cli: remove ExecSupport check
thaJeztah Jul 8, 2019
0a071f7
integration-cli: remove defaultSleepImage constant
thaJeztah Jul 8, 2019
9fc8134
integration-cli: remove unused requirements utils
thaJeztah Jul 8, 2019
4fb6f3f
Add containerd.WithTimeout(60*time.Second) to match old calls
Aug 22, 2018
cbd8227
Add (hidden) flags to set containerd namespaces
cpuguy83 Jul 11, 2019
34024ad
integration: fix cleanup of raft data
thaJeztah Jul 12, 2019
0f2b3f6
Optimize test daemon startup
cpuguy83 Apr 17, 2019
0ba4e3e
Add log entries for daemon startup/shutdown
cpuguy83 Apr 19, 2019
b773f3c
Improve select for daemon restart tests
crosbymichael Jul 2, 2019
81966d1
Don't log test initial test daemon ping failures
cpuguy83 Jul 12, 2019
7fb18ca
Fix Microsecond -> Milisecond.
cpuguy83 Jul 13, 2019
943bb6a
DockerSwarmSuite lock portIndex to work around race
thaJeztah Jul 13, 2019
bc63fef
Be more conservative for Windows in TestFrequency for Splunk
ddebroy Jul 17, 2019
743c961
Testing: create new daemon (only) if needed
thaJeztah Dec 24, 2018
72c8a91
integration: run build session tests on non-experimental
thaJeztah Jul 17, 2019
99725d6
integration-cli: increase healthcheck timeout
tonistiigi Jul 18, 2019
5905728
Retry service updates on out of sequence errors
dperny Jul 18, 2019
147c94d
integration-cli: remove redundant "testrequires"
thaJeztah Jul 19, 2019
48bfa1d
Add `FromClient` to test env execution
cpuguy83 Jul 24, 2019
03c4cf7
Better logging for swarm tests
cpuguy83 Jul 24, 2019
e1dc7f1
hack: Remove inContainer check, it wasn't useful
seemethere Jul 24, 2019
0de5218
Fix flaky TestServiceWithDefaultAddressPoolInit
Aug 5, 2019
8c69826
Move defer method to the top right after New is called
Aug 15, 2019
eed1ea0
Windows:Disable 2 restart test when Hyper-V
Feb 22, 2019
033474e
integration-cli/requirements: Skip windows specific isolation require…
Snorch Aug 7, 2019
baae46a
Dockerfile: update CRIU to v3.12
thaJeztah Aug 14, 2019
47c2af9
pkg/term: refactor TestEscapeProxyRead
thaJeztah Aug 27, 2019
81f3399
integration: windows.ps1: turn defender error into a warning
thaJeztah Aug 27, 2019
63c9022
LCOW: Log stderr on failures
Mar 8, 2018
fa1a38d
TestDispatch: refactor to use subtests again, and fix linting (struct…
thaJeztah Aug 27, 2019
27e9144
integration-cli: getContainerCount() fix trimming prefix
thaJeztah Aug 28, 2019
6e6c1ac
Fix docker inspect for dutimgVersion
StefanScherer Aug 30, 2019
b5a2940
integration-cli: fix some bashism's in Dockerfiles
thaJeztah Sep 2, 2019
d01572e
TestBuildSquashParent: fix non-standard comparisson
thaJeztah Sep 2, 2019
0f8e14d
hack/make/binary-daemon: fix some linting issues
thaJeztah Aug 31, 2019
49afe72
TestCase: use `icmd.RunCmd` instead `icmd.StartCmd`
tao12345666333 Sep 2, 2019
bec7a85
hack/ci/windows.ps1: explicitly set exit code to result of tests
thaJeztah Sep 2, 2019
5ed27d1
hack/ci/windows.ps1 print all environment variables to check how Jenk…
thaJeztah Sep 6, 2019
69ee162
integration-cli: update TestCreateWithWorkdir for Hyper-V isolation
thaJeztah Sep 4, 2019
65dc979
hack/ci/windows.ps1: add support for DOCKER_STORAGE_OPTS
thaJeztah Sep 4, 2019
2cf0f0a
hack/ci/windows.ps1: stop tailing logs after stopping the daemon
thaJeztah Sep 6, 2019
ef77905
Fix Service TTY test so signal handlers work
cpuguy83 Sep 9, 2019
9544f87
integration-cli: swarm.RestartNode(); don't load busybox again
thaJeztah Sep 9, 2019
9bc5695
integration-cli: add daemon.StartNodeWithBusybox function
thaJeztah Sep 9, 2019
6e1a428
Windows: skip flaky TestLogBlocking
thaJeztah Sep 9, 2019
d236d18
awslogs: fix flaky TestLogBlocking unit test
samuelkarp Sep 20, 2019
a6d21bd
Fix more signal handling issues in tests.
cpuguy83 Sep 9, 2019
d88eaeb
Disable TestPsListContainersFilterExited (Windows)
Sep 17, 2019
b739525
integration-cli: run goimports
Sep 19, 2019
5766d99
[18.09] change c.Skip() to testRequires()
thaJeztah Oct 8, 2019
c3bc5d2
hack/test/unit: fix custom TESTFLAGS not working
thaJeztah Sep 13, 2019
9826c3e
[18.09] TEMPORARILY DISABLE FLAKY TEST CHECK
thaJeztah Oct 23, 2019
d4a5e65
TESTING: SKIP TestSwarmVolumePlugin
thaJeztah Oct 24, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Dockerfile
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,7 +36,7 @@ RUN sed -ri "s/(httpredir|deb).debian.org/${APT_MIRROR:-deb.debian.org}/g" /etc/
FROM base AS criu
ARG DEBIAN_FRONTEND
# Install CRIU for checkpoint/restore support
ENV CRIU_VERSION 3.6
ENV CRIU_VERSION 3.12
# Install dependency packages specific to criu
RUN apt-get update && apt-get install -y --no-install-recommends \
libnet-dev \
Expand DownExpand Up@@ -251,6 +251,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
zip \
bzip2 \
xz-utils \
libprotobuf-c1 \
libnet1 \
libnl-3-200 \
&& rm -rf /var/lib/apt/lists/*

RUN pip3 install yamllint==1.16.0
Expand Down
80 changes: 38 additions & 42 deletions builder/dockerfile/evaluator_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,7 @@ package dockerfile // import "github.com/docker/docker/builder/dockerfile"

import (
"os"
"runtime"
"testing"

"github.com/docker/docker/builder/remotecontext"
Expand All@@ -23,8 +24,11 @@ func init() {
reexec.Init()
}

func initDispatchTestCases() []dispatchTestCase {
dispatchTestCases := []dispatchTestCase{
func TestDispatch(t *testing.T) {
if runtime.GOOS != "windows" {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
}
testCases := []dispatchTestCase{
{
name: "ADD multiple files to file",
cmd: &instructions.AddCommand{SourcesAndDest: instructions.SourcesAndDest{
Expand DownExpand Up@@ -91,54 +95,46 @@ func initDispatchTestCases() []dispatchTestCase {
}},
expectedError: "source can't be a URL for COPY",
files: nil,
}}

return dispatchTestCases
}

func TestDispatch(t *testing.T) {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
testCases := initDispatchTestCases()

for _, testCase := range testCases {
executeTestCase(t, testCase)
},
}
}

func executeTestCase(t *testing.T, testCase dispatchTestCase) {
contextDir, cleanup := createTestTempDir(t, "", "builder-dockerfile-test")
defer cleanup()
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
contextDir, cleanup := createTestTempDir(t, "", "builder-dockerfile-test")
defer cleanup()

for filename, content := range testCase.files {
createTestTempFile(t, contextDir, filename, content, 0777)
}
for filename, content := range tc.files {
createTestTempFile(t, contextDir, filename, content, 0777)
}

tarStream, err := archive.Tar(contextDir, archive.Uncompressed)
tarStream, err := archive.Tar(contextDir, archive.Uncompressed)

if err != nil {
t.Fatalf("Error when creating tar stream: %s", err)
}
if err != nil {
t.Fatalf("Error when creating tar stream: %s", err)
}

defer func() {
if err = tarStream.Close(); err != nil {
t.Fatalf("Error when closing tar stream: %s", err)
}
}()
defer func() {
if err = tarStream.Close(); err != nil {
t.Fatalf("Error when closing tar stream: %s", err)
}
}()

context, err := remotecontext.FromArchive(tarStream)
context, err := remotecontext.FromArchive(tarStream)

if err != nil {
t.Fatalf("Error when creating tar context: %s", err)
}
if err != nil {
t.Fatalf("Error when creating tar context: %s", err)
}

defer func() {
if err = context.Close(); err != nil {
t.Fatalf("Error when closing tar context: %s", err)
}
}()
defer func() {
if err = context.Close(); err != nil {
t.Fatalf("Error when closing tar context: %s", err)
}
}()

b := newBuilderWithMockBackend()
sb := newDispatchRequest(b, '`', context, NewBuildArgs(make(map[string]*string)), newStagesBuildResults())
err = dispatch(sb, testCase.cmd)
assert.Check(t, is.ErrorContains(err, testCase.expectedError))
b := newBuilderWithMockBackend()
sb := newDispatchRequest(b, '`', context, NewBuildArgs(make(map[string]*string)), newStagesBuildResults())
err = dispatch(sb, tc.cmd)
assert.Check(t, is.ErrorContains(err, tc.expectedError))
})
}
}
9 changes: 7 additions & 2 deletions builder/dockerfile/internals_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -47,6 +47,9 @@ func TestDockerfileOutsideTheBuildContext(t *testing.T) {
defer cleanup()

expectedError := "Forbidden path outside the build context: ../../Dockerfile ()"
if runtime.GOOS == "windows" {
expectedError = "failed to resolve scoped path ../../Dockerfile ()"
}

readAndCheckDockerfile(t, "DockerfileOutsideTheBuildContext", contextDir, "../../Dockerfile", expectedError)
}
Expand All@@ -61,7 +64,9 @@ func TestNonExistingDockerfile(t *testing.T) {
}

func readAndCheckDockerfile(t *testing.T, testName, contextDir, dockerfilePath, expectedError string) {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
if runtime.GOOS != "windows" {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
}
tarStream, err := archive.Tar(contextDir, archive.Uncompressed)
assert.NilError(t, err)

Expand All@@ -80,7 +85,7 @@ func readAndCheckDockerfile(t *testing.T, testName, contextDir, dockerfilePath,
Source: tarStream,
}
_, _, err = remotecontext.Detect(config)
assert.Check(t, is.Error(err, expectedError))
assert.Check(t, is.ErrorContains(err, expectedError))
}

func TestCopyRunConfig(t *testing.T) {
Expand Down
9 changes: 9 additions & 0 deletions cmd/dockerd/config.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,8 +3,10 @@ package main
import (
"runtime"

"github.com/docker/docker/daemon"
"github.com/docker/docker/daemon/config"
"github.com/docker/docker/opts"
"github.com/docker/docker/plugin/executor/containerd"
"github.com/docker/docker/registry"
"github.com/spf13/pflag"
)
Expand DownExpand Up@@ -80,6 +82,13 @@ func installCommonConfigFlags(conf *config.Config, flags *pflag.FlagSet) {

conf.MaxConcurrentDownloads = &maxConcurrentDownloads
conf.MaxConcurrentUploads = &maxConcurrentUploads

flags.StringVar(&conf.ContainerdNamespace, "containerd-namespace", daemon.ContainersNamespace, "Containerd namespace to use")
if err := flags.MarkHidden("containerd-namespace"); err != nil {
return
}
flags.StringVar(&conf.ContainerdPluginNamespace, "containerd-plugins-namespace", containerd.PluginNamespace, "Containerd namespace to use for plugins")
flags.MarkHidden("containerd-plugins-namespace")
}

func installRegistryServiceFlags(options *registry.ServiceOptions, flags *pflag.FlagSet) {
Expand Down
36 changes: 27 additions & 9 deletions cmd/dockerd/daemon.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -83,6 +83,13 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
if cli.Config, err = loadDaemonCliConfig(opts); err != nil {
return err
}

if err := configureDaemonLogs(cli.Config); err != nil {
return err
}

logrus.Info("Starting up")

cli.configFile = &opts.configFile
cli.flags = opts.flags

Expand All@@ -94,12 +101,6 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
logrus.Warn("Running experimental build")
}

logrus.SetFormatter(&logrus.TextFormatter{
TimestampFormat: jsonmessage.RFC3339NanoFixed,
DisableColors: cli.Config.RawLogs,
FullTimestamp: true,
})

system.InitLCOW(cli.Config.Experimental)

if err := setDefaultUmask(); err != nil {
Expand DownExpand Up@@ -249,6 +250,7 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
return fmt.Errorf("Shutting down due to ServeAPI error: %v", errAPI)
}

logrus.Info("Daemon shutdown complete")
return nil
}

Expand DownExpand Up@@ -471,9 +473,6 @@ func loadDaemonCliConfig(opts *daemonOptions) (*config.Config, error) {
conf.TLS = true
}

// ensure that the log level is the one set after merging configurations
setLogLevel(conf.LogLevel)

return conf, nil
}

Expand DownExpand Up@@ -670,3 +669,22 @@ func systemContainerdRunning() bool {
_, err := os.Lstat(containerddefaults.DefaultAddress)
return err == nil
}

// configureDaemonLogs sets the logrus logging level and formatting
func configureDaemonLogs(conf *config.Config) error {
if conf.LogLevel != "" {
lvl, err := logrus.ParseLevel(conf.LogLevel)
if err != nil {
return fmt.Errorf("unable to parse logging level: %s", conf.LogLevel)
}
logrus.SetLevel(lvl)
} else {
logrus.SetLevel(logrus.InfoLevel)
}
logrus.SetFormatter(&logrus.TextFormatter{
TimestampFormat: jsonmessage.RFC3339NanoFixed,
DisableColors: conf.RawLogs,
FullTimestamp: true,
})
return nil
}
20 changes: 19 additions & 1 deletion cmd/dockerd/daemon_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,7 +146,6 @@ func TestLoadDaemonCliConfigWithLogLevel(t *testing.T) {
assert.NilError(t, err)
assert.Assert(t, loadedConfig != nil)
assert.Check(t, is.Equal("warn", loadedConfig.LogLevel))
assert.Check(t, is.Equal(logrus.WarnLevel, logrus.GetLevel()))
}

func TestLoadDaemonConfigWithEmbeddedOptions(t *testing.T) {
Expand DownExpand Up@@ -180,3 +179,22 @@ func TestLoadDaemonConfigWithRegistryOptions(t *testing.T) {
assert.Check(t, is.Len(loadedConfig.Mirrors, 1))
assert.Check(t, is.Len(loadedConfig.InsecureRegistries, 1))
}

func TestConfigureDaemonLogs(t *testing.T) {
conf := &config.Config{}
err := configureDaemonLogs(conf)
assert.NilError(t, err)
assert.Check(t, is.Equal(logrus.InfoLevel, logrus.GetLevel()))

conf.LogLevel = "warn"
err = configureDaemonLogs(conf)
assert.NilError(t, err)
assert.Check(t, is.Equal(logrus.WarnLevel, logrus.GetLevel()))

conf.LogLevel = "foobar"
err = configureDaemonLogs(conf)
assert.Error(t, err, "unable to parse logging level: foobar")

// log level should not be changed after a failure
assert.Check(t, is.Equal(logrus.WarnLevel, logrus.GetLevel()))
}
7 changes: 7 additions & 0 deletions cmd/dockerd/docker.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ import (
"github.com/docker/docker/cli"
"github.com/docker/docker/daemon/config"
"github.com/docker/docker/dockerversion"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/docker/pkg/reexec"
"github.com/docker/docker/pkg/term"
"github.com/moby/buildkit/util/apicaps"
Expand DownExpand Up@@ -54,6 +55,12 @@ func main() {
return
}

// initial log formatting; this setting is updated after the daemon configuration is loaded.
logrus.SetFormatter(&logrus.TextFormatter{
TimestampFormat: jsonmessage.RFC3339NanoFixed,
FullTimestamp: true,
})

// Set terminal emulation based on platform as required.
_, stdout, stderr := term.StdStreams()

Expand Down
16 changes: 0 additions & 16 deletions cmd/dockerd/options.go
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
package main

import (
"fmt"
"os"
"path/filepath"

cliconfig "github.com/docker/docker/cli/config"
"github.com/docker/docker/daemon/config"
"github.com/docker/docker/opts"
"github.com/docker/go-connections/tlsconfig"
"github.com/sirupsen/logrus"
"github.com/spf13/pflag"
)

Expand DownExpand Up@@ -106,17 +104,3 @@ func (o *daemonOptions) SetDefaultOptions(flags *pflag.FlagSet) {
}
}
}

// setLogLevel sets the logrus logging level
func setLogLevel(logLevel string) {
if logLevel != "" {
lvl, err := logrus.ParseLevel(logLevel)
if err != nil {
fmt.Fprintf(os.Stderr, "Unable to parse logging level: %s\n", logLevel)
os.Exit(1)
}
logrus.SetLevel(lvl)
} else {
logrus.SetLevel(logrus.InfoLevel)
}
}
11 changes: 1 addition & 10 deletions daemon/checkpoint.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,6 @@ package daemon // import "github.com/docker/docker/daemon"

import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"os"
Expand DownExpand Up@@ -127,15 +126,7 @@ func (daemon *Daemon) CheckpointList(name string, config types.CheckpointListOpt
if !d.IsDir() {
continue
}
path := filepath.Join(checkpointDir, d.Name(), "config.json")
data, err := ioutil.ReadFile(path)
if err != nil {
return nil, err
}
var cpt types.Checkpoint
if err := json.Unmarshal(data, &cpt); err != nil {
return nil, err
}
cpt := types.Checkpoint{Name: d.Name()}
out = append(out, cpt)
}

Expand Down
3 changes: 3 additions & 0 deletions daemon/config/config.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -229,6 +229,9 @@ type CommonConfig struct {
Features map[string]bool `json:"features,omitempty"`

Builder BuilderConfig `json:"builder,omitempty"`

ContainerdNamespace string `json:"containerd-namespace,omitempty"`
ContainerdPluginNamespace string `json:"containerd-plugin-namespace,omitempty"`
}

// IsValueSet returns true if a configuration value
Expand Down
2 changes: 1 addition & 1 deletion daemon/container_operations.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -813,7 +813,7 @@ func (daemon *Daemon) connectToNetwork(container *container.Container, idOrName
return nil
}

func updateJoinInfo(networkSettings *network.Settings, n libnetwork.Network, ep libnetwork.Endpoint) error { // nolint: interfacer
func updateJoinInfo(networkSettings *network.Settings, n libnetwork.Network, ep libnetwork.Endpoint) error {
if ep == nil {
return errors.New("invalid enppoint whhile building portmap info")
}
Expand Down
Loading