eks

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package eks provides an in-memory mock of AWS EKS — Wave 1 covers the control plane only (clusters, managed node groups, Fargate profiles, and add-ons). The Kubernetes data plane is out of scope and will be Wave 2; for now the cluster Endpoint and CertificateAuthority fields return placeholder values so kubeconfig generation works syntactically without a real apiserver.

The mock implements eks/driver.EKS so the same backend serves both the SDK-compat HTTP handler in server/aws/eks and any direct programmatic access from Go test code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mock

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

Mock is the in-memory AWS EKS implementation.

func New

func New(opts *config.Options) *Mock

New creates a new AWS EKS mock.

func (*Mock) CreateAddon

func (m *Mock) CreateAddon(_ context.Context, cfg eksdriver.AddonConfig) (*eksdriver.Addon, error)

CreateAddon installs a new add-on on a cluster.

func (*Mock) CreateCluster

func (m *Mock) CreateCluster(_ context.Context, cfg eksdriver.ClusterConfig) (*eksdriver.Cluster, error)

CreateCluster creates a new cluster.

func (*Mock) CreateFargateProfile

func (m *Mock) CreateFargateProfile(
	_ context.Context, cfg eksdriver.FargateProfileConfig,
) (*eksdriver.FargateProfile, error)

CreateFargateProfile creates a new Fargate profile in the named cluster.

func (*Mock) CreateNodegroup

func (m *Mock) CreateNodegroup(_ context.Context, cfg eksdriver.NodegroupConfig) (*eksdriver.Nodegroup, error)

CreateNodegroup creates a new managed node group.

func (*Mock) DeleteAddon

func (m *Mock) DeleteAddon(_ context.Context, clusterName, addonName string) (*eksdriver.Addon, error)

DeleteAddon removes an add-on from a cluster.

func (*Mock) DeleteCluster

func (m *Mock) DeleteCluster(_ context.Context, name string) (*eksdriver.Cluster, error)

func (*Mock) DeleteFargateProfile

func (m *Mock) DeleteFargateProfile(
	_ context.Context, clusterName, profileName string,
) (*eksdriver.FargateProfile, error)

DeleteFargateProfile removes a Fargate profile.

func (*Mock) DeleteNodegroup

func (m *Mock) DeleteNodegroup(_ context.Context, clusterName, nodegroupName string) (*eksdriver.Nodegroup, error)

DeleteNodegroup removes a nodegroup.

func (*Mock) DescribeAddon

func (m *Mock) DescribeAddon(_ context.Context, clusterName, addonName string) (*eksdriver.Addon, error)

DescribeAddon looks up an add-on by cluster + name.

func (*Mock) DescribeCluster

func (m *Mock) DescribeCluster(_ context.Context, name string) (*eksdriver.Cluster, error)

DescribeCluster looks up a cluster by name.

func (*Mock) DescribeFargateProfile

func (m *Mock) DescribeFargateProfile(
	_ context.Context, clusterName, profileName string,
) (*eksdriver.FargateProfile, error)

DescribeFargateProfile looks up a profile by cluster + name.

func (*Mock) DescribeNodegroup

func (m *Mock) DescribeNodegroup(_ context.Context, clusterName, nodegroupName string) (*eksdriver.Nodegroup, error)

DescribeNodegroup looks up a nodegroup by cluster + name.

func (*Mock) ListAddons

func (m *Mock) ListAddons(_ context.Context, clusterName string) ([]string, error)

ListAddons returns the names of all add-ons installed on a cluster.

func (*Mock) ListClusters

func (m *Mock) ListClusters(_ context.Context) ([]string, error)

ListClusters returns the names of all clusters.

func (*Mock) ListFargateProfiles

func (m *Mock) ListFargateProfiles(_ context.Context, clusterName string) ([]string, error)

ListFargateProfiles returns the names of all profiles in a cluster.

func (*Mock) ListNodegroups

func (m *Mock) ListNodegroups(_ context.Context, clusterName string) ([]string, error)

ListNodegroups returns the names of all nodegroups in a cluster.

func (*Mock) SetK8sAPI added in v1.6.3

func (m *Mock) SetK8sAPI(api *kubernetes.APIServer)

SetK8sAPI wires a shared in-memory Kubernetes data-plane server. After this is set, CreateCluster registers a fresh ClusterState with api and DescribeCluster returns an Endpoint that points at it. Pass the same *kubernetes.APIServer as awsserver.Drivers.K8sAPI when constructing the SDK-compat server, so kubeconfigs land on the right backend.

func (*Mock) SetMonitoring

func (m *Mock) SetMonitoring(mon mondriver.Monitoring)

SetMonitoring wires a CloudWatch-style backend for auto-metric emission.

func (*Mock) UpdateAddon

UpdateAddon updates an installed add-on (version, configuration, etc.).

func (*Mock) UpdateClusterConfig

func (m *Mock) UpdateClusterConfig(
	_ context.Context, name string, cfg eksdriver.VPCConfig, tags map[string]string,
) (*eksdriver.ClusterUpdate, error)

UpdateClusterConfig records a logical update for VPC config / logging / tags. Wave 1 applies the changes synchronously and returns a Successful update so SDK pollers terminate immediately.

func (*Mock) UpdateClusterVersion

func (m *Mock) UpdateClusterVersion(_ context.Context, name, version string) (*eksdriver.ClusterUpdate, error)

UpdateClusterVersion bumps the Kubernetes version of an existing cluster.

func (*Mock) UpdateNodegroupConfig

func (m *Mock) UpdateNodegroupConfig(
	_ context.Context, clusterName, nodegroupName string,
	scaling *eksdriver.NodegroupScalingConfig, labels map[string]string,
) (*eksdriver.ClusterUpdate, error)

UpdateNodegroupConfig applies scaling and label changes to a nodegroup.

func (*Mock) UpdateNodegroupVersion

func (m *Mock) UpdateNodegroupVersion(
	_ context.Context, clusterName, nodegroupName, version, releaseVersion string,
) (*eksdriver.ClusterUpdate, error)

UpdateNodegroupVersion bumps the Kubernetes version of a nodegroup.

Directories

Path Synopsis
Package driver defines the interface for AWS EKS control-plane mocks.
Package driver defines the interface for AWS EKS control-plane mocks.

Jump to

Keyboard shortcuts

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