Commit Graph

558 Commits

Author SHA1 Message Date
Nassim 'Nass' Eddequiouaq 3acf5d2e47 Revert unencryted storage warning prompt
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
2018-04-16 12:48:03 -07:00
Tibor Vass 6b31ea0f0d
Merge pull request #963 from thaJeztah/fix-stack-deploy-after-force
Fix stack deploy re-deploying service after --force
2018-04-13 13:06:40 -10:00
Silvin Lubecki 54f8ca6660 Fixed gometalinter errors on test files
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2018-04-10 16:03:56 +02:00
Bogdan Anton 9fa6bd4174 [docs] Fix typo in manifest command docs: updated `MANFEST` to `MANIFEST`.
Signed-off-by: Bogdan Anton <contact@bogdananton.ro>
2018-04-01 17:40:31 +03:00
Vincent Demeester eb4a4fe9b9
Merge pull request #965 from thaJeztah/fix-version-output
Fix docker version output alignment
2018-03-28 09:53:34 +02:00
Tonis Tiigi a1cbaa827b vendor: update moby to ed7b6428
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-03-27 14:11:29 -07:00
Sebastiaan van Stijn e6e47d95b5
Merge pull request #561 from tych0/deprecate-unencrypted-storage
Deprecate unencrypted storage
2018-03-27 14:52:03 +02:00
Sebastiaan van Stijn 236a84759a
Merge pull request #941 from dnephin/fix-compose-network-name
Fix compose network name
2018-03-26 23:41:44 +02:00
Daniel Nephin 0f1bb35342 Refactor build tests to re-use more code and not require root
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-03-26 14:27:52 -04:00
Sebastiaan van Stijn 48eb7a082d
Fix docker version output alignment
Use tabwriter to print the version output

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-03-26 17:59:20 +02:00
Vincent Demeester 4290df3958 print a big warning about cleartext passwords
Signed-off-by: Tycho Andersen <tycho@docker.com>
2018-03-26 16:18:32 +02:00
Sebastiaan van Stijn 76439457d2
Fix stack deploy re-deploying service after --force
When updating a service with the `--force` option, the `ForceUpdate`
property of the taskspec is incremented.

Stack deploy did not take this into account, and reset this
field to its default value (0), causing the service to be
re-deployed.

This patch copies the existing value before updating the service.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-03-26 15:24:28 +02:00
Sebastiaan van Stijn 27f66e39f4
Merge pull request #943 from silvin-lubecki/fix-kubernetes-published-service
Fix docker stack services command Port output
2018-03-26 12:50:07 +01:00
Silvin Lubecki 54bb5ffeca Fix Kubernetes duplication in version command when the server already exposes one Kubernetes component
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2018-03-23 15:52:25 +01:00
Sebastiaan van Stijn c0ffb9491c
Merge pull request #924 from vdemeester/trust-suite-tests
Add some content trust tests
2018-03-19 11:24:00 +01:00
Vincent Demeester 8b00c5cfd8
Add more content trust tests
Importing from moby's DockerTrustSuite tests.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-03-19 10:02:40 +01:00
Vincent Demeester 63ebcae382
Small content trust enhancement
- `replaceDockerfileForContentTrust` is only used when content trust is
  enabled, so remove the boolean.
- rename `isContentTrustEnabled` to `contentTrustEnabled`

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-03-14 17:55:19 +01:00
Silvin Lubecki b816bde6cc Fix docker stack services command on Port output when kubernetes service is a LoadBalancer or a NodePort
* added tests on Kubernetes service conversion to swarm service

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2018-03-14 11:33:42 +01:00
Victor Vieux 176aa4865c
Merge pull request #935 from n4ss/trust-out-of-experimental2
Move Docker Trust out of experimental
2018-03-13 16:59:50 -07:00
Daniel Nephin b4c108a385 Fix named network in compose file
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-03-12 15:15:27 -04:00
Nassim 'Nass' Eddequiouaq ac35e851e8 Move Docker Trust out of experimental
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
2018-03-09 13:29:14 -08:00
Nassim 'Nass' Eddequiouaq 8c3d0b93d6 Fix comment and misc code issues
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
2018-03-09 20:46:37 +01:00
Nassim 'Nass' Eddequiouaq c5554f811b Refactor trust view command into a --pretty flag on trust inspect
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
2018-03-09 19:12:11 +01:00
Daniel Nephin feae0e9756 Only read trust setting from options
Rename IsTrusted to ContentTrustEnabled

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-03-08 16:46:30 -05:00
Vincent Demeester 6e21829af4 Refactor content_trust cli/flags handling
Remove the global variable used. Allows easier unit testing.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-03-08 15:00:43 -05:00
Sebastiaan van Stijn 82f325ed81
Merge pull request #925 from dnephin/add-build-test-symlink
Add a build unit test for symlinked context
2018-03-08 18:52:43 +01:00
Daniel Nephin 00b803b2d8 Add a build unit test for symlinked context
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-03-07 13:04:33 -05:00
Vincent Demeester 0cf2e6353a
Fixes some unit tests to be able to run them on windows
Some of them are skipped for now (because the feature is not supported
or needs more work), some of them are fixed.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-03-07 18:18:13 +01:00
Daniel Nephin e15b208e96 Convert assert.Check(t, is.Error()) to assert.Error
git grep -l -P '^\s+assert\.Check\(t, is\.Error\(' | \
    xargs perl -pi -e 's/^(\s+assert\.)Check\(t, is\.Error\((.*)\)$/\1Error(t, \2/'

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-03-06 16:00:28 -05:00
Daniel Nephin f21276575f manual clean of asserts
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-03-06 15:49:00 -05:00
Daniel Nephin 078cbc9c4b Convert assert.Check with
git grep -l -P '^\s+assert\.Check\(t, ' | \
    xargs perl -pi -e 's/^(\s+assert)\.Check(\(t, (?!is).*(\.Execute\(|\.Set\(|\.Write\(|\.Close\(|\.Untar\(|\.WriteFile\(|Validate\().*\)$)/\1.NilError\2/'

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-03-06 15:43:53 -05:00
Daniel Nephin baf65a5502 Convert to assert.NilError
Using:

  git grep -l '^\s\+assert\.Check(t, err)$' | \
    xargs sed -i -e 's/^\(\s\+assert\)\.Check(t, err)$/\1.NilError(t, err)/'

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-03-06 15:27:34 -05:00
Daniel Nephin 0f11a310fd dont prompt for github creds in unit test
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-03-06 15:27:09 -05:00
Daniel Nephin 681c921528 Remove testutil
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-03-06 14:38:35 -05:00
Daniel Nephin 7c8b5708eb Don't set a default filename for ConfigFile
With a default filename tests will leave a file in the working directory
that is never cleaned up.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-03-06 13:32:50 -05:00
Sebastiaan van Stijn a0b19f0ec2
Merge pull request #879 from dnephin/update-assertions
Replace testify assertions with gotestyourself/assert
2018-03-06 17:19:51 +01:00
Daniel Nephin 5155cda716 Post migration fixes
Fix tests that failed when using cmp.Compare()
internal/test/testutil/assert
InDelta
Fix DeepEqual with kube metav1.Time
Convert some ErrorContains to assert

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-03-05 19:41:17 -05:00
Daniel Nephin 39c2ca57c1 Automated migration
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-03-05 19:41:17 -05:00
Daniel Nephin 93615dd967 Update some assertions.
and fix some tests

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-03-05 17:15:24 -05:00
Daniel Nephin cff874122c Use new APIClient interface
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-03-05 16:34:22 -05:00
Daniel Nephin 07cb69e9bc Add more container cp tests
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-02-27 16:38:02 -05:00
Sebastiaan van Stijn 2cc6ff131d
Merge pull request #139 from shhsu/v3_credhelper
Silent login: use credentials from cred store to login
2018-02-27 19:08:53 +01:00
Vincent Demeester a9c6c52dc0
Merge pull request #904 from vdemeester/fix-run-label-flag-behavior
Fix `--label` behavior on run
2018-02-27 19:07:24 +01:00
Vincent Demeester 31dc5c0a9a
Fix `--label` behavior on run
Commit 2b17f4c8a8 fixed the way empty labels
are taken into account (i.e. not interpolated from environment variable),
but it created a regression.

`ValidateLabel` functions doesn't allow empty label value, but it has
always been possible to pass an empty label via the cli (`docker run --label foo`).

This fixes that by not validating the label flag.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-02-27 12:14:07 +01:00
Silvin Lubecki 854aad8927 Print Stack API version in version command
* Resolve Stack API using Kubernetes discovering API
* Refactor Kubernetes flags parsing

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2018-02-26 01:16:49 +01:00
shhsu@microsoft.com 8883cd636a Silent login: if user did not provide -u and -p flag for login command but both username and password are retrieved in cred store, docker will automatically use the credentials found in the cred store to log in
Signed-off-by: shhsu@microsoft.com <shhsu@microsoft.com>
Signed-off-by: Peter Hsu <shhsu@microsoft.com>
Signed-off-by: shhsu <shhsu@microsoft.com>
Signed-off-by: Peter Hsu <shhsu@microsoft.com>
2018-02-22 09:14:51 -08:00
Sebastiaan van Stijn d11b5ccdfa
Add --template-driver option for secrets/configs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-02-21 23:22:32 +01:00
Daniel Nephin a160ad89c9
Merge pull request #894 from thaJeztah/update-moby
Bump moby to 0ede01237c9ab871f1b8db0364427407f3e46541
2018-02-21 13:15:58 -05:00
Sebastiaan van Stijn 60930d309c
Bump moby to 0ede01237c9ab871f1b8db0364427407f3e46541
Includes:

- [client] Remove duplicate NewClient functions
- Add API support for templated secrets and configs
- Adjust minimum API version for templated configs/secrets

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-02-21 18:48:42 +01:00
Vincent Demeester cf86a4d922
Simplify the marshaling of compose types.Config
- Add `Version` to `types.Config`
- Add a new `Services` types (that is just `[]ServiceConfig`) and add
  `MarshalYAML` method on it.
- Clean other top-level custom marshaling as `Services` is the only one
  required.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-02-21 18:47:10 +01:00
Daniel Nephin 939938b976
Merge pull request #891 from vdemeester/k8s-loader-make-sure-version
Make sure we marshall version too…
2018-02-21 11:45:14 -05:00
Vincent Demeester 9f9f1c8515
Make sure we marshall version too…
… otherwise the k8s controller might fail to parse the file as it will
think it's version 1.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-02-21 15:36:51 +01:00
Wataru Ishida 995006c164 Support SCTP port mapping
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-02-21 12:19:38 +09:00
Vincent Demeester 82a8085885
Merge pull request #886 from thaJeztah/dockerfile-outside-context
Allow Dockerfile from outside build-context
2018-02-20 19:56:16 +01:00
Vincent Demeester 1e8530bc34
Merge pull request #885 from thaJeztah/node-engine-version
Add Engine version to docker node ls
2018-02-20 18:45:36 +01:00
Sebastiaan van Stijn a1048523d2
Allow Dockerfile from outside build-context
Historically, the Dockerfile had to be insde the build-context, because it was
sent as part of the build-context.

3f6dc81e10
added support for passing the Dockerfile through stdin, in which case the
contents of the Dockerfile is injected into the build-context.

This patch uses the same mechanism for situations where the location of the
Dockerfile is passed, and its path is outside of the build-context.

Before this change:

    $ mkdir -p myproject/context myproject/dockerfiles && cd myproject
    $ echo "hello" > context/hello
    $ echo -e "FROM busybox\nCOPY /hello /\nRUN cat /hello" > dockerfiles/Dockerfile
    $ docker build --no-cache -f $PWD/dockerfiles/Dockerfile $PWD/context

    unable to prepare context: the Dockerfile (/Users/sebastiaan/projects/test/dockerfile-outside/myproject/dockerfiles/Dockerfile) must be within the build context

After this change:

    $ mkdir -p myproject/context myproject/dockerfiles && cd myproject
    $ echo "hello" > context/hello
    $ echo -e "FROM busybox\nCOPY /hello /\nRUN cat /hello" > dockerfiles/Dockerfile
    $ docker build --no-cache -f $PWD/dockerfiles/Dockerfile $PWD/context

    Sending build context to Docker daemon  2.607kB
    Step 1/3 : FROM busybox
     ---> 6ad733544a63
    Step 2/3 : COPY /hello /
     ---> 9a5ae1c7be9e
    Step 3/3 : RUN cat /hello
     ---> Running in 20dfef2d180f
    hello
    Removing intermediate container 20dfef2d180f
     ---> ce1748f91bb2
    Successfully built ce1748f91bb2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-02-20 16:50:49 +01:00
Silvin Lubecki 9b27e92903
Fix stack marshaling for Kubernetes
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-02-20 16:43:24 +01:00
Vincent Demeester f56265ae3e
Merge pull request #845 from vdemeester/stack-load-the-same
[compose] Share the compose loading code between swarm and k8s stack deploy
2018-02-19 15:28:40 +01:00
Vincent Demeester 8900d77a0b
Merge pull request #880 from vdemeester/container-list-unit-tests
Add unit tests to docker container ls
2018-02-19 11:42:10 +01:00
Vincent Demeester 581b8d9d72
Add unit tests to docker container ls
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-02-19 11:22:36 +01:00
Sebastiaan van Stijn e888dd711f
Add Engine version to docker node ls
This adds the Engine version to `docker node ls`, and `.EngineVersion` as a
template option.

With this patch applied:

    docker node ls
    ID                            HOSTNAME                STATUS              AVAILABILITY        MANAGER STATUS      ENGINE VERSION
    wp9231itoqsh4rqceojqo01vp *   linuxkit-025000000001   Ready               Active              Leader              18.01.0-ce

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-02-17 02:58:05 +01:00
Anusha Ragunathan f1e2030ce8 Set a non-zero timeout for HTTP client communication with plugin
backend.

Currently, the timeout is set to 0, which means no timeout. Set it to a
sane default timeout of 30 seconds.

Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
2018-02-16 12:00:58 -08:00
Arash Deshmeh 0a914da708 add tests to plugin create/remove/enable/disable commands. Part of work on #37
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-02-15 06:20:26 -05:00
Vincent Demeester 570ee9cb54
Share the compose loading code between swarm and k8s stack deploy
To ensure we are loading the composefile the same wether we are pointing
to swarm or kubernetes, we need to share the loading code between both.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-02-14 14:07:48 +01:00
Sungwon Han 34504d0a1e Clarify description of volume prune command
volume prune command removes only local volumes
not used by at least one container.

Signed-off-by: Sungwon Han <sungwon.han@navercorp.com>
2018-02-08 15:33:07 +09:00
Sebastiaan van Stijn 25e969c854
Merge pull request #569 from vdemeester/compose-multiple-version-mergo
Add support for multiple composefile when deploying
2018-02-06 00:41:43 -08:00
Sebastiaan van Stijn 9de1b162fa
Merge pull request #838 from vdemeester/fix-label-file-behavior
Fix `--label-file` weird behavior
2018-01-29 17:32:21 -08:00
Vincent Demeester 1872bd802c
Add support for multiple composefile when deploying
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-01-29 17:27:25 -08:00
Vincent Demeester 2b17f4c8a8
Fix `--label-file` weird behavior
`--label-file` has the exact same behavior as `--env-file`, meaning any
placeholder (i.e. a simple key, no `=` sign, no value), it will get the
value from the environment variable.

For `--label-file` it should just add an empty label.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-01-29 11:08:54 -08:00
Daniel Nephin a46fa0759d
Merge pull request #804 from thaJeztah/more-annotations
Annotate "stack" commands to be "swarm" and "kubernetes"
2018-01-26 15:12:09 -05:00
Silvin Lubecki 14fcadffb1 Using Flags instead of PersistentFlags, as Kubernetes flags seem not to be defined in the "persistent space".
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2018-01-24 09:17:08 -08:00
Sebastiaan van Stijn 93c36eb228
Annotate "stack" commands to be "swarm" and "kubernetes"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-01-22 15:44:47 -08:00
Vincent Demeester fbb9de2cfc
Merge pull request #780 from thaJeztah/fix-network-add
Fix --network-add adding duplicate networks
2018-01-22 14:45:58 -08:00
Sebastiaan van Stijn 44a1168ae5
Merge pull request #696 from mlaventure/attach-use-containerwait
attach: Use ContainerWait instead of Inspect
2018-01-20 23:55:16 +01:00
Vincent Demeester 2d29732f40
Mark docker-manifest command as experimental (cli)
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-01-18 13:19:33 -08:00
Vincent Demeester 11dfa23a5d
Merge pull request #138 from clnperez/manifest-cmd
Add manifest command
2018-01-18 22:15:49 +01:00
Daniel Nephin fab4762941
Merge pull request #581 from thaJeztah/better-port-range-printing
Improve presentation of published port ranges
2018-01-16 17:16:45 -05:00
Daniel Nephin 1620538c49
Merge pull request #755 from kolyshkin/wait
Show container wait error
2018-01-16 14:40:36 -05:00
Kir Kolyshkin 85ddaee5af container.waitExitOrRemoved(): add a test case
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-01-16 10:16:28 -08:00
Akim Demaille f83aa7b705 Remove: add missing eol when --force is passed
Signed-off-by: Akim Demaille <akim.demaille@docker.com>
2018-01-16 09:29:53 +01:00
Sebastiaan van Stijn d845b4d36a
golint: remove redundant ifs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-01-13 13:16:34 +01:00
Sebastiaan van Stijn a812995f98
Remove aliases for orchestrator
Prefer "strict" values for orchestrator, as it's
easier to add aliases (if we think it's needed) than
to remove them later.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-01-11 21:16:37 +01:00
Sebastiaan van Stijn e6ebaf55dd
Fix --network-add adding duplicate networks
When adding a network using `docker service update --network-add`,
the new network was added by _name_.

Existing entries in a service spec are listed by network ID, which
resulted in the CLI not detecting duplicate entries for the same
network.

This patch changes the behavior to always use the network-ID,
so that duplicate entries are correctly caught.

Before this change;

    $ docker network create -d overlay foo
    $ docker service create --name=test --network=foo nginx:alpine
    $ docker service update --network-add foo test
    $ docker service inspect --format '{{ json .Spec.TaskTemplate.Networks}}' test
    [
      {
        "Target": "9ot0ieagg5xv1gxd85m7y33eq"
      },
      {
        "Target": "9ot0ieagg5xv1gxd85m7y33eq"
      }
    ]

After this change:

    $ docker network create -d overlay foo
    $ docker service create --name=test --network=foo nginx:alpine
    $ docker service update --network-add foo test
    service is already attached to network foo

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-01-09 20:42:09 +01:00
Christy Perez db6d87216d manifest tests
create, annotate, & push

Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2018-01-08 11:12:57 -06:00
Christy Perez 02719bdbb5 add manifest command
Enable inspection (aka "shallow pull") of images' manifest info, and
also the creation of manifest lists (aka "fat manifests").

The workflow for creating a manifest list will be:

`docker manifest create new-list-ref-name image-ref [image-ref...]`
`docker manifest annotate new-list-ref-name image-ref --os linux --arch
arm`
`docker manifest push new-list-ref-name`

The annotate step is optional. Most architectures are fine by default.

There is also a `manifest inspect` command to allow for a "shallow pull"
of an image's manifest: `docker manifest inspect
manifest-or-manifest_list`.

To be more in line with the existing external manifest tool, there is
also a `-v` option for inspect that will show information depending on
what the reference maps to (list or single manifest).

Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-01-08 10:43:56 -06:00
Michael Friis 99e3b4cd93 use 'config' over 'configuration file'
Signed-off-by: Michael Friis <friism@gmail.com>
2018-01-05 13:19:53 -08:00
Silvin Lubecki 18c44e0829 Check and return error while creating kubernetes secret and config maps.
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2018-01-03 15:46:19 +01:00
Silvin Lubecki f1b116179f Fix PR comments
- More strict on orchestrator flag
- Make orchestrator flag more explicit as experimental
- Add experimentalCLI annotation on kubernetes flags
- Better kubeconfig error message
- Prefix service name with stackname in ps and services stack subcommands
- Fix yaml documentation
- Fix code coverage ignoring generated code

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2018-01-03 10:23:32 +01:00
Silvin Lubecki ad409767bf Activate kubernetes only when experimental cli is enabled
* Refactor tests on version and kubernetes switch
* Fix rebase errors
* Refactor for gocyclo linter

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2017-12-28 14:40:10 +01:00
Vincent Demeester 5d375b348a Set a global orchestrator flag
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-12-28 14:40:10 +01:00
Vincent Demeester 1a2244e384 Error out on orchestrator command that don't support k8s yet
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-12-26 11:46:59 +01:00
Silvin Lubecki ba5d0d8ff5 Move e2e test on version command to unit tests
* Refactor a little version command

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2017-12-26 11:46:59 +01:00
Vincent Demeester f5073f81d2 Update warning
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-12-26 11:45:56 +01:00
Vincent Demeester b5170bde03 Take @nass review into account
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-12-26 11:45:56 +01:00
Vincent Demeester dedd0db51a Refactor stack command
- Define command and subcommands only once
- Use annotations for k8s or swarm specific flags or subcommands

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-12-26 11:45:56 +01:00
Vincent Demeester 0508c09494 Move cli/command/orchestrator to cli/command
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-12-26 11:25:22 +01:00
Vincent Demeester f960d2d5f3 Move /cli/command/stack/kubernetes/api to /kubernetes
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-12-26 11:22:32 +01:00
Vincent Demeester 8417e49792 Add support for kubernetes in docker cli
- Add support for kubernetes for docker stack command
- Update to go 1.9
- Add kubernetes to vendors
- Print orchestrator in docker version command

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2017-12-26 11:22:32 +01:00
Vincent Demeester 84fe1a1b5b
Add support for experimental Cli configuration
Allow to mark some commands and flags experimental on cli (i.e. not
depending to the state of the daemon). This will allow more flexibility
on experimentation with the cli.

Marking `docker trust` as cli experimental as it is documented so.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-12-22 14:48:47 +01:00
Paweł Szczekutowicz a30dd1b6f3 Return errors from client in stack deploy configs
Signed-off-by: Paweł Szczekutowicz <pszczekutowicz@gmail.com>
2017-12-18 21:34:04 +01:00
Kir Kolyshkin 8471742a8a Show container wait error
If container wait has failed, show an error from the engine
and return an appropriate exit code.

This requires engine changes from https://github.com/moby/moby/pull/34999

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2017-12-15 14:15:30 -08:00
Brian Goff 7138d6e301 Sort component details in template
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-12-07 02:04:10 +01:00
Tibor Vass 5f4c5f8bb6 Add platform and its components to docker version output
The Server section of version output is now composed of an Engine
component and potentially more, based on what the /version endpoint
returns.

Signed-off-by: Tibor Vass <tibor@docker.com>
2017-12-07 02:04:10 +01:00
Nicolas De Loof 8dc88ea7b5
Annotate worker option for 1.35 API
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2017-12-06 17:24:01 +01:00
Nicolas De Loof 591a1273fd
introduce `—workdir` option for docker exec
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2017-12-06 17:24:01 +01:00
Sebastiaan van Stijn d921d5cc39
Merge pull request #694 from riyazdf/trust-inspect
docker trust inspect
2017-11-29 11:33:53 -08:00
Riyaz Faizullabhoy a9428285f0 Use default inspect formatting, remove omitempty, update docs
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-11-29 10:52:35 -08:00
Riyaz Faizullabhoy 1eb87cc096 support multiple arguments to trust inspect
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-11-29 10:52:34 -08:00
Riyaz Faizullabhoy cd38d39d0d add docker trust inspect command for JSON viewing
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-11-29 10:52:34 -08:00
Renaud Gaubert 1ff73f867d Added support of Generic resources in compose file
Signed-off-by: Renaud Gaubert <renaud.gaubert@gmail.com>
2017-11-28 21:52:09 +01:00
Renaud Gaubert 20a6ff32ee Added support for generic resource update
Signed-off-by: Renaud Gaubert <renaud.gaubert@gmail.com>
2017-11-28 18:03:10 +01:00
Renaud Gaubert 51c7cd91cf Added Generic Resource tests
Signed-off-by: Renaud Gaubert <renaud.gaubert@gmail.com>
2017-11-28 18:03:10 +01:00
Renaud Gaubert 7ddd5f3434 Updated GenericResource CLI
Signed-off-by: Renaud Gaubert <renaud.gaubert@gmail.com>
2017-11-28 18:03:10 +01:00
Kenfe-Mickael Laventure 66661761d5
attach: Use ContainerWait instead of Inspect
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-11-17 18:12:46 -08:00
Simon Ferquel 47cf2ea683 Add isolation mode on service update/create and compose files
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
2017-11-17 15:31:13 +01:00
Sebastiaan van Stijn 026c6db6f6
Merge pull request #74 from jamiehannaford/until-logging
Add new CLI option for --until
2017-11-14 18:49:46 +01:00
Jamie Hannaford 0450a2f437 Add docs
Signed-off-by: Jamie Hannaford <jamie@limetree.org>
2017-11-14 18:04:10 +01:00
Jamie Hannaford 9c9303e113 add test for logs
Signed-off-by: Jamie Hannaford <jamie@limetree.org>
2017-11-13 10:57:44 +01:00
Kyle Spiers a570e9b355 sign test: fix imports
Signed-off-by: Kyle Spiers <kyle@spiers.me>
2017-11-10 11:34:04 -08:00
Jamie Hannaford 6f309316e2 Add new CLI option for --until
Signed-off-by: Jamie Hannaford <jamie.hannaford@rackspace.com>
2017-11-10 12:38:08 +01:00
Daniel Nephin ee0615dc97
Merge pull request #575 from eiais/local-flag
trust sign: add --local flag
2017-11-07 14:15:53 -05:00
Sebastiaan van Stijn 042575aac9
Merge pull request #474 from jhowardmsft/jjh/apis-for-platform
LCOW: CLI changes to add platform flag - pull, run, create and build
2017-11-07 14:26:31 +01:00
Vincent Demeester 21d88629df
Merge pull request #657 from dnephin/add-test-for-container-cp
Adding unit tests for container cp
2017-11-07 14:22:22 +01:00
John Howard d8b782560e LCOW: Add `--platform=` CLI flag to pull/create/run/build
Signed-off-by: John Howard <jhoward@microsoft.com>

This is the CLI updates for the document discussed in https://github.com/moby/moby/issues/34617
to support Linux Containers on Windows. It adds --platform= as CLI flags to the four
commands listed above. Import still to be completed (needs daemon changes).
2017-10-31 09:50:43 -07:00
Vincent Demeester a0140b4ddb
Merge pull request #658 from arehman199/fix-a-number-of-typos
fix a number of minor typos
2017-10-31 15:07:51 +01:00
Abdur Rehman c3fe9d85ef fix a number of minor typos
Fix 19 typos, grammatical errors and duplicated words.

These fixes have minimal impact on the code as these are either in the
doc files or in comments inside the code files.

Signed-off-by: Abdur Rehman <abdur_rehman@mentor.com>
2017-10-31 15:21:51 +05:00
Vincent Demeester 6e04da39b8
Merge pull request #654 from dnephin/pr-fix-image-rm
Fix behaviour of `rmi -f` with unexpected errors
2017-10-31 10:38:38 +01:00
Kyle Spiers f5a50650d6 trust sign: add --local flag
Signed-off-by: Kyle Spiers <kyle@spiers.me>
2017-10-30 16:06:03 -07:00
Daniel Nephin b7b62ca26a Adding unit tests for cp
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-10-30 18:33:28 -04:00
Sebastiaan van Stijn 96b8d15bdd
Merge pull request #651 from thaJeztah/fix-extra-host-sorting
Preserve sort-order of extra hosts, and allow duplicate entries
2017-10-30 20:38:10 +01:00
Brian Goff 7ca234fe24
Merge pull request #652 from thaJeztah/move-notary
Move notary to its new location
2017-10-30 14:05:59 -04:00
Daniel Nephin 65398de1a6
Merge pull request #655 from eiais/extraQuote
Remove extra quotes from docker trust sign
2017-10-30 13:53:18 -04:00
Daniel Nephin a79e742bfc
Merge pull request #648 from thaJeztah/fix-host-add-description
Fix flag description for --host-add
2017-10-30 13:52:29 -04:00
Kyle Spiers 291fdcfdbe Remove extra quotes from docker trust sign
Signed-off-by: Kyle Spiers <kyle@spiers.me>
2017-10-30 10:31:21 -07:00
Daniel Nephin b900676523 Use t.Run() for tests
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-10-30 13:00:03 -04:00
Arash Deshmeh 125302cfa6 docker rm -f exits with 1 if the image was not removed
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2017-10-30 12:50:19 -04:00
Sebastiaan van Stijn 6cd58063fa
Move notary to its new location
The https://github.com/docker/notary repository has moved to
https://github.com/theupdateframework/notary

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-10-30 17:21:41 +01:00
Sebastiaan van Stijn 0c4fa699eb
Merge pull request #566 from riyazdf/docker-trust-2
docker trust: interact with signers and keys
2017-10-30 17:03:58 +01:00
Riyaz Faizullabhoy e189a21a25 review feedback: updating for windows, error paths
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-10-30 16:55:59 +01:00
Riyaz Faizullabhoy 079471ebeb update to stderr instead of stdout, update tests
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-10-30 16:55:59 +01:00
Riyaz Faizullabhoy b4ef2ddb8b revendor notary for updated import/export packages, update with rebase
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-10-30 16:55:59 +01:00
Riyaz Faizullabhoy 2d8cc3cd80 refactoring and adding tests for EC key types
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-10-30 16:55:59 +01:00
Riyaz Faizullabhoy 532d223db4 trust: move signer and key commands down one level
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-10-30 16:53:54 +01:00
Kyle Spiers 4e797eaa04 docs: add docs for new trust subcommands
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-10-30 16:53:54 +01:00
Riyaz Faizullabhoy 604bc3f22d trust: key-load and key-generate code
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-10-30 16:53:53 +01:00
Ashwini Oruganti dde9f614a7 trust: add signer-add and signer-remove command
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-10-30 16:53:53 +01:00
Sebastiaan van Stijn dbdf8f6468
Preserve sort-order of extra hosts, and allow duplicate entries
Extra hosts (`extra_hosts` in compose-file, or `--hosts` in services) adds
custom host/ip mappings to the container's `/etc/hosts`.

The current implementation used a `map[string]string{}` as intermediate
storage, and sorted the results alphabetically when converting to a service-spec.

As a result, duplicate hosts were removed, and order of host/ip mappings was not
preserved (in case the compose-file used a list instead of a map).

According to the **host.conf(5)** man page (http://man7.org/linux/man-pages/man5/host.conf.5.html)

    multi  Valid values are on and off.  If set to on, the resolver
      library will return all valid addresses for a host that
      appears in the /etc/hosts file, instead of only the first.
      This is off by default, as it may cause a substantial
      performance loss at sites with large hosts files.

Multiple entries for a host are allowed, and even required for some situations,
for example, to add mappings for IPv4 and IPv6 addreses for a host, as illustrated
by the example hosts file in the **hosts(5)** man page (http://man7.org/linux/man-pages/man5/hosts.5.html):

    # The following lines are desirable for IPv4 capable hosts
    127.0.0.1       localhost

    # 127.0.1.1 is often used for the FQDN of the machine
    127.0.1.1       thishost.mydomain.org  thishost
    192.168.1.10    foo.mydomain.org       foo
    192.168.1.13    bar.mydomain.org       bar
    146.82.138.7    master.debian.org      master
    209.237.226.90  www.opensource.org

    # The following lines are desirable for IPv6 capable hosts
    ::1             localhost ip6-localhost ip6-loopback
    ff02::1         ip6-allnodes
    ff02::2         ip6-allrouters

This patch changes the intermediate storage format to use a `[]string`, and only
sorts entries if the input format in the compose file is a mapping. If the input
format is a list, the original sort-order is preserved.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-10-30 01:48:09 +01:00
Sebastiaan van Stijn 79b19cba16
Fix flag description for --host-add
The `--host-add` flag adds a new `host:ip` mapping. Even though
adding an entry is idempotent (adding the same mapping multiple
times does not update the service's definition), it does not
_update_  an existing mapping with a new IP-address (multiple
IP-addresses can be defined for a host).

This patch removes the "or update" part from the flag's
description.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-10-28 16:47:53 +02:00
Daniel Nephin 54e1378e04 Merge pull request #636 from dnephin/fix-trust-output-stream
Fix stdout and errors in image/trust
2017-10-27 11:31:01 -04:00
Sebastiaan van Stijn e4940cb8d2 Merge pull request #621 from charrywanganthony/displaystringutils
Refactor stringutils and fix docker search output form
2017-10-27 11:08:36 +02:00