Skip to content

Conversation

@tallclair
Copy link
Member

@tallclair tallclair commented May 27, 2025

What type of PR is this?

/kind cleanup
/kind api-change

What this PR does / why we need it:

Implement phase 2 of the AppArmor field transition, but continue to suppress annotation warnings when there is a corresponding field. This change is consistent with the way we handle seccomp annotations.

  1. Stop copying fields to annotations (but continue copying annotations -> fields)
  2. Warn when using AppArmor annotations on PodTemplates without a corresponding container-level field

Which issue(s) this PR fixes:

For kubernetes/enhancements#24 (comment)

Does this PR introduce a user-facing change?

[Action Required] AppArmor profiles specified in the pod or container SecurityContext are no longer copied to deprecated AppArmor annotations (prefix `container.apparmor.security.beta.kubernetes.io/`). Anything that inspects the deprecated annotations must be migrated to use the SecurityContext fields instead.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

- [KEP]: https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/24-apparmor/README.md#removing-annotation-support

/sig node
/milestone v1.34
/priority important-longterm

@k8s-ci-robot k8s-ci-robot added the release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. label May 27, 2025
@k8s-ci-robot k8s-ci-robot added this to the v1.34 milestone May 27, 2025
@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API sig/node Categorizes an issue or PR as relevant to SIG Node. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. labels May 27, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 27, 2025
@k8s-ci-robot k8s-ci-robot requested review from sjenning and thockin May 27, 2025 19:29
@tallclair
Copy link
Member Author

/assign @liggitt
/cc @vinayakankugoyal

@k8s-triage-robot
Copy link

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

@vinayakankugoyal
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 28, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 79118bbf786e61ad87208ad4d421bbbec8ee4192

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 30, 2025
@k8s-ci-robot k8s-ci-robot requested a review from liggitt May 30, 2025 23:37
// use of container AppArmor annotation without accompanying field

isPodTemplate := fieldPath != nil // Pod warnings are emitted through applyAppArmorVersionSkew instead.
hasAppArmorField := hasPodAppArmorProfile || (c.SecurityContext != nil && c.SecurityContext.AppArmorProfile != nil)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to reviewers: we weren't checking that the container annotation matched the pod profile here. Rather than extracting the logic from the pod strategy that does that comparison, I decided to just always emit a warning on pod templates when there is a pod-level field but a container level annotation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only warn if the annotation produced a different effective app armor policy for the container... can relocate the helper the pod strategy is using to figure that out to this package if you want

@tallclair
Copy link
Member Author

Reverted the changes to warn unconditionally on annotation usage. PTAL.

@sarthaksarthak9
Copy link
Member

Hello @tallclair
This pr has not been updated for 1 month, so I'd like to check what's the status. If there's anything we can do, please let us know.
The code freeze is starting 02:00 UTC Friday 25th July 2025 (about 3 weeks from now). Please make sure the PR has both lgtm and approved labels before the code freeze. Thanks!

@sarthaksarthak9 sarthaksarthak9 moved this from Pending inclusion to Tracked in [sig-release] Bug Triage Jul 2, 2025
@tallclair
Copy link
Member Author

@liggitt would you mind reviewing this? Or should I find someone else for approval?

@liggitt liggitt moved this to In progress in API Reviews Jul 17, 2025
@liggitt liggitt moved this from In progress to Changes requested in API Reviews Jul 17, 2025
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 17, 2025
@liggitt liggitt moved this from Changes requested to In progress in API Reviews Jul 17, 2025
@liggitt
Copy link
Member

liggitt commented Jul 18, 2025

/lgtm
/approve
/retest

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 18, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 202adeb4e3ce2fc556bbcc8b662a7e8345259249

@liggitt liggitt moved this from In progress to API review completed, 1.34 in API Reviews Jul 18, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, tallclair, vinayakankugoyal

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 18, 2025
@k8s-triage-robot
Copy link

The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass.

This bot retests PRs for certain kubernetes repos according to the following rules:

  • The PR does have any do-not-merge/* labels
  • The PR does not have the needs-ok-to-test label
  • The PR is mergeable (does not have a needs-rebase label)
  • The PR is approved (has cncf-cla: yes, lgtm, approved labels)
  • The PR is failing tests required for merge

You can:

/retest

@k8s-ci-robot k8s-ci-robot merged commit 963a9ac into kubernetes:master Jul 18, 2025
13 checks passed
@github-project-automation github-project-automation bot moved this from Tracked to Done in [sig-release] Bug Triage Jul 18, 2025
@github-project-automation github-project-automation bot moved this from other-sig (sig-node-approved) to Done in SIG Node: code and documentation PRs Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. sig/node Categorizes an issue or PR as relevant to SIG Node. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

Status: API review completed, 1.34
Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants