github.com/demonoid81/moby@v0.0.0-20200517203328-62dd8e17c460/daemon/cluster/errors.go (about)

     1  package cluster // import "github.com/demonoid81/moby/daemon/cluster"
     2  
     3  const (
     4  	// errNoSwarm is returned on leaving a cluster that was never initialized
     5  	errNoSwarm notAvailableError = "This node is not part of a swarm"
     6  
     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."
     9  
    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."
    12  
    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."
    15  
    16  	// errSwarmCertificatesExpired is returned if docker was not started for the whole validity period and they had no chance to renew automatically.
    17  	errSwarmCertificatesExpired notAvailableError = "Swarm certificates have expired. To replace them, leave the swarm and join again."
    18  
    19  	// errSwarmNotManager is returned if the node is not a swarm manager.
    20  	errSwarmNotManager notAvailableError = "This node is not a swarm manager. Worker nodes can't be used to view or modify cluster state. Please run this command on a manager node or promote the current node to a manager."
    21  )
    22  
    23  type notAllowedError string
    24  
    25  func (e notAllowedError) Error() string {
    26  	return string(e)
    27  }
    28  
    29  func (e notAllowedError) Forbidden() {}
    30  
    31  type notAvailableError string
    32  
    33  func (e notAvailableError) Error() string {
    34  	return string(e)
    35  }
    36  
    37  func (e notAvailableError) Unavailable() {}
    38  
    39  type configError string
    40  
    41  func (e configError) Error() string {
    42  	return string(e)
    43  }
    44  
    45  func (e configError) InvalidParameter() {}
    46  
    47  type invalidUnlockKey struct{}
    48  
    49  func (invalidUnlockKey) Error() string {
    50  	return "swarm could not be unlocked: invalid key provided"
    51  }
    52  
    53  func (invalidUnlockKey) Unauthorized() {}
    54  
    55  type notLockedError struct{}
    56  
    57  func (notLockedError) Error() string {
    58  	return "swarm is not locked"
    59  }
    60  
    61  func (notLockedError) Conflict() {}