addons

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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

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 Service

type Service interface {
	List(ctx context.Context, clusterName string, options ListOptions) ([]AddonSummary, error)
	Describe(ctx context.Context, clusterName, addonName string, options DescribeOptions) (*AddonDetails, error)
	Update(ctx context.Context, clusterName, addonName string, options UpdateOptions) (*AddonUpdateResult, error)
	UpdateAll(ctx context.Context, clusterName string, options UpdateAllOptions) ([]AddonUpdateResult, error)
	GetAvailableVersions(ctx context.Context, addonName string, k8sVersion string) ([]AddonVersionInfo, error)
}

Service defines addon operations

type ServiceImpl

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

ServiceImpl implements the addon Service

func NewService

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

NewService creates a new addon service

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

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

GetAvailableVersions returns available versions for an addon.

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

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"`
	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