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

best-practices+karpenter+other: Enhance policies by iterating over all container types #1054

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mohamedawnallah
Copy link

@mohamedawnallah mohamedawnallah commented Jun 25, 2024

Related Issue(s)

Closes #1012

Description

Enhance policies by iterating over all container types i.e ephemeralContainers, initContainers, and containers.

Context

This is my first PR to Kyverno Org! I would love to receive any feedback, thanks! 🙏

Checklist

  • I have read the policy contribution guidelines.
  • [] I have added test manifests and resources covering both positive and negative tests that prove this policy works as intended.
  • I have added the artifacthub-pkg.yml file and have verified it is complete and correct.

@mohamedawnallah mohamedawnallah force-pushed the iterateAllContainerTypes branch from cebc629 to bba39a3 Compare June 25, 2024 01:30
@chipzoller chipzoller self-requested a review July 14, 2024 13:42
Copy link
Contributor

@chipzoller chipzoller left a comment

Choose a reason for hiding this comment

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

Hi and thanks for the contribution. You've got two test failures here reported in CI. See if you can fix those areas of the two affected policies.

@mohamedawnallah mohamedawnallah force-pushed the iterateAllContainerTypes branch 5 times, most recently from e5e9bd5 to 472666c Compare July 15, 2024 15:48
In this commit, we ensure policies apply to `ephemeralContainers`,
`initContainers`, and `containers`.

Signed-off-by: Mohamed Awnallah <[email protected]>
In this commit, we compute sha256 of the changed
policies using `sha256sum` utility for integrity.

Signed-off-by: Mohamed Awnallah <[email protected]>
@mohamedawnallah mohamedawnallah force-pushed the iterateAllContainerTypes branch from 472666c to 428be01 Compare July 15, 2024 16:41
@mohamedawnallah
Copy link
Author

Thanks a lot @chipzoller for the feedback! I've addressed all of it. The test cases all passed as you seen in my fork repo:
https://github.com/mohamedawnallah/policies/actions/runs/9943278258/job/27466720482?pr=2

@chipzoller
Copy link
Contributor

FYI, after addressing comments, please resolve conversations so maintainers know what to expect on subsequent reviews.

Copy link
Contributor

Choose a reason for hiding this comment

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

This policy is not correctly updated to account for the addition of initContainers and ephemeralContainers. The context variable is still operating on just containers which is causing CI tests to fail.

Copy link
Member

Choose a reason for hiding this comment

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

@mohamedawnallah - can you please resolve this, so we can merge?

@chipzoller
Copy link
Contributor

Bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extend chainsaw tests for additional container types
3 participants