addons

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 11 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]interface{} `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 AddonSecurityFinding

type AddonSecurityFinding struct {
	AddonName        string   `json:"addonName"`
	Severity         string   `json:"severity"` // critical, high, medium, low, info
	Category         string   `json:"category"` // outdated, vulnerability, misconfiguration
	Title            string   `json:"title"`
	Description      string   `json:"description"`
	Remediation      string   `json:"remediation,omitempty"`
	AffectedVersions []string `json:"affectedVersions,omitempty"`
}

AddonSecurityFinding represents a security finding for 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"`
	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 SecurityScanOptions

type SecurityScanOptions struct {
	CheckOutdated          bool   `json:"checkOutdated"`
	CheckVulnerabilities   bool   `json:"checkVulnerabilities"`
	CheckMisconfigurations bool   `json:"checkMisconfigurations"`
	MinSeverity            string `json:"minSeverity"` // critical, high, medium, low, info
}

SecurityScanOptions controls security scanning behavior

type SecurityScanResult

type SecurityScanResult struct {
	ClusterName string                 `json:"clusterName"`
	ScannedAt   time.Time              `json:"scannedAt"`
	Findings    []AddonSecurityFinding `json:"findings"`
	Summary     SecuritySummary        `json:"summary"`
}

SecurityScanResult contains the results of a security scan

type SecuritySummary

type SecuritySummary struct {
	TotalAddons   int `json:"totalAddons"`
	ScannedAddons int `json:"scannedAddons"`
	CriticalCount int `json:"criticalCount"`
	HighCount     int `json:"highCount"`
	MediumCount   int `json:"mediumCount"`
	LowCount      int `json:"lowCount"`
	InfoCount     int `json:"infoCount"`
	OutdatedCount int `json:"outdatedCount"`
}

SecuritySummary provides a summary of security findings

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)
	SecurityScan(ctx context.Context, clusterName string, options SecurityScanOptions) (*SecurityScanResult, 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) SecurityScan

func (s *ServiceImpl) SecurityScan(ctx context.Context, clusterName string, options SecurityScanOptions) (*SecurityScanResult, error)

SecurityScan performs a security analysis of cluster addons

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

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