Documentation
¶
Overview ¶
Package providercaps holds the provider-conditional pod-template mutation framework. Both per-feature (feature.ProviderAwareFeature) and global (global.NodeAgentProviderSpec) consumers declare their mutations as a ProviderCapabilityMap and apply them via ApplyProviderCapabilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyProviderCapabilities ¶ added in v1.29.0
func ApplyProviderCapabilities(mgr PodTemplateManager, provider string, caps ProviderCapabilityMap)
ApplyProviderCapabilities applies all provider-conditional mutations. The baseline ("") entry is applied first. The provider-specific entry is then applied: removals run before additions so a provider can replace a baseline item by removing it and re-adding a modified version.
Types ¶
type ContainerMountRef ¶
type ContainerMountRef struct {
VolumeName string
Containers []apicommon.AgentContainerName
}
ContainerMountRef identifies a volume mount by volume name and the containers it should be stripped from. Empty Containers means strip from all containers.
type EnvVarSet ¶
type EnvVarSet struct {
EnvVar corev1.EnvVar
Containers []apicommon.AgentContainerName
InitContainers []apicommon.AgentContainerName
}
EnvVarSet groups an env var with its target containers. Empty Containers means the env var is added to all agent containers. InitContainers lists init containers that should also receive the env var (init containers are not iterated by the all-containers AddEnvVar path).
type PodTemplateManager ¶
type PodTemplateManager interface {
PodTemplateSpec() *corev1.PodTemplateSpec
EnvVar() merger.EnvVarManager
Volume() merger.VolumeManager
VolumeMount() merger.VolumeMountManager
}
PodTemplateManager is the minimal interface ApplyProviderCapabilities needs from a pod-template manager. feature.PodTemplateManagers satisfies it structurally, so callers pass their existing manager unchanged.
type ProviderCapabilities ¶
type ProviderCapabilities struct {
Volumes []VolumeAndMount
EnvVars []EnvVarSet
// RemoveVolumes strips named volumes (vol + all mounts) before provider additions run.
RemoveVolumes []string
// RemoveMounts strips specific container-volume mount pairs before provider additions run.
RemoveMounts []ContainerMountRef
// RemoveEnvVars strips env vars by name before provider additions run.
RemoveEnvVars []string
}
ProviderCapabilities holds the volumes, env vars, and removals for a specific provider entry in a ProviderCapabilityMap.
type ProviderCapabilityMap ¶ added in v1.29.0
type ProviderCapabilityMap = map[string]ProviderCapabilities
ProviderCapabilityMap maps a provider string to its capabilities. The empty string key "" is the baseline applied to all providers first. Provider-specific entries are then applied on top: removals first, additions second.
type VolumeAndMount ¶
type VolumeAndMount struct {
Volume corev1.Volume
Mount corev1.VolumeMount
Containers []apicommon.AgentContainerName
}
VolumeAndMount groups a pod-level volume with a container volume mount. Volume is added to the pod spec; Mount is added to each listed container.