enrollment

package
v0.0.0-...-e70f483 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PersistIdentity

func PersistIdentity(ctx context.Context, cfg configModel.Reader, result *Result) error

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

type AgentIdentifier struct {
	Hostname      string
	OrchClusterID string
}

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).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL