Documentation
¶
Overview ¶
Package cluster implements various functions for working with Argo CD cluster configuration.
Its main component is the cluster manager Manager, which essentially manages Argo CD cluster secrets and maps them to agents.
Index ¶
- Constants
- Variables
- func ClusterToSecret(c *v1alpha1.Cluster, secret *v1.Secret) error
- type Manager
- func (m *Manager) HasMapping(agent string) bool
- func (m *Manager) MapCluster(agent string, cluster *v1alpha1.Cluster) error
- func (m *Manager) Mapping(agent string) *v1alpha1.Cluster
- func (m *Manager) Start() error
- func (m *Manager) Stop() error
- func (m *Manager) UnmapCluster(agent string) error
- func (m *Manager) UpdateClusterConnectionInfo(agentName, status string, t time.Time)
Constants ¶
const LabelKeyClusterAgentMapping = "argocd-agent.argoproj-labs.io/agent-name"
const LabelValueManagerName = "argocd-agent"
Variables ¶
var ErrAlreadyMapped = errors.New("agent already mapped")
ErrAlreadyMapped indicates that an agent has a cluster mapped to it already
var ErrNotMapped = errors.New("agent not mapped")
ErrNotMapped indicates that an agent has no cluster mapped to it
Functions ¶
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages Argo CD cluster secrets on the principal
func NewManager ¶
func NewManager(ctx context.Context, namespace, redisAddress string, redisCompressionType cacheutil.RedisCompressionType, kubeclient kubernetes.Interface) (*Manager, error)
NewManager instantiates and initializes a new Manager.
func (*Manager) HasMapping ¶
HasMapping returns true when the manager has a cluster mapping for an agent with the given name.
func (*Manager) MapCluster ¶
MapCluster maps the given cluster to the agent with the given name. It may return an error if the agent has a cluster mapped to it already.
func (*Manager) Mapping ¶
Mapping returns the cluster mapping for an agent with the given name. If the agent has no cluster mapped to it, Mapping returns nil.
func (*Manager) Start ¶
Start starts the manager m and its informer. Start waits for the informer to be synced before returning. If the informer could not sync before the timeout expires, Start will return an error.
func (*Manager) UnmapCluster ¶
UnmapCluster removes the mapping for an agent with the given name. If there is no mapping for the agent, UnmapCluster will return an error.