Propagate the provided external CA certificate to the external CA object in swarm #1178
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Also, fix some CLI command confusions:
--external-ca
flag is provided, require a--ca-cert
flag as well, otherwisethe external CA is set but the CA certificate is actually rotated to an internal
cert
--ca-cert
flag is provided, require a--ca-key
or--external-ca
flag beprovided 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.
As pointed out in moby/swarmkit#2680, the CA cert is not propagated correctly making it impossible to rotate the CA certificate to an external CA using the CLI.
This also fixes some other confusing ways the CLI worked previously.