Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed AppArmorProfile and SecCompProfile scope #2694

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anshuman-agarwala
Copy link

What type of PR is this?

/kind api-change

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #2582

Does this PR have test?

Special notes for your reviewer:

Does this PR introduce a user-facing change?


@k8s-ci-robot
Copy link
Contributor

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

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 kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jan 24, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: anshuman-agarwala
Once this PR has been reviewed and has the lgtm label, please assign saschagrunert for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 24, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @anshuman-agarwala!

It looks like this is your first PR to kubernetes-sigs/security-profiles-operator 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/security-profiles-operator has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 24, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @anshuman-agarwala. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 24, 2025
@saschagrunert
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 24, 2025
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 40.91%. Comparing base (11d77f4) to head (b919a7d).
Report is 663 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2694      +/-   ##
==========================================
- Coverage   45.50%   40.91%   -4.59%     
==========================================
  Files          79      109      +30     
  Lines        7782    18724   +10942     
==========================================
+ Hits         3541     7661    +4120     
- Misses       4099    10546    +6447     
- Partials      142      517     +375     

Copy link
Contributor

@ccojocar ccojocar left a comment

Choose a reason for hiding this comment

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

I think the RBAC needs to be also updated.

@@ -1,6 +1,6 @@
apiVersion: v1
data:
security-profiles-operator.json: |
bpf-recorder.json: |
Copy link
Contributor

Choose a reason for hiding this comment

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

Please could you update with latest policies from master?

Copy link
Author

Choose a reason for hiding this comment

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

Rebased with master, is there anything else I need to do?

@anshuman-agarwala
Copy link
Author

I think the RBAC needs to be also updated.

I've looked through all the Role manifests, not sure which ones need updating.
Also for the E2E errors, when I deploy the operator locally I get the following:

E0201 14:55:54.892359   10551 controller.go:332] "Reconciler error" err="cannot ensure node status: cannot create node status for log-enricher-trace: creating node status: an empty namespace may not be set during creation" controller="profile" controllerGroup="security-profiles-operator.x-k8s.io" controllerKind="SeccompProfile" SeccompProfile="log-enricher-trace" namespace="" name="log-enricher-trace" reconcileID="e956f8ea-57c7-4211-be7a-88d40edea885"

Cannot find the source of this error, I know it's due to the scope change since it's trying to set the namespace for a clustered resource but I cannot figure out where.

@k8s-ci-robot
Copy link
Contributor

@anshuman-agarwala: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-security-profiles-operator-test-e2e bd3593e link true /test pull-security-profiles-operator-test-e2e

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@ccojocar
Copy link
Contributor

ccojocar commented Feb 3, 2025

Cannot find the source of this error, I know it's due to the scope change since it's trying to set the namespace for a clustered resource but I cannot figure out where.

@anshuman-agarwala I think the NodeStatus is namespaced, and it gets a reference to the security base profile here

.

It is created for both seccomp and apparmor, for instance here

nodeStatus, err := nodestatus.NewForProfile(sp, r.client)
.

I believe you need to set up its namesapce explicitly in the operator namesapce since now the security profiles are cluster scoped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ApparmorProfile CRD should be a cluster-wide resource
5 participants