Skip to content

Do not clear swarm directory on swarm init and swarm join#33341

Merged
aaronlehmann merged 1 commit intomoby:masterfrom
cyli:do-not-clear-state-on-swarm-init-join
May 23, 2017
Merged

Do not clear swarm directory on swarm init and swarm join#33341
aaronlehmann merged 1 commit intomoby:masterfrom
cyli:do-not-clear-state-on-swarm-init-join

Conversation

@cyli
Copy link
Contributor

@cyli cyli commented May 22, 2017

However, this continues to clear the directory if init fails, because we don't want to leave it in a half-finished state.

This would fix #33216 to be compatible with the method for pre-generating external CA certs that was in 17.03.

After some discussion with @aaronlehmann and @tonistiigi, this is probably the correct behavior (unless the state dir can get corrupted?) either way.

This would also allow the extra flags as suggested in #33216 to be added after 17.06 if necessary.

@aaronlehmann
Copy link

Do we need to also clear the state if a join operation fails (<-nr.Ready() provides an error)?

@cyli
Copy link
Contributor Author

cyli commented May 22, 2017

@aaronlehmann That seems like a good idea - is there any reason we'd want to keep state from prior to a join, though?

Similarly, if init fails, the pre-generated certificates would also be wiped out, which seems ok to me but may be inconvenient for users to have to re-generate (although I'd like to deprecate having to do that anyway).

@aaronlehmann
Copy link

is there any reason we'd want to keep state from prior to a join, though?

I don't think so.

I think the reason we need to remove it after a failed join is to avoid ending up with an inconsistent state that prevents a second swarm join operation from succeeding.

@tonistiigi
Copy link
Member

@cyli build error in ci

@cyli
Copy link
Contributor Author

cyli commented May 23, 2017

@tonistiigi Oops, sorry, thanks!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think c.nr should be cleared whether the state clearing fails or not.

…join now.

However, do clear the directory if init or join fails, because we don't
want to leave it in a half-finished state.

Signed-off-by: Ying Li <ying.li@docker.com>
@tonistiigi
Copy link
Member

LGTM

1 similar comment
@aaronlehmann
Copy link

LGTM

@aaronlehmann aaronlehmann merged commit a9fcaee into moby:master May 23, 2017
@GordonTheTurtle GordonTheTurtle added this to the 17.06.0 milestone May 23, 2017
@cyli cyli deleted the do-not-clear-state-on-swarm-init-join branch May 23, 2017 19:10
@aaronlehmann
Copy link

@cyli: Does this need to be cherry-picked in 17.06?

@thaJeztah: @GordonTheTurtle added a 17.06.0 milestone automatically, but I believe this is an error, since 17.06 has already branched.

@cyli
Copy link
Contributor Author

cyli commented May 23, 2017

@aaronlehmann Yes that would be ideal, thank you.

@thaJeztah
Copy link
Member

@aaronlehmann 17.06 already branched, but we may have to remove milestones from this repository, because moby milestones != docker milestones

@aaronlehmann
Copy link

aaronlehmann commented May 24, 2017 via email

@thaJeztah
Copy link
Member

I added the cherry-pick label for visibility, but not sure at this moment what to do with the VERSION and "milestones" until I know what the replacement is for keeping track

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

External CA is not being accepted by new swarm node

5 participants