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 ¶
- type Mock
- func (m *Mock) CreateAddon(_ context.Context, cfg eksdriver.AddonConfig) (*eksdriver.Addon, error)
- func (m *Mock) CreateCluster(_ context.Context, cfg eksdriver.ClusterConfig) (*eksdriver.Cluster, error)
- func (m *Mock) CreateFargateProfile(_ context.Context, cfg eksdriver.FargateProfileConfig) (*eksdriver.FargateProfile, error)
- func (m *Mock) CreateNodegroup(_ context.Context, cfg eksdriver.NodegroupConfig) (*eksdriver.Nodegroup, error)
- func (m *Mock) DeleteAddon(_ context.Context, clusterName, addonName string) (*eksdriver.Addon, error)
- func (m *Mock) DeleteCluster(_ context.Context, name string) (*eksdriver.Cluster, error)
- func (m *Mock) DeleteFargateProfile(_ context.Context, clusterName, profileName string) (*eksdriver.FargateProfile, error)
- func (m *Mock) DeleteNodegroup(_ context.Context, clusterName, nodegroupName string) (*eksdriver.Nodegroup, error)
- func (m *Mock) DescribeAddon(_ context.Context, clusterName, addonName string) (*eksdriver.Addon, error)
- func (m *Mock) DescribeCluster(_ context.Context, name string) (*eksdriver.Cluster, error)
- func (m *Mock) DescribeFargateProfile(_ context.Context, clusterName, profileName string) (*eksdriver.FargateProfile, error)
- func (m *Mock) DescribeNodegroup(_ context.Context, clusterName, nodegroupName string) (*eksdriver.Nodegroup, error)
- func (m *Mock) ListAddons(_ context.Context, clusterName string) ([]string, error)
- func (m *Mock) ListClusters(_ context.Context) ([]string, error)
- func (m *Mock) ListFargateProfiles(_ context.Context, clusterName string) ([]string, error)
- func (m *Mock) ListNodegroups(_ context.Context, clusterName string) ([]string, error)
- func (m *Mock) SetK8sAPI(api *kubernetes.APIServer)
- func (m *Mock) SetMonitoring(mon mondriver.Monitoring)
- func (m *Mock) UpdateAddon(_ context.Context, cfg eksdriver.AddonConfig) (*eksdriver.ClusterUpdate, error)
- func (m *Mock) UpdateClusterConfig(_ context.Context, name string, cfg eksdriver.VPCConfig, ...) (*eksdriver.ClusterUpdate, error)
- func (m *Mock) UpdateClusterVersion(_ context.Context, name, version string) (*eksdriver.ClusterUpdate, error)
- func (m *Mock) UpdateNodegroupConfig(_ context.Context, clusterName, nodegroupName string, ...) (*eksdriver.ClusterUpdate, error)
- func (m *Mock) UpdateNodegroupVersion(_ context.Context, clusterName, nodegroupName, version, releaseVersion string) (*eksdriver.ClusterUpdate, error)
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 (*Mock) CreateAddon ¶
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 (*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 ¶
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 ¶
ListAddons returns the names of all add-ons installed on a cluster.
func (*Mock) ListClusters ¶
ListClusters returns the names of all clusters.
func (*Mock) ListFargateProfiles ¶
ListFargateProfiles returns the names of all profiles in a cluster.
func (*Mock) ListNodegroups ¶
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 ¶
func (m *Mock) UpdateAddon(_ context.Context, cfg eksdriver.AddonConfig) (*eksdriver.ClusterUpdate, error)
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.