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

Add spoc convert Command #2201

Merged
merged 6 commits into from
Apr 10, 2024
Merged

Conversation

mhils
Copy link
Contributor

@mhils mhils commented Apr 9, 2024

What type of PR is this?

/kind bug
/kind feature

What this PR does / why we need it:

This command allows users to transform security profiles from a custom resource definition YAML to the raw profile as consumed by the respective security module. My primary use case here is testing AppArmor rules without dealing with Kubernetes, but it works for seccomp just as well.

Which issue(s) this PR fixes:

None

Does this PR have test?

Yes.

Special notes for your reviewer:

This PR first consolidates the code paths in artifact and merger to read YAML files (fixing ab bug in the artifact impl, see #2136 (comment)), and then reuses that for the convert functionality. It's probably easiest to review commits individually.

Happy to bikeshed on the name of the command if you feel convert is too generic. I hold no strong opinions. :)

Does this PR introduce a user-facing change?

Added a `spoc convert` command to transform security profile YAML definitions to their raw representation.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 9, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @mhils. 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/test-infra repository.

@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 Apr 9, 2024
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Apr 9, 2024
mhils added 4 commits April 9, 2024 18:13
This command allows users to transform security profiles from
a custom resource definition YAML to the raw profile as consumed
by the respective security module.
@codecov-commenter
Copy link

codecov-commenter commented Apr 10, 2024

Codecov Report

Merging #2201 (2833f00) into main (11d77f4) will decrease coverage by 4.37%.
Report is 141 commits behind head on main.
The diff coverage is 56.61%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2201      +/-   ##
==========================================
- Coverage   45.50%   41.14%   -4.37%     
==========================================
  Files          79      107      +28     
  Lines        7782    15529    +7747     
==========================================
+ Hits         3541     6389    +2848     
- Misses       4099     8670    +4571     
- Partials      142      470     +328     

@saschagrunert
Copy link
Member

/ok-to-test

Thank you @mhils 🙏 !

@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 Apr 10, 2024
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 10, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mhils, saschagrunert

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 Apr 10, 2024
@k8s-ci-robot k8s-ci-robot merged commit bf7adfc into kubernetes-sigs:main Apr 10, 2024
27 checks passed
@mhils mhils deleted the spoc-convert branch April 11, 2024 11:04
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/bug Categorizes issue or PR as related to a bug. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants