Commit Graph

849 Commits

Author SHA1 Message Date
Arash Deshmeh a921313caf use sortorder lib for sorting network list output
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-08-08 12:06:59 -04:00
Tibor Vass faeb8bb571 build: change --console=[auto,false,true] to --progress=[auto,plain,tty]
This changes the experimental --console flag to --progress following
feedback indicating avoidable confusion.

In addition to naming changes, the help output now has an additional
clarification, specifically: container output during builds are only
shown when progress output is set to plain. Not mentioning this was also
a big cause of confusion.

Signed-off-by: Tibor Vass <tibor@docker.com>
2018-08-07 18:18:13 +00:00
Vincent Demeester 9cd7c1361c
Migrate `TestExtractVariables` to subtests…
… as suggested in previous PR comment.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-08-07 16:06:13 +02:00
Arash Deshmeh 021bf39d76 refactor network list unit tests to table-driven style
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-08-02 14:07:06 -04:00
Arash Deshmeh 4f388ffca3 add unit test to cover the sort order of network list command
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-08-02 14:07:06 -04:00
Vincent Demeester 4c87725c35
Allow custom pattern when extracting variable…
… as it is possible to do it when interpolating. It also fixes when
there is 2 variables on the same *value* (in the composefile, on the
same line)

Finaly, renaming the default, used in cli, pattern to `defaultPattern`
to not be shadowed unintentionally.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-08-02 16:50:40 +02:00
Sebastiaan van Stijn 4fbb009d39
Merge pull request #1251 from silvin-lubecki/fix-stack-help-command
Fix help message flags on docker stack commands and sub-commands
2018-08-02 13:10:36 +02:00
Akihiro Suda 6f61cf053a support SSH connection
e.g. docker -H ssh://me@server

The `docker` CLI also needs to be installed on the remote host to
provide `docker system dial-stdio`, which proxies the daemon socket to stdio.

Please refer to docs/reference/commandline/dockerd.md .

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-08-02 13:10:06 +09:00
Vincent Demeester afb87e42f2
Add a new `ExtractVariables` function to `compose/template` package
It allows to get easily all the variables defined in a
composefile (the `map[string]interface{}` representation that
`loader.ParseYAML` returns at least) and their default value too.

This commit also does some small function extract on substitution
funcs to reduce a tiny bit duplication.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-08-01 16:12:49 +02:00
Silvin Lubecki 21cce52b30 Fix help message flags on docker stack commands and sub-commands
PersistentPreRunE needs to be called within the help function to initialize all the flags (notably the orchestrator flag)
Add an e2e test as regression test

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2018-08-01 01:48:27 +02:00
Vincent Demeester 0246bc1b3b
Exposes compose `loader.Transform` function…
This should make it easier for people to write custom composefile
parser without duplicating too much code. It takes the default
transformers and any additional number of transformer for any
types. That way it's possible to transform a `cli/compose` map into a
custom type that would use some of `cli/compose` types and its own.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-07-31 09:37:09 +02:00
Vincent Demeester 19653e7fad
Merge pull request #1240 from thaJeztah/datapath_addr_api_annotation
Add API-version anotation for --data-path-addr
2018-07-30 17:47:52 +02:00
Silvin 6cd0e2fe70
Merge pull request #1222 from thaJeztah/its_not_standard_but_its_in
Update --compose-file flag description to mention stdin
2018-07-30 16:23:29 +02:00
Sebastiaan van Stijn 91b1ad9d2b
Add API-version anotation for --data-path-addr
This flag was added in Docker 17.06, API version 1.31 through
moby@8dc8cd4719f165c01c98e7d3ce1d6cea6a8f60b8, but didn't add
API-version annotations.

This patch adds the missing annotations to hide this flag if
the CLI is connected to an older version of the daemon that
doesn't support that API.

Before this patch:

    DOCKER_API_VERSION=1.30 docker swarm init --help | grep data-path-addr
          --data-path-addr string           Address or interface to use for data path traffic (format: <ip|interface>)

    DOCKER_API_VERSION=1.31 docker swarm init --help | grep data-path-addr
          --data-path-addr string           Address or interface to use for data path traffic (format: <ip|interface>)

With this patch applied:

    DOCKER_API_VERSION=1.30 docker swarm init --help | grep data-path-addr
    # (no result)

    DOCKER_API_VERSION=1.31 docker swarm init --help | grep data-path-addr
          --data-path-addr string           Address or interface to use for data path traffic (format: <ip|interface>)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-07-30 11:05:20 +02:00
