mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Merge pull request #123424 from haircommander/image-gc-beta
Promote ImageMaximumGCAge to beta
This commit is contained in:
commit
cb989b84c8
@ -887,6 +887,7 @@ const (
|
|||||||
// owner: @haircommander
|
// owner: @haircommander
|
||||||
// kep: http://kep.k8s.io/4210
|
// kep: http://kep.k8s.io/4210
|
||||||
// alpha: v1.29
|
// alpha: v1.29
|
||||||
|
// beta: v1.30
|
||||||
// ImageMaximumGCAge enables the Kubelet configuration field of the same name, allowing an admin
|
// ImageMaximumGCAge enables the Kubelet configuration field of the same name, allowing an admin
|
||||||
// to specify the age after which an image will be garbage collected.
|
// to specify the age after which an image will be garbage collected.
|
||||||
ImageMaximumGCAge featuregate.Feature = "ImageMaximumGCAge"
|
ImageMaximumGCAge featuregate.Feature = "ImageMaximumGCAge"
|
||||||
@ -1007,6 +1008,8 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
|
|||||||
|
|
||||||
HonorPVReclaimPolicy: {Default: false, PreRelease: featuregate.Alpha},
|
HonorPVReclaimPolicy: {Default: false, PreRelease: featuregate.Alpha},
|
||||||
|
|
||||||
|
ImageMaximumGCAge: {Default: true, PreRelease: featuregate.Beta},
|
||||||
|
|
||||||
InTreePluginAWSUnregister: {Default: false, PreRelease: featuregate.Alpha},
|
InTreePluginAWSUnregister: {Default: false, PreRelease: featuregate.Alpha},
|
||||||
|
|
||||||
InTreePluginAzureDiskUnregister: {Default: false, PreRelease: featuregate.Alpha},
|
InTreePluginAzureDiskUnregister: {Default: false, PreRelease: featuregate.Alpha},
|
||||||
@ -1163,8 +1166,6 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
|
|||||||
|
|
||||||
LoadBalancerIPMode: {Default: true, PreRelease: featuregate.Beta},
|
LoadBalancerIPMode: {Default: true, PreRelease: featuregate.Beta},
|
||||||
|
|
||||||
ImageMaximumGCAge: {Default: false, PreRelease: featuregate.Alpha},
|
|
||||||
|
|
||||||
UserNamespacesPodSecurityStandards: {Default: false, PreRelease: featuregate.Alpha},
|
UserNamespacesPodSecurityStandards: {Default: false, PreRelease: featuregate.Alpha},
|
||||||
|
|
||||||
SELinuxMount: {Default: false, PreRelease: featuregate.Alpha},
|
SELinuxMount: {Default: false, PreRelease: featuregate.Alpha},
|
||||||
|
@ -84,7 +84,7 @@ func ValidateKubeletConfiguration(kc *kubeletconfig.KubeletConfiguration, featur
|
|||||||
allErrors = append(allErrors, fmt.Errorf("invalid configuration: imageGCLowThresholdPercent (--image-gc-low-threshold) %v must be less than imageGCHighThresholdPercent (--image-gc-high-threshold) %v", kc.ImageGCLowThresholdPercent, kc.ImageGCHighThresholdPercent))
|
allErrors = append(allErrors, fmt.Errorf("invalid configuration: imageGCLowThresholdPercent (--image-gc-low-threshold) %v must be less than imageGCHighThresholdPercent (--image-gc-high-threshold) %v", kc.ImageGCLowThresholdPercent, kc.ImageGCHighThresholdPercent))
|
||||||
}
|
}
|
||||||
if kc.ImageMaximumGCAge.Duration != 0 && !localFeatureGate.Enabled(features.ImageMaximumGCAge) {
|
if kc.ImageMaximumGCAge.Duration != 0 && !localFeatureGate.Enabled(features.ImageMaximumGCAge) {
|
||||||
allErrors = append(allErrors, fmt.Errorf("invalid configuration: ImageMaximumGCAge feature gate is required for Kubelet configuration option ImageMaximumGCAge"))
|
allErrors = append(allErrors, fmt.Errorf("invalid configuration: ImageMaximumGCAge feature gate is required for Kubelet configuration option imageMaximumGCAge"))
|
||||||
}
|
}
|
||||||
if kc.ImageMaximumGCAge.Duration < 0 {
|
if kc.ImageMaximumGCAge.Duration < 0 {
|
||||||
allErrors = append(allErrors, fmt.Errorf("invalid configuration: imageMaximumGCAge %v must not be negative", kc.ImageMaximumGCAge.Duration))
|
allErrors = append(allErrors, fmt.Errorf("invalid configuration: imageMaximumGCAge %v must not be negative", kc.ImageMaximumGCAge.Duration))
|
||||||
|
@ -526,10 +526,11 @@ func TestValidateKubeletConfiguration(t *testing.T) {
|
|||||||
}, {
|
}, {
|
||||||
name: "imageMaximumGCAge should not be specified without feature gate",
|
name: "imageMaximumGCAge should not be specified without feature gate",
|
||||||
configure: func(conf *kubeletconfig.KubeletConfiguration) *kubeletconfig.KubeletConfiguration {
|
configure: func(conf *kubeletconfig.KubeletConfiguration) *kubeletconfig.KubeletConfiguration {
|
||||||
|
conf.FeatureGates = map[string]bool{"ImageMaximumGCAge": false}
|
||||||
conf.ImageMaximumGCAge = metav1.Duration{Duration: 1}
|
conf.ImageMaximumGCAge = metav1.Duration{Duration: 1}
|
||||||
return conf
|
return conf
|
||||||
},
|
},
|
||||||
errMsg: "invalid configuration: ImageMaximumGCAge feature gate is required for Kubelet configuration option ImageMaximumGCAge",
|
errMsg: "invalid configuration: ImageMaximumGCAge feature gate is required for Kubelet configuration option imageMaximumGCAge",
|
||||||
}, {
|
}, {
|
||||||
name: "imageMaximumGCAge should not be negative",
|
name: "imageMaximumGCAge should not be negative",
|
||||||
configure: func(conf *kubeletconfig.KubeletConfiguration) *kubeletconfig.KubeletConfiguration {
|
configure: func(conf *kubeletconfig.KubeletConfiguration) *kubeletconfig.KubeletConfiguration {
|
||||||
|
Loading…
Reference in New Issue
Block a user