addons

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareVersions added in v0.7.0

func CompareVersions(a, b string) int

CompareVersions compares EKS addon version strings such as "v1.18.1-eksbuild.3", returning >0 when a is newer than b. Exported for the upgrade orchestrator's already-satisfied checks.

Types

type AddonDetails

type AddonDetails struct {
	Name               string         `json:"name"`
	Version            string         `json:"version"`
	Status             string         `json:"status"`
	Health             string         `json:"health"`
	ARN                string         `json:"arn"`
	ServiceAccountRole string         `json:"serviceAccountRole,omitempty"`
	CreatedAt          *time.Time     `json:"createdAt,omitempty"`
	ModifiedAt         *time.Time     `json:"modifiedAt,omitempty"`
	Configuration      map[string]any `json:"configuration,omitempty"`
	Issues             []AddonIssue   `json:"issues,omitempty"`
	AvailableVersions  []string       `json:"availableVersions,omitempty"`
}

AddonDetails contains expanded addon information

type AddonIssue

type AddonIssue struct {
	Code        string   `json:"code"`
	Message     string   `json:"message"`
	ResourceIDs []string `json:"resourceIds,omitempty"`
}

AddonIssue represents an issue reported by an addon

type AddonSummary

type AddonSummary struct {
	Name    string `json:"name"`
	Version string `json:"version"`
	Status  string `json:"status"`
	Health  string `json:"health"`
}

AddonSummary contains basic addon info for listings

func SortByDependency added in v0.7.0

func SortByDependency(addons []AddonSummary) []AddonSummary

SortByDependency returns the addons reordered so that dependencies update before their dependents (vpc-cni before coredns/kube-proxy, etc.). Exported for the upgrade orchestrator, which sequences per-addon updates itself.

type AddonUpdateResult

type AddonUpdateResult struct {
	AddonName       string    `json:"addonName"`
	PreviousVersion string    `json:"previousVersion"`
	NewVersion      string    `json:"newVersion"`
	UpdateID        string    `json:"updateId"`
	Status          string    `json:"status"`
	HealthIssues    string    `json:"healthIssues,omitempty"`
	StartedAt       time.Time `json:"startedAt"`
}

AddonUpdateResult contains the result of an addon update

type AddonVersionInfo

type AddonVersionInfo struct {
	Version           string   `json:"version"`
	Compatibilities   []string `json:"compatibilities"`
	Architecture      []string `json:"architecture,omitempty"`
	DefaultVersion    bool     `json:"defaultVersion"`
	RequiresIAMPolicy bool     `json:"requiresIamPolicy"`
}

AddonVersionInfo contains version-specific information

type CompatibilityMatrix

type CompatibilityMatrix struct {
	AddonName       string              `json:"addonName"`
	Versions        map[string][]string `json:"versions"`        // addon version -> k8s versions
	DefaultVersions map[string]string   `json:"defaultVersions"` // k8s version -> default addon version
}

CompatibilityMatrix tracks addon version compatibility with Kubernetes versions

type DescribeOptions

type DescribeOptions struct {
	ShowVersions      bool `json:"showVersions"`
	ShowConfiguration bool `json:"showConfiguration"`
}

DescribeOptions controls addon describe behavior

type EKSAPI

type EKSAPI interface {
	ListAddons(ctx context.Context, params *eks.ListAddonsInput, optFns ...func(*eks.Options)) (*eks.ListAddonsOutput, error)
	DescribeAddon(ctx context.Context, params *eks.DescribeAddonInput, optFns ...func(*eks.Options)) (*eks.DescribeAddonOutput, error)
	DescribeAddonVersions(ctx context.Context, params *eks.DescribeAddonVersionsInput, optFns ...func(*eks.Options)) (*eks.DescribeAddonVersionsOutput, error)
	UpdateAddon(ctx context.Context, params *eks.UpdateAddonInput, optFns ...func(*eks.Options)) (*eks.UpdateAddonOutput, error)
	DescribeCluster(ctx context.Context, params *eks.DescribeClusterInput, optFns ...func(*eks.Options)) (*eks.DescribeClusterOutput, error)
}

EKSAPI abstracts the EKS client methods used for addons

type ListOptions

type ListOptions struct {
	ShowHealth bool `json:"showHealth"`
}

ListOptions controls addon listing behavior

type ServiceImpl

type ServiceImpl struct {
	// contains filtered or unexported fields
}

ServiceImpl is the addon service.

func NewService

func NewService(eksClient EKSAPI, logger *slog.Logger) *ServiceImpl

func (*ServiceImpl) AddonStatus added in v0.7.0

func (s *ServiceImpl) AddonStatus(ctx context.Context, clusterName, addonName string) (version string, status ekstypes.AddonStatus, err error)

AddonStatus returns the addon's currently installed version and raw EKS lifecycle status (no health mapping), for callers that need to make control-flow decisions — e.g. the upgrade orchestrator attaching to an in-flight update on resume rather than re-submitting it.

func (*ServiceImpl) Describe

func (s *ServiceImpl) Describe(ctx context.Context, clusterName, addonName string, options DescribeOptions) (*AddonDetails, error)

Describe returns detailed information about an addon

func (*ServiceImpl) EKS added in v0.7.0

func (s *ServiceImpl) EKS() EKSAPI

NewService creates a new addon service EKS returns the underlying EKS client abstraction so the command layer can do lightweight lookups (e.g. resolving an add-on name) without building a second client. EKSAPI includes ListAddons, so it satisfies the resolver's interface.

func (*ServiceImpl) GetAvailableVersions

func (s *ServiceImpl) GetAvailableVersions(ctx context.Context, addonName string, k8sVersion string) ([]AddonVersionInfo, error)

GetAvailableVersions returns available versions for an addon, newest first. Pass k8sVersion to restrict results to versions compatible with that Kubernetes version. All pages are fetched and the result is sorted by version (the API does not document an ordering guarantee).

func (*ServiceImpl) List

func (s *ServiceImpl) List(ctx context.Context, clusterName string, options ListOptions) ([]AddonSummary, error)

List returns all addons for a cluster

func (*ServiceImpl) Update

func (s *ServiceImpl) Update(ctx context.Context, clusterName, addonName string, options UpdateOptions) (*AddonUpdateResult, error)

Update updates an addon to a specified version

func (*ServiceImpl) UpdateAll

func (s *ServiceImpl) UpdateAll(ctx context.Context, clusterName string, options UpdateAllOptions) ([]AddonUpdateResult, error)

UpdateAll updates all addons to their latest versions

func (*ServiceImpl) WaitUntilActive added in v0.7.0

func (s *ServiceImpl) WaitUntilActive(ctx context.Context, clusterName, addonName string, timeout, pollInterval time.Duration) error

WaitUntilActive blocks until the addon reaches ACTIVE — attaching to an in-flight update started by a previous run — or the update fails, bounded by timeout. It is the exported entry point the upgrade orchestrator uses to resume an addon that is still CREATING/UPDATING.

type UpdateAllOptions

type UpdateAllOptions struct {
	DryRun          bool          `json:"dryRun"`
	Parallel        bool          `json:"parallel"`
	HealthCheck     bool          `json:"healthCheck"`
	Wait            bool          `json:"wait"`
	WaitTimeout     time.Duration `json:"waitTimeout"`
	SkipAddons      []string      `json:"skipAddons,omitempty"`
	DependencyOrder bool          `json:"dependencyOrder"` // update in dependency-safe order (vpc-cni before coredns/kube-proxy, etc.)
}

UpdateAllOptions controls bulk addon update behavior

type UpdateOptions

type UpdateOptions struct {
	Version       string        `json:"version"`
	DryRun        bool          `json:"dryRun"`
	HealthCheck   bool          `json:"healthCheck"`
	Wait          bool          `json:"wait"`
	WaitTimeout   time.Duration `json:"waitTimeout"`
	PollInterval  time.Duration `json:"pollInterval,omitempty"` // re-check cadence while waiting (default 5s)
	Configuration string        `json:"configuration,omitempty"`
}

UpdateOptions controls addon update behavior

Jump to

Keyboard shortcuts

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