Vincent Demeester 55edeb497a
Migrate to non-deprecated functions of `api/types/filters`
- Use `Contains` instead of `Include`
- Use `ToJSON` instead of `ToParam`
- Remove usage of `ParseFlag` as it is deprecated too

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-07-27 15:37:43 +02:00
Vincent Demeester a3464c0a20
Merge pull request #1140 from Vimal-Raghubir/1110-Fix-Warning-Message
Fix: Warning Message and Fallback search
2018-07-27 07:27:00 +00:00
Vincent Demeester d13e2df65b
Add missing fields in compose/types
Even though those fields are not supported by `docker stack deploy`
they are defined in versions `3.x` of compose schema, so the `compose`
package should be able to marshal/unmarshal them.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-07-26 17:04:22 +02:00
Sebastiaan van Stijn 2c7822b036
Update --compose-file flag description to mention stdin
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-07-19 14:55:48 +02:00
Justyn Temme bdd58a4096 Update deploy.go
Clarified ambiguous error message

Update kubernetes/cli.go

Infromed user of why the error was caused when file is not there

Signed-off-by: Justyn Temme <justyntemme@gmail.com>
2018-07-17 09:14:05 -05:00
Vimal Raghubir ce3d069936
Fix: Warning Message
Signed-off-by: Vimal-Raghubir <vraghubir0418@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-07-13 13:39:24 +02:00
Sebastiaan van Stijn 9847e96765
Update hints for linting
- remove some hints that are no longer needed
- added a nolint: unparam for removeSingleSigner() (return bool is only used in tests)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-07-13 11:18:50 +02:00
Sebastiaan van Stijn 0f7ae34ea9
Adapt min-column width to component information
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-07-12 01:34:34 +02:00
Sebastiaan van Stijn 55ff66d967
Extend version-align test with components
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-07-12 01:31:23 +02:00
Sebastiaan van Stijn c8b9c21ef9
Merge pull request #1178 from cyli/fix-swarm-ca-command
Propagate the provided external CA certificate to the external CA object in swarm
2018-07-10 01:31:32 +02:00
Arash Deshmeh 71d650ee17 refactored cli/compose and cli/command/trust to use sort.Slice and removed custom types used for sorting
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-07-08 15:08:17 -04:00
Arash Deshmeh ceed42217d refactored all commands under cli/command/ to use sort.Slice instead of declaring custom types for sorting
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-07-06 15:49:32 -04:00
Vincent Demeester 2634562119
Merge pull request #1102 from sfluor/1074-fix-mapping-a-range-of-host-ports-to-a-single-container-port
Fix mapping a range of host ports to a single container port
2018-07-06 14:41:00 +02:00
Arash Deshmeh 26151d910a The output of plugin list command is sorted by plugin name
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-07-05 12:35:53 -04:00
Sami Tabet 29612ccefe Adding support of the long syntax publish notation
Signed-off-by: Sami Tabet <salph.tabet@gmail.com>
2018-07-05 00:33:13 +02:00
Silvin f285fe67e9
Merge pull request #1163 from thaJeztah/bump_engine
bump docker and dependencies
2018-07-04 16:17:12 +02:00
Sebastiaan van Stijn 5f6d5c7328 Bump docker and dependencies
Updates docker/docker to 1436dc8f8d0f6f60b6e335fbd918d6b22ee6574d,
matching 18.06.0-rc1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-07-04 01:14:40 +00:00
Tibor Vass 721000e6c9 build: use strconv.ParseBool to parse DOCKER_BUILDKIT to allow value "0"
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-07-03 23:14:06 +00:00
Tibor Vass 7b255e653a
Merge pull request #1176 from tiborvass/buildkit-iidfile
build: --iidfile support with buildkit
2018-07-03 15:36:23 -07:00
Tibor Vass c7e85c09d2 build: --iidfile support with buildkit
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-07-03 19:11:11 +00:00
Tõnis Tiigi 69e1743e3d
Merge pull request #1156 from dmcgowan/fix-manifest-list-size
Fix manifest lists to always use correct size
2018-07-03 11:27:19 -07:00
Ying Li 4243440e1f Propagate the provided external CA certificate to the external CA object
in swarm.

Also, fix some CLI command confusions:
1. If the --external-ca flag is provided, require a --ca-cert flag as well, otherwise
   the external CA is set but the CA certificate is actually rotated to an internal
   cert
2. If a --ca-cert flag is provided, require a --ca-key or --external-ca flag be
   provided as well, otherwise either the server will say that the request is
   invalid, or if there was previously an external CA corresponding to the cert, it
   will succeed.  While that works, it's better to require the user to explicitly
   set all the parameters of the new desired root CA.

This also changes the `swarm update` function to set the external CA's CACert field,
which while not strictly necessary, makes the CA list more explicit.

Signed-off-by: Ying Li <ying.li@docker.com>
2018-07-02 17:14:21 -07:00
Vincent Demeester 847e0c22d4
Remove composefiles lenght check on k8s RunDeploy..
The compose file(s) are already loaded at that point.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-07-02 15:00:19 +02:00
Silvin 18091ea7e2
Merge pull request #1170 from vdemeester/omit-silvin
Add omitempty on compose config top-level types
2018-07-02 14:16:53 +02:00
Vincent Demeester f05ab2b1fb
Add omitempty on compose config top-level types
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-07-02 12:04:09 +02:00
Vincent Demeester 981c099b96
Merge pull request #1169 from silvin-lubecki/schema-vendoring
Add a doc.go file so the compose/schema/data directory can be vendore…
2018-07-02 10:47:25 +02:00
Silvin Lubecki 3a8ef767f8 Add a doc.go file so the compose/schema/data directory can be vendored in another project, without being pruned.
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2018-07-02 10:08:25 +02:00
Vincent Demeester 9e36ff4491
Merge pull request #1160 from euank/simpler-pass
config/credentials: don't run 'pass' to detect it
2018-07-02 09:40:47 +02:00
Euan Kemp 056015c3d8 config/credentials: don't run 'pass' to detect it
'CheckInitialized' in the credential-helper library actually invokes
`pass`, which isn't desirable (see #699).

This moves the check to be simpler, and then pass will only be invoked
when it's needed (such as for `docker login` or when pulling from a
private registry).

This logic could also reasonably live in the credential-helper library,
but it's simple enough it seems fine in either location.

Signed-off-by: Euan Kemp <euank@euank.com>
2018-06-29 11:38:39 -07:00
Vincent Demeester 9faf728089
Merge pull request #1155 from adshmh/add-unit-tests-to-plugin-list
added unit tests to cover plugin list command
2018-06-29 15:49:30 +02:00
Sebastiaan van Stijn 7c7c299eee
Merge pull request #1152 from vdemeester/extract-converter
Extract StackConverter from the StackClient
2018-06-29 13:36:55 +02:00
Derek McGowan 1fd2d66df8 Fix manifest lists to always use correct size
Stores complete OCI descriptor instead of digest and platform
fields. This includes the size which was getting lost by not
storing the original manifest bytes.

Attempt to support existing cached files, if not output
the filename with the incorrect content.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-06-28 18:17:38 -07:00
Arash Deshmeh c26121df5c added unit tests to cover plugin list command
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-28 16:51:54 -04:00
Vincent Demeester 293553944d
Merge pull request #1151 from vdemeester/update-docker-credential-helper-pass
Update docker-credential-helpers dependency
2018-06-28 14:57:05 +02:00
Vincent Demeester d9741fc96b
Update docker-credential-helpers dependency
This is mainly for the `pass` helper ; `pass` shouldn't be called
every docker command anymore ;).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-06-28 14:44:53 +02:00
Arash Deshmeh bc9b42ea9b added unit tests covering content trust for plugin install command
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-27 22:16:19 -04:00
Vincent Demeester f2e6ee6899
Extract StackConverter from the StackClient
It makes it easier to get the correct stack from a compose config
struct without requiring the client (and thus talking to k8s API)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-06-27 16:41:00 +02:00
Silvin 204ab4ca74
Merge pull request #1128 from vdemeester/interpolation-options
Add options to the compose loader
2018-06-26 15:05:54 +02:00
Vincent Demeester 0f9d24f78d
Refactor `stack` command/package
- Handle `bundlefile` directly in the `top-level`
  command. `bundlefile` is still experimental and will be deprecated
  in future version — this should make be easier to remove it.
- Validate the `stack` name in all cases (i.e. whatever the
  orchestrator is used)
- Load the composefile ahead of choosing the orchestrator. This
  removes some slight duplication.
- Makes `RunDeploy` easier to use from outside packages (like
  `docker/app`) with a preloaded configuration.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-06-26 14:07:26 +02:00
Vincent Demeester 9fdd14f399
Add options to the compose loader
- Add the possibility to skip interpolation
- Add the possibility to skip schema validation
- Allow customizing the substitution function, to add special cases.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-06-25 17:15:26 +02:00
Sebastiaan van Stijn 61e53fc88a
Merge pull request #1138 from seemethere/env_experimental
Add env variable option for experimental
2018-06-25 14:47:16 +02:00
Silvin Lubecki 38056740d6 Refactor tests
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2018-06-25 11:13:32 +02:00
Vincent Demeester cc26da94ed Add `init` support in 3.7 schema
> Run an init inside the container that forwards signals and reaps
  processes

This is supported on `run` and now on Swarm services too, so it's also
possible to have in on a composefile :).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-06-25 11:13:32 +02:00
Vincent Demeester 80c26f618e
Add an `Extras` field on the compose config types.
That field is automaticaly populated with any `x-*` field in the yaml.
And marshalling the compose config struct put them back into place.

