Skip to content

Kubectl edit is not honoring appArmorProfile update for k8s deployments #1764

@rickypeng99

Description

@rickypeng99

What happened:
When updating a k8s deployment that was using the old annotation approach to the new security context approach, the edit will go though, but the deployment remains unchanged

What you expected to happen:
The change should be applied to the deployment

How to reproduce it (as minimally and precisely as possible):

  1. Create a dummy k8s deployment with annotation under template:
    annotations:
      container.apparmor.security.beta.kubernetes.io/test-container: localhost/test_container_profile
    
  2. Edit the deployment to remove the annotation and edit the securityContext to be
     securityContext:
       appArmorProfile:
           type: "Localhost"
           localhostProfile: "test_container_profile"
    
  3. Obeserve that the edit will go though, but if you edit / describe it again, the annotation is gone, but the securityContext update is not there.

Anything else we need to know?:

Environment:

  • Kubernetes client and server versions (use kubectl version):
    • Client Version: v1.33.2
    • Kustomize Version: v5.6.0
    • Server Version: v1.32.5-eks-5d4a308
  • Cloud provider or hardware configuration: AWS EKS
  • OS (e.g: cat /etc/os-release): MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions