Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PersistIdentity ¶
PersistIdentity persists identity to either K8s secret or file based on configuration
func ShouldReenroll ¶
func ShouldReenroll(agentIdentifier *AgentIdentifier, identity *PersistedIdentity) bool
ShouldReenroll checks whether the persisted identity needs refreshing. Re-enrollment is only supported for the node agent.
Types ¶
type AgentIdentifier ¶
func GetAgentIdentifier ¶
func GetAgentIdentifier(ctx context.Context, hostnameGetter hostnameinterface.Component) (*AgentIdentifier, error)
GetAgentIdentifier returns the identifier for the current agent. Hostname is always populated. For the cluster agent, OrchClusterID is also populated (required).
type PersistedIdentity ¶
type PersistedIdentity struct {
PrivateKey string `json:"private_key"`
URN string `json:"urn"`
Hostname string `json:"hostname,omitempty"`
OrchClusterID string `json:"orch_cluster_id,omitempty"`
}
func GetIdentityFromPreviousEnrollment ¶
func GetIdentityFromPreviousEnrollment(ctx context.Context, cfg configModel.Reader) (*PersistedIdentity, error)
GetIdentityFromPreviousEnrollment retrieves PAR identity from either K8s secret or file based on configuration
type Result ¶
type Result struct {
PrivateKey *ecdsa.PrivateKey
URN string
Hostname string
RunnerName string
OrchClusterID string
}
Result contains the result of a successful enrollment
func SelfEnroll ¶
func SelfEnroll( ctx context.Context, ddSite, runnerNamePrefix, apiKey, appKey string, agentIdentifier *AgentIdentifier, extraHeaders map[string]string, ) (*Result, error)
SelfEnroll performs self-registration using API key + application key.
func SelfEnrollApiKeyOnly ¶
func SelfEnrollApiKeyOnly( ctx context.Context, ddSite, runnerNamePrefix, apiKey string, agentIdentifier *AgentIdentifier, extraHeaders map[string]string, ) (*Result, error)
SelfEnrollApiKeyOnly performs self-registration using only an API key (no application key).