Documentation
¶
Overview ¶
Package argocd provides Argo CD GitOps integration for KSail-Go.
This package is responsible for creating and maintaining Argo CD resources required for local GitOps workflows (e.g., repository Secret and Application).
Implementations must remain credential-free: KSail-Go must not fetch or print Argo CD admin credentials.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EnsureOptions ¶
type EnsureOptions struct {
// RepositoryURL is the Argo CD repository URL, typically an OCI repository.
// Example: oci://local-registry:5000/<repository>
RepositoryURL string
// SourcePath is the path inside the repository to the kustomization root.
// This is derived from the existing `spec.sourceDirectory` setting.
//
// If empty, defaults to "k8s".
SourcePath string
// ApplicationName is the Argo CD Application name.
ApplicationName string
// TargetRevision is the initial revision (tag or digest).
TargetRevision string
}
EnsureOptions configures how KSail ensures Argo CD resources.
type Installer ¶
Installer installs or ensures Argo CD is present in the cluster.
Implementations are expected to be idempotent.
type Manager ¶
type Manager interface {
Ensure(ctx context.Context, opts EnsureOptions) error
UpdateTargetRevision(ctx context.Context, opts UpdateTargetRevisionOptions) error
}
Manager ensures Argo CD GitOps resources exist and can update reconciliation to a new OCI revision.
Implementations are expected to be idempotent.
type ManagerImpl ¶
type ManagerImpl struct {
// contains filtered or unexported fields
}
ManagerImpl implements the Argo CD GitOps manager.
func NewManager ¶
func NewManager(clientset kubernetes.Interface, dyn dynamic.Interface) *ManagerImpl
NewManager creates a manager using provided Kubernetes clients.
This is the primary constructor for unit tests.
func NewManagerFromKubeconfig ¶
func NewManagerFromKubeconfig(kubeconfig string) (*ManagerImpl, error)
NewManagerFromKubeconfig creates a manager by building Kubernetes clients from kubeconfig.
func (*ManagerImpl) Ensure ¶
func (m *ManagerImpl) Ensure(ctx context.Context, opts EnsureOptions) error
Ensure creates or updates the Argo CD repository secret and Application.
func (*ManagerImpl) UpdateTargetRevision ¶
func (m *ManagerImpl) UpdateTargetRevision( ctx context.Context, opts UpdateTargetRevisionOptions, ) error
UpdateTargetRevision updates the Application target revision and optionally requests a hard refresh.
type Status ¶
type Status struct {
// Engine is a human-friendly engine name, e.g. "ArgoCD".
Engine string
// Installed indicates whether Argo CD appears installed.
Installed bool
// ApplicationPresent indicates whether the expected Application exists.
ApplicationPresent bool
// Message is a short user-facing summary.
Message string
}
Status is a lightweight user-facing summary of Argo CD state.
type StatusProvider ¶
StatusProvider returns a lightweight, user-facing status summary.
type UpdateTargetRevisionOptions ¶
type UpdateTargetRevisionOptions struct {
ApplicationName string
TargetRevision string
// HardRefresh requests Argo CD to refresh caches when updating revision.
HardRefresh bool
}
UpdateTargetRevisionOptions configures how KSail updates an Application to a new OCI revision.