You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: daemon/cluster/cluster.go
+50-30Lines changed: 50 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
package cluster
2
2
3
3
import (
4
+
"crypto/x509"
4
5
"encoding/json"
5
6
stdliberrors "errors"
6
7
"fmt"
@@ -27,6 +28,7 @@ import (
27
28
types "github.com/docker/engine-api/types/swarm"
28
29
swarmagent "github.com/docker/swarmkit/agent"
29
30
swarmapi "github.com/docker/swarmkit/api"
31
+
pkgerrors "github.com/pkg/errors"
30
32
"golang.org/x/net/context"
31
33
)
32
34
@@ -54,6 +56,9 @@ var ErrPendingSwarmExists = fmt.Errorf("This node is processing an existing join
54
56
// ErrSwarmJoinTimeoutReached is returned when cluster join could not complete before timeout was reached.
55
57
varErrSwarmJoinTimeoutReached=fmt.Errorf("Timeout was reached before node was joined. The attempt to join the swarm will continue in the background. Use the \"docker info\" command to see the current swarm status of your node.")
56
58
59
+
// ErrSwarmCertificatesExipred is returned if docker was not started for the whole validity period and they had no chance to renew automatically.
60
+
varErrSwarmCertificatesExpired=pkgerrors.New("Swarm certificates have expired. To replace them, leave the swarm and join again.")
61
+
57
62
// defaultSpec contains some sane defaults if cluster options are missing on init
msg+="Removing the last manager erases all current state of the swarm. Use `--force` to ignore this message. "
545
+
c.Unlock()
546
+
returnfmt.Errorf(msg)
547
+
}
548
+
msg+=fmt.Sprintf("Removing this node leaves %v managers out of %v. Without a Raft quorum your swarm will be inaccessible. ", reachable-1, reachable+unreachable)
534
549
}
535
-
msg+=fmt.Sprintf("Removing this node leaves %v managers out of %v. Without a Raft quorum your swarm will be inaccessible. ", reachable-1, reachable+unreachable)
536
550
}
551
+
} else {
552
+
msg+="Doing so may lose the consensus of your cluster. "
537
553
}
538
-
} else {
539
-
msg+="Doing so may lose the consensus of your cluster. "
540
-
}
541
554
542
-
msg+="The only way to restore a swarm that has lost consensus is to reinitialize it with `--force-new-cluster`. Use `--force` to suppress this message."
543
-
c.Unlock()
544
-
returnfmt.Errorf(msg)
545
-
}
546
-
iferr:=c.stopNode(); err!=nil {
555
+
msg+="The only way to restore a swarm that has lost consensus is to reinitialize it with `--force-new-cluster`. Use `--force` to suppress this message."
0 commit comments