Rename AppArmor annotation constants with Deprecated
This commit is contained in:
@@ -541,7 +541,7 @@ func dropDisabledFields(
|
||||
|
||||
if !utilfeature.DefaultFeatureGate.Enabled(features.AppArmor) && !appArmorInUse(oldPodAnnotations, oldPodSpec) {
|
||||
for k := range podAnnotations {
|
||||
if strings.HasPrefix(k, api.AppArmorContainerAnnotationKeyPrefix) {
|
||||
if strings.HasPrefix(k, api.DeprecatedAppArmorAnnotationKeyPrefix) {
|
||||
delete(podAnnotations, k)
|
||||
}
|
||||
}
|
||||
@@ -954,7 +954,7 @@ func appArmorInUse(podAnnotations map[string]string, podSpec *api.PodSpec) bool
|
||||
}
|
||||
|
||||
for k := range podAnnotations {
|
||||
if strings.HasPrefix(k, api.AppArmorContainerAnnotationKeyPrefix) {
|
||||
if strings.HasPrefix(k, api.DeprecatedAppArmorAnnotationKeyPrefix) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -714,7 +714,7 @@ func TestDropAppArmor(t *testing.T) {
|
||||
description: "with AppArmor Annotations",
|
||||
hasAppArmor: true,
|
||||
pod: api.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{Annotations: map[string]string{"a": "1", v1.AppArmorBetaContainerAnnotationKeyPrefix + "foo": "default"}},
|
||||
ObjectMeta: metav1.ObjectMeta{Annotations: map[string]string{"a": "1", v1.DeprecatedAppArmorBetaContainerAnnotationKeyPrefix + "foo": "default"}},
|
||||
Spec: api.PodSpec{},
|
||||
},
|
||||
}, {
|
||||
|
||||
Reference in New Issue
Block a user