This make it possible to get those extra fields without re-inventing
the wheel (i.e. reimplementing 80% of the `cli/compose/*` packages.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-06-25 10:51:56 +02:00
Eli Uriegas e3bb62ed51 Add env variable option for experimental
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2018-06-24 21:15:02 +00:00
Arash Deshmeh d469cbdd14 fixed output leak from TestRunCommandWithContentTrustErrors unit tests
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-23 10:27:27 -04:00
Silvin Lubecki e8c87f7cb3
Warn if DOCKER_ORCHESTRATOR is still used but not DOCKER_STACK_ORCHESTRATOR
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-06-22 13:58:39 -07:00
Sebastiaan van Stijn e02c28f40a
Remove duplicated getOrchestrator(), and rename hideFlag()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-06-22 13:58:14 -07:00
Sebastiaan van Stijn f0a8598b8d
Remove shorthand `-k` option from `docker version`
The `-k` shorthand was alreaady removed from other
commands, so best to be consistent.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-06-21 23:33:55 -07:00
Sebastiaan van Stijn 0f07b9ffc7
Update command usage and documentation
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-06-21 23:16:27 -07:00
Sebastiaan van Stijn a63252ba71
Remove "Stack Orchestrator" from "docker version"
The output of this information can be confusing,
so removing until we have a better design for this.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-06-21 22:02:11 -07:00
Silvin Lubecki 71272dd203
Scope orchestration selection to stack commands only
* Renaming DOCKER_ORCHESTRATOR to DOCKER_STACK_ORCHESTRATOR
* Renaming config file option "orchestrator" to "stackOrchestrator"
* "--orchestrator" flag is no more global but local to stack command and subcommands
* Cleaning all global orchestrator code
* Replicating Hidden flags in help and Supported flags from root command to stack command

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2018-06-21 17:12:31 -07:00
Sebastiaan van Stijn 8de0753869
Merge pull request #1112 from n4ss/fix-trust-signer-remove
Fix docker trust signer removal
2018-06-15 08:18:29 -07:00
Silvin 805b34127a
Merge pull request #1124 from vdemeester/using-cli-interface-everywhere-possible
Use command.Cli interface instead of concrete type…
2018-06-14 16:43:15 +02:00
Vincent Demeester 88068b9dd7
Use command.Cli interface instead of concrete type…
… wherever it's possible. Should make it even easier to test and use
another implementation.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-06-14 16:26:47 +02:00
Vincent Demeester e43c7920ea
Export Push and Save
As we did for `Pull`, it will be helpful to expose the push and save
implementation.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-06-14 15:48:21 +02:00
Vincent Demeester 70db8dee74
Merge pull request #479 from Tim15/init-option
Add --init option to `docker service create`
2018-06-14 13:58:52 +02:00
Vincent Demeester ff13f03def
Add --init option to `docker service create`
Signed-off-by: Timothy Higinbottom <timhigins@gmail.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-06-14 13:50:12 +02:00
Andrew Hsu 2daec78609
Merge pull request #1111 from tiborvass/experimental-buildkit
Support for experimental BuildKit
2018-06-13 18:21:41 -07:00
Tibor Vass b3a5c153d5 build: address some review nits
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-06-13 22:40:31 +00:00
Tibor Vass 5a103e1844 build: change --no-console to --console=[true|false|auto]
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-06-13 21:07:11 +00:00
Tibor Vass 00792d1704 build: ensure temporary folder is removed in error case
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-06-13 18:32:29 +00:00
Tibor Vass aef42093b8 build: skip moby.buildkit.trace Aux message to be future proof
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-06-13 18:32:28 +00:00
Tibor Vass 5919e8a30f build: fix lint issues + refactor
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-06-13 18:32:28 +00:00
Tibor Vass 15674d9ee9 build: simplify Close logic in WriteTempDockerfile
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-06-13 18:32:28 +00:00
Tibor Vass ed75f6202b build: add experimental --no-console flag to support non-tty human-readable output with buildkit
Unfortunately, this is for now the only way to see the output of RUN commands when using buildkit.
It is equivalent to `DOCKER_BUILDKIT=1 docker build . 2>&1 | cat`

Signed-off-by: Tibor Vass <tibor@docker.com>
2018-06-13 18:32:28 +00:00
Tibor Vass 584d59d8f5 formatter: fix TestDiskUsageContextFormatWrite expected output
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-06-13 18:32:28 +00:00
Tibor Vass b2b3f9c461 build: setting DOCKER_BUILDKIT environment variable to any non-empty string enables the use of buildkit
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-06-13 18:32:28 +00:00
Tibor Vass 640cbb8d2f build: fix output handling with buildkit (quiet option, redirects)
With this patch the following become true even with buildkit enabled:
1. `docker build -q .` only outputs the created image's sha256 ID.
2. `docker build -q .` outputs as if no `-q` was specified, if error occurred
3. `docker build . &> out` outputs JSON (instead of TTY characters)

Signed-off-by: Tibor Vass <tibor@docker.com>
2018-06-13 18:32:28 +00:00
Tibor Vass 82f0e1e5d8 build: fix `-f` handling with buildkit
This commit brings a more pedantic change in the following ambiguous case:
cat Dockerfile | docker build -f otherDockerfile -

The legacy builder does not error out and prefers the Dockerfile from stdin
while the buildkit-based one errors out.

Note that this is only in the case where stdin is a Dockerfile (not an archive)

Signed-off-by: Tibor Vass <tibor@docker.com>
2018-06-13 18:32:28 +00:00
Silvin 4cb3c70f36
Merge pull request #1121 from vdemeester/gotestyourself-with-tools
Update gotestyourself to gotest.tools
2018-06-11 14:49:20 +02:00
Tibor Vass 89e102474c build: error out if buildkit is on and stdin is used for both dockerfile and context
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-06-09 20:51:34 +00:00
Tibor Vass 5314a8fc06 build: Add support for using dockerfile from stdin with buildkit
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-06-09 20:51:34 +00:00
Tibor Vass e0b3921a03 build: Add support for using context from stdin with buildkit
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-06-09 20:51:34 +00:00
Tonis Tiigi 8cf213bd0c build: use a separate upload request for early progress
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-09 20:51:34 +00:00
Tonis Tiigi b19294ee42 system: add buildcache formatting
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-09 20:51:34 +00:00
Tonis Tiigi 0f97642915 build: basic buildkit progress support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-09 20:51:34 +00:00
Tonis Tiigi 656fe85c74 build: add experimental buildkit base
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-09 20:51:30 +00:00
Nassim 'Nass' Eddequiouaq 92c39dd0ab Fix removeSingleSigner description
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
2018-06-09 08:14:34 -07:00
Vincent Demeester 2c4de4fb5e
Update tests to use gotest.tools 👼
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-06-08 18:24:26 +02:00
Nassim 'Nass' Eddequiouaq 2b3361cc1a Move the successful removal print
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
2018-06-08 09:21:36 -07:00
Vincent Demeester b1065767cd
Bump moby version (and its dependencies)
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-06-08 11:26:10 +02:00
Nassim 'Nass' Eddequiouaq 5ebb7a65ab Fix tests and nit
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
2018-06-06 07:25:25 -07:00
Nassim 'Nass' Eddequiouaq 448082f333 Fix docker trust signer removal
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
2018-06-05 16:04:41 -07:00
Sebastiaan van Stijn 90f8ce8a5d
Merge pull request #1104 from vdemeester/show-me-your-secret
Add more example to the full-example tests
2018-06-05 16:44:06 +02:00
Vincent Demeester eaa9149e29
Merge pull request #948 from simonferquel/k8s-watch-stack-status
K8s: more robust stack error detection on deploy
2018-06-04 10:42:42 +02:00
Vincent Demeester d1cc8c731e
Merge pull request #1105 from vdemeester/1044-compress-stream-friend
Fix panics when --compress and --stream are used together
2018-06-01 23:00:01 +02:00
Vincent Demeester 8b3dc39fce
Fix panics when --compress and --stream are used together
Warns that `-compress` has no effect when used together with the
expremintal `--stream` flag.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-06-01 18:34:00 +02:00
Vincent Demeester 7db15a4553
Merge pull request #1101 from silvin-lubecki/filter-stack-service
Fix service filtering by name on Kubernetes
2018-06-01 15:50:34 +02:00
Vincent Demeester 63ad0a0e88
Merge pull request #1094 from thaJeztah/hide_checkpoint_on_windows
Hide experimental checkpoint features on Windows
2018-06-01 15:49:51 +02:00
Sebastiaan van Stijn eb54d3e5c0
Merge pull request #1097 from vdemeester/x-objects
Allow `x-*` extension on 3rd level objects
2018-06-01 15:48:04 +02:00
Silvin Lubecki b1ff199167 Fix service filtering by name on Kubernetes to mimic Swarm filtering
*  Kubernetes native filtering (server side) is an exact match, now filtering on name is made client-side to add prefix-matching

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2018-06-01 15:43:02 +02:00
Vincent Demeester 55426d9396
Add more example to the full-example tests
Configs and Secrets were note present, some labels on volumes and
networks too.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-06-01 14:16:18 +02:00
Sebastiaan van Stijn 1df6b68111
Mark checkpoint feature as Linux-only, and homogenize error messages
This patch adds annotations to mark the checkpoint commands as Linux only, which
hides them if the daemon is running a non-matching operating-system type;

Before:

    docker

    Usage:	docker COMMAND

    A self-sufficient runtime for containers

    ...

    Management Commands:
      config      Manage Docker configs
      container   Manage containers
      image       Manage images

After:

    docker

    Usage:	docker COMMAND

    A self-sufficient runtime for containers

    ...

    Management Commands:
      checkpoint  Manage checkpoints
      config      Manage Docker configs
      container   Manage containers
      image       Manage images

This change also prints errors when attempting to use checkpoint commands or
flags if the feature is not supported by the Daemon's operating system;

    $ docker checkpoint --help
    docker checkpoint is only supported on a Docker daemon running on linux, but the Docker daemon is running on windows

    $ docker checkpoint create --help
    docker checkpoint create is only supported on a Docker daemon running on linux, but the Docker daemon is running on windows

    $ docker checkpoint ls --help
    docker checkpoint ls is only supported on a Docker daemon running on linux, but the Docker daemon is running on windows

    $ docker checkpoint rm --help
    docker checkpoint rm is only supported on a Docker daemon running on linux, but the Docker daemon is running on windows

    $ docker container start --checkpoint=foo mycontainer
    "--checkpoint" requires the Docker daemon to run on linux, but the Docker daemon is running on windows

    $ docker container start --checkpoint-dir=/foo/bar mycontainer
    "--checkpoint-dir" requires the Docker daemon to run on linux, but the Docker daemon is running on windows

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-31 22:25:06 +02:00
Daniel Hiltgen 375d9a409b Show long help message when defined
This fixes the help template so that if a command
includes a Long form help message that is displayed instead
of ignoring it and always showing the Short message.

Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
2018-05-31 08:09:51 -07:00
Vincent Demeester 6bcfa8806c
Allow `x-*` extension on 3rd level objects
As for top-level key, any 3rd-level key which starts with `x-` will be
ignored by compose. This allows for users to:
* include additional metadata in their compose files
* create YAML anchor objects that can be re-used in other parts of the config

This matches a similar feature in the swagger spec definition:
https://swagger.io/specification/#specificationExtensions

This means a composefile like the following is valid

```
verison: "3.7"
services:
  foo:
    image: foo/bar
    x-foo: bar
network:
  bar:
    x-bar: baz
```

It concerns services, volumes, networks, configs and secrets.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-05-31 13:38:58 +02:00
Sebastiaan van Stijn bb71808605
Add test for version output aligning
Includes some refactoring to allow testing the output
in isolation.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-31 10:15:15 +02:00
Silvin Lubecki a252cb1197 Fix outputting twice the docker stack rm error message
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2018-05-30 15:56:41 +02:00
Silvin Lubecki 66059a925b Fix always listing nodes during docker stack ps command on Kubernetes. A user without node listing rights could not use this command as it always fails.
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2018-05-30 15:28:35 +02:00
Sebastiaan van Stijn daf021fe60
Merge pull request #1090 from zkry/1089-quiet-stream-output-fix
Add String method so quieted output displays properly
2018-05-29 12:43:26 +02:00
Vincent Demeester 4e6e5d583c
Support for rollback config in compose 3.7
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-05-29 11:37:51 +02:00
Vincent Demeester df6e38b81a
Add composefile schema 3.7
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-05-29 11:37:12 +02:00
Zachary Romero b6cf6d87ae Add String method so quieted output displays properly
Fixes #1089

Signed-off-by: Zachary Romero <zacromero3@gmail.com>
2018-05-29 05:30:17 +03:00
Vincent Demeester 824a0b4db9
Merge pull request #1068 from silvin-lubecki/remove-experimental-for-orchestrator
Remove Kubernetes commands from experimental
2018-05-28 17:39:11 +02:00
Sebastiaan van Stijn d38f397da1
Validate stack-names for empty values
Add validation for stack names to prevent an empty name resulting in _all_
stacks to be returned after filtering, which can result in removal of services
for all stacks if `--prune`, or `docker stack rm` is used.

Before this change;

    docker stack deploy -c docker-compose.yml one
    docker stack deploy -c docker-compose.yml two
    docker stack deploy -c docker-compose.yml three

    docker stack deploy -c docker-compose.yml --prune ''
    Removing service one_web
    Removing service two_web
    Removing service three_web

After this change:

    docker stack deploy -c docker-compose.yml one
    docker stack deploy -c docker-compose.yml two
    docker stack deploy -c docker-compose.yml three

    docker stack deploy -c docker-compose.yml --prune ''
    invalid stack name: ""

Other stack commands were updated as well:

Before this change;

    docker stack deploy -c docker-compose.yml ''
    Creating network _default
    failed to create network _default: Error response from daemon: rpc error: code = InvalidArgument desc = name must be valid as a DNS name component

    docker stack ps ''
    nothing found in stack:

    docker stack rm ''
    Removing service one_web
    Removing service three_web
    Removing service two_web

After this change:

    docker stack deploy -c docker-compose.yml ''
    invalid stack name: ""

    docker stack ps ''
    invalid stack name: ""

    docker stack rm ''
    invalid stack name: ""

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-28 17:03:26 +02:00
Silvin Lubecki fb34ffc327 Check allNamespace config value while loading configuration file
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2018-05-28 15:15:25 +02:00
Silvin Lubecki f2b75a879a Remove experimentalCli annotation from all kubernetes flags and commands
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2018-05-28 15:06:31 +02:00
Vincent Demeester 537e67d462
Merge pull request #1084 from thaJeztah/minor-code-refactor
Minor refactor in stack helper functions
2018-05-28 12:39:15 +02:00
Sebastiaan van Stijn 0c175fc21a
Minor refactor in stack helper functions
- Don't wrap the code to be slightly more readable
- Rename `getServiceFilter()` to `getStackServiceFilter()` to be
  consistent with other helper functions.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-28 12:26:14 +02:00
Vincent Demeester 82053236a3
Merge pull request #1059 from mat007/kubernetes-orchestrator-all-namespaces
Kubernetes orchestrator all namespaces
2018-05-28 11:59:54 +02:00
Silvin Lubecki 770daef564 --orchestrator flag is now a persistent flag
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2018-05-28 10:43:32 +02:00
Mathieu Champlon 1c1300bef6 Imply all Kubernetes namespaces for docker stack list when orchestrator is all or Kubernetes
* Add "kubernetes" struct in config file with "allNamespaces" option, to opt-out this behavior when set as "disabled"

Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
2018-05-28 10:43:32 +02:00
Simon Ferquel f38510b2d8 Better stack status check
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
2018-05-25 12:56:52 +02:00
Sebastiaan van Stijn 0089f172b7
Merge pull request #1023 from simonferquel/k8s-stack-services-filters
[Kubernetes] stack services filters
2018-05-24 19:56:33 +02:00
Mathieu Champlon 297866ebbe Match Swarm in how to combine filters
`docker stack services --filter=label=foo=bar --filter=label=foo=baz my-stack` with Swarm gets handled as `filter on (a label named foo with value bar) AND (a label named foo with value baz).
This obviously yields an empty result set every time, but if and how this should be changed is out of scope here, so simply align Kubernetes with Swarm for now.

Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
2018-05-24 15:24:23 +02:00
Sebastiaan van Stijn df9a0c7797
Minor refactor: use anyChanged() to detect changed flags
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-24 01:30:09 +02:00
Sebastiaan van Stijn df43eb931e
Fix cpu/memory limits and reservations being reset on service update
Before this change:
----------------------------------------------------

Create a service with reservations and limits for memory and cpu:

    docker service create --name test \
      --limit-memory=100M --limit-cpu=1 \
      --reserve-memory=100M --reserve-cpu=1 \
      nginx:alpine

Verify the configuration

    docker service inspect --format '{{json .Spec.TaskTemplate.Resources}}' test
    {
      "Limits": {
        "NanoCPUs": 1000000000,
        "MemoryBytes": 104857600
      },
      "Reservations": {
        "NanoCPUs": 1000000000,
        "MemoryBytes": 104857600
      }
    }

Update just CPU limit and reservation:

    docker service update --limit-cpu=2 --reserve-cpu=2 test

Notice that the memory limit and reservation is not preserved:

    docker service inspect --format '{{json .Spec.TaskTemplate.Resources}}' test
    {
      "Limits": {
        "NanoCPUs": 2000000000
      },
      "Reservations": {
        "NanoCPUs": 2000000000
      }
    }

Update just Memory limit and reservation:

    docker service update --limit-memory=200M --reserve-memory=200M test

Notice that the CPU limit and reservation is not preserved:

    docker service inspect --format '{{json .Spec.TaskTemplate.Resources}}' test
    {
      "Limits": {
        "MemoryBytes": 209715200
      },
      "Reservations": {
        "MemoryBytes": 209715200
      }
    }

After this change:
----------------------------------------------------

Create a service with reservations and limits for memory and cpu:

    docker service create --name test \
      --limit-memory=100M --limit-cpu=1 \
      --reserve-memory=100M --reserve-cpu=1 \
      nginx:alpine

Verify the configuration

    docker service inspect --format '{{json .Spec.TaskTemplate.Resources}}' test
    {
      "Limits": {
        "NanoCPUs": 1000000000,
        "MemoryBytes": 104857600
      },
      "Reservations": {
        "NanoCPUs": 1000000000,
        "MemoryBytes": 104857600
      }
    }

Update just CPU limit and reservation:

    docker service update --limit-cpu=2 --reserve-cpu=2 test

Confirm that the CPU limits/reservations are updated, but memory limit and reservation are preserved:

    docker service inspect --format '{{json .Spec.TaskTemplate.Resources}}' test
    {
      "Limits": {
        "NanoCPUs": 2000000000,
        "MemoryBytes": 104857600
      },
      "Reservations": {
        "NanoCPUs": 2000000000,
        "MemoryBytes": 104857600
      }
    }

Update just Memory limit and reservation:

    docker service update --limit-memory=200M --reserve-memory=200M test

Confirm that the Mempry limits/reservations are updated, but CPU limit and reservation are preserved:

    docker service inspect --format '{{json .Spec.TaskTemplate.Resources}}' test
    {
      "Limits": {
        "NanoCPUs": 2000000000,
        "MemoryBytes": 209715200
      },
      "Reservations": {
        "NanoCPUs": 2000000000,
        "MemoryBytes": 209715200
      }
    }

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-24 01:30:00 +02:00
Simon Ferquel 1f7aa1c036 Add filter support for stack ps and services with Kubernetes
Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
2018-05-23 18:27:27 +02:00
Vincent Demeester cc6ff56fd5
Merge pull request #1035 from mat007/kubernetes-check-hosts-match
For docker stack ls make an error if Swarm and Kubernetes hosts do not match
2018-05-22 14:50:09 +02:00
Mathieu Champlon bfe9aed63a For docker stack ls make an error if Swarm and Kubernetes hosts do no match
Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
2018-05-22 14:39:48 +02:00
Sebastiaan van Stijn 680c5790d5
Merge pull request #1043 from justyntemme/patch-2
Fix issue #850, Warn user of filter when pruning
2018-05-22 00:26:26 +02:00
Victor Vieux 09115e3750
Merge pull request #1069 from thaJeztah/bump-cobra-pflags
Update Cobra and pflag, and use built-in --version feature
2018-05-21 15:23:16 -07:00
Victor Vieux 7bdd820f28
Merge pull request #1054 from thaJeztah/fix-host-rm-being-too-greedy
Fix service update --host-rm not being granular enough
2018-05-21 15:21:06 -07:00
Sebastiaan van Stijn 9a89c32e9a
Merge pull request #1053 from justyntemme/patch-3
Change error message for unreadable files
2018-05-22 00:12:46 +02:00
Anda Xu d2090430a6 fix error message from docker inspect
Signed-off-by: Anda Xu <anda.xu@docker.com>
2018-05-21 11:32:16 -07:00
Sebastiaan van Stijn 00d080269a
Hide [flags] in usage output
This patch hides the [flags] in the usage output of commands, using the
new `.DisableFlagsInUseLine` option, instead of the temporary workaround
added in 8e600e10f7

Before this change:

    docker run
    "docker run" requires at least 1 argument.
    See 'docker run --help'.

    Usage:  docker run [OPTIONS] IMAGE [COMMAND] [ARG...] [flags]

    Run a command in a new container

After this change:

    docker run
    "docker run" requires at least 1 argument.
    See 'docker run --help'.

    Usage:  docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

    Run a command in a new container

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-19 02:51:55 +02:00
Sebastiaan van Stijn a3fe7d62b8
Use Cobra built-in --version feature
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-19 02:51:43 +02:00
Vincent Demeester b15c3cfec9
Merge pull request #1065 from thaJeztah/fix-kube-alignment
Fix component information alignment
2018-05-18 14:54:42 +02:00
Sebastiaan van Stijn 26d8122594
Fix component information alignment
The `docker version` output now uses a tabwriter, so use single
tabs to print the output.

Before this change:

    Server:
     Engine:
      Version:      18.05.0-ce
      API version:  1.37 (minimum version 1.12)
      Go version:   go1.10.1
      Git commit:   f150324
      Built:        Wed May  9 22:20:16 2018
      OS/Arch:      linux/amd64
      Experimental: true
     Kubernetes:
      Version:     v1.9.6
      StackAPI:                   v1beta2

After this change:

    Server:
     Engine:
      Version:      18.05.0-ce
      API version:  1.37 (minimum version 1.12)
      Go version:   go1.10.1
      Git commit:   f150324
      Built:        Wed May  9 22:20:16 2018
      OS/Arch:      linux/amd64
      Experimental: true
     Kubernetes:
      Version:     v1.9.6
      StackAPI:    v1beta2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-18 14:46:23 +02:00
Mathieu Champlon bd20885ac8 Query UCP Kubernetes user namespaces endpoint
Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
2018-05-18 11:44:15 +02:00
Mathieu Champlon 5d54584f03 Bump moby to d37f5c6bdf788a6cb82c07fb707e31a240eff5f9
Also bringing:
. golang.org/x/net 5561cd9b4330353950f399814f427425c0a26fd2
. github.com/docker/distribution 83389a148052d74ac602f5f1d62f86ff2f3c4aa5
. github.com/docker/swarmkit bd69f6e8e301645afd344913fa1ede53a0a111fb
. github.com/docker/go-metrics d466d4f6fd960e01820085bd7e1a24426ee7ef18
. github.com/prometheus/client_golang 52437c81da6b127a9925d17eb3a382a2e5fd395e
. github.com/beorn7/perks 4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9
. github.com/prometheus/client_model fa8ad6fec33561be4280a8f0514318c79d7f6cb6
. github.com/prometheus/common ebdfc6da46522d58825777cf1f90490a5b1ef1d8
. github.com/prometheus/procfs abf152e5f3e97f2fafac028d2cc06c1feb87ffa5
. github.com/matttproud/golang_protobuf_extensions v1.0.0

Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
2018-05-18 11:44:14 +02:00
Sebastiaan van Stijn bac0d8f353
Merge pull request #974 from simonferquel/compose-kube-env-expansion
[K8s] Do env-variable expansion on the uninterpreted Config files
2018-05-16 20:18:41 +02:00
Mathieu Champlon 84241cc393 Support multiple namespaces for docker stack ls
Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
2018-05-15 16:52:21 +02:00
Mathieu Champlon 4d947de292 Support 'all' in orchestrator flag for docker stack ls
All other docker stack commands report an error when passed this value.

Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
2018-05-15 15:38:41 +02:00
Vincent Demeester 161bc1ed3c
Merge pull request #1055 from mat007/fix-invalid-orchestrator-silently-ignored
Make an error for an invalid orchestrator
2018-05-14 15:34:01 +02:00
Vincent Demeester 74d86d4b2e
Merge pull request #1052 from thaJeztah/fix-rollback-config
Fix service rollback options being cross-wired
2018-05-14 11:01:56 +02:00