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

merging: Fix the mergeStrategy=containers option #1380

Merged
merged 1 commit into from
Mar 20, 2023

Conversation

jhrozek
Copy link
Contributor

@jhrozek jhrozek commented Dec 14, 2022

What type of PR is this?

/kind bug

What this PR does / why we need it:

The mergeStrategy=containers option was implemented wrong. Instead of
merging per-container policies, it was merging policies per workload.

Which issue(s) this PR fixes:

Does this PR have test?

Yes

Special notes for your reviewer:

N/A

Does this PR introduce a user-facing change?

The ProfileRecording setting mergeStrategy=containers did not work
as expected, it was merging all containers from a single recording
into a single policy. This PR fixes the bug and now a single policy
is generated for each container.

@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. labels Dec 14, 2022
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 14, 2022
@codecov-commenter
Copy link

codecov-commenter commented Dec 14, 2022

Codecov Report

Merging #1380 (e7b0083) into main (3b90cac) will decrease coverage by 0.10%.
The diff coverage is 0.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1380      +/-   ##
==========================================
- Coverage   46.28%   46.19%   -0.10%     
==========================================
  Files          61       61              
  Lines        6263     6276      +13     
==========================================
  Hits         2899     2899              
- Misses       3241     3254      +13     
  Partials      123      123              

@jhrozek
Copy link
Contributor Author

jhrozek commented Jan 16, 2023

Rebased atop current main

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 16, 2023
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 17, 2023
@jhrozek
Copy link
Contributor Author

jhrozek commented Jan 17, 2023

Rebased atop the flatcar test fixes again

@jhrozek
Copy link
Contributor Author

jhrozek commented Jan 17, 2023

Huh, this seems like a legit failure:

2023-01-17T15:16:30.0940880Z         --- FAIL: TestSuite/TestSecurityProfilesOperator/cluster-wide:_profile_merging (295.76s)

/hold
before I investigate

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 17, 2023
@jhrozek
Copy link
Contributor Author

jhrozek commented Mar 17, 2023

Hmm, locally the test worked fine:

--- PASS: TestSuite (374.70s)
    --- PASS: TestSuite/TestSecurityProfilesOperator (372.49s)
        --- PASS: TestSuite/TestSecurityProfilesOperator/cluster-wide:_profile_merging (278.91s)

I'll try my luck in CI one more time..

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ccojocar, jhrozek

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

The mergeStrategy=containers option was implemented wrong. Instead of
merging per-container policies, it was merging policies per workload.
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 20, 2023
@saschagrunert
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 20, 2023
@jhrozek
Copy link
Contributor Author

jhrozek commented Mar 20, 2023

Thanks for the reviews!
/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 20, 2023
@k8s-ci-robot k8s-ci-robot merged commit 6ab3863 into kubernetes-sigs:main Mar 20, 2023
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

5 participants