-
Notifications
You must be signed in to change notification settings - Fork 236
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 initContainers and ephemeralContainers to Require Images Use Checksums #1066
Conversation
Signed-off-by: nsagark <sagar@nirmata.com>
Signed-off-by: nsagark <sagar@nirmata.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to add name
as a conditional since this is a mandatory field. You also don't need to deviate from the pattern shown since digests can be specified using algorithms other than sha256. Please just add in ephemeral and initContainers following the same pattern that has already been established.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And if you're adding in checks for additional containers, you should cover for them in the test cases which doesn't look like has been done.
Signed-off-by: nsagark <sagar@nirmata.com>
Signed-off-by: nsagark <sagar@nirmata.com>
@chipzoller I have updated the policy. Also, I have updated the chainsaw tests to include init containers. I could not include ephermeral container as my chainsaw test was failing with below error.. Please review and let me know.
|
You cannot add ephemeral containers on a create request. These can only be added on an update. Either use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ephemeralContainers cannot be created with an initial Pod's CREATE request. They may only be added to existing Pods (therefore an UPDATE request). In order to test ephemeralContainers, you can either use kubectl debug
or an update/patch to the Pod if you need to supply additional fields.
Hi @chipzoller Do we have any policy examples where we have chainsaw test case written for ephemeral containers. I tried something like below but getting an error.
|
Please use code blocks to show code/YAML. I can't read that. |
I have edited my response. Please take a look. |
You can't patch with |
Tried with just ephemeral containers. But still seeing an error.
Here is the error:
|
Ok, the issue is that ephemeral containers is a subresource, so you can't patch the Pod directly. My suggestion would be to do a |
Signed-off-by: nsagark <sagar@nirmata.com>
Hi @chipzoller I have updated the chainsaw-test.yaml to include tests for ephemeral containers as well. Please take a look. |
Signed-off-by: nsagark <sagar@nirmata.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there.
Signed-off-by: nsagark <sagar@nirmata.com>
Hi @chipzoller I have removed the ephemeral containers from the resource.yaml. Please take a look. |
Related Issue(s)
Description
Checklist