Rename AppArmor annotation constants with Deprecated

This commit is contained in:
Tim Allclair
2024-03-04 10:06:42 -08:00
parent ec325b328d
commit 0eb5f52d06
16 changed files with 123 additions and 123 deletions

View File

@@ -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
}
}

View File

@@ -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{},
},
}, {