Browse code

daemon/cluster: use string-literals for easier grep'ing

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

Sebastiaan van Stijn authored on 2023/07/05 19:22:14
Showing 3 changed files
... ...
@@ -359,7 +359,7 @@ func (c *Cluster) errNoManager(st nodeState) error {
359 359
 		if st.err == errSwarmCertificatesExpired {
360 360
 			return errSwarmCertificatesExpired
361 361
 		}
362
-		return errors.WithStack(notAvailableError("This node is not a swarm manager. Use \"docker swarm init\" or \"docker swarm join\" to connect this node to swarm and try again."))
362
+		return errors.WithStack(notAvailableError(`This node is not a swarm manager. Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again.`))
363 363
 	}
364 364
 	if st.swarmNode.Manager() != nil {
365 365
 		return errors.WithStack(notAvailableError("This node is not a swarm manager. Manager is being prepared or has trouble connecting to the cluster."))
... ...
@@ -5,13 +5,13 @@ const (
5 5
 	errNoSwarm notAvailableError = "This node is not part of a swarm"
6 6
 
7 7
 	// errSwarmExists is returned on initialize or join request for a cluster that has already been activated
8
-	errSwarmExists notAvailableError = "This node is already part of a swarm. Use \"docker swarm leave\" to leave this swarm and join another one."
8
+	errSwarmExists notAvailableError = `This node is already part of a swarm. Use "docker swarm leave" to leave this swarm and join another one.`
9 9
 
10 10
 	// errSwarmJoinTimeoutReached is returned when cluster join could not complete before timeout was reached.
11
-	errSwarmJoinTimeoutReached notAvailableError = "Timeout was reached before node 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."
11
+	errSwarmJoinTimeoutReached notAvailableError = `Timeout was reached before node 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.`
12 12
 
13 13
 	// errSwarmLocked is returned if the swarm is encrypted and needs a key to unlock it.
14
-	errSwarmLocked notAvailableError = "Swarm is encrypted and needs to be unlocked before it can be used. Please use \"docker swarm unlock\" to unlock it."
14
+	errSwarmLocked notAvailableError = `Swarm is encrypted and needs to be unlocked before it can be used. Please use "docker swarm unlock" to unlock it.`
15 15
 
16 16
 	// errSwarmCertificatesExpired is returned if docker was not started for the whole validity period and they had no chance to renew automatically.
17 17
 	errSwarmCertificatesExpired notAvailableError = "Swarm certificates have expired. To replace them, leave the swarm and join again."
... ...
@@ -456,7 +456,7 @@ func (c *Cluster) ServiceLogs(ctx context.Context, selector *backend.LogSelector
456 456
 	} else {
457 457
 		t, err := strconv.Atoi(config.Tail)
458 458
 		if err != nil {
459
-			return nil, errors.New("tail value must be a positive integer or \"all\"")
459
+			return nil, errors.New(`tail value must be a positive integer or "all"`)
460 460
 		}
461 461
 		if t < 0 {
462 462
 			return nil, errors.New("negative tail values not supported")