Skip to content

Conversation

@Darkhood148
Copy link
Contributor

@Darkhood148 Darkhood148 commented Jan 23, 2025

Related Issue(s)

Closes #1088.

Description

This PR adds a sample policy to mount volumes and set default security context for ephemeral containers; along with chainsaw tests for the same

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.

@Darkhood148
Copy link
Contributor Author

Darkhood148 commented Jan 23, 2025

Hi @realshuting,

The description of the chainsaw tests is as follows:

  • Step 1: Create the policy
  • Step 2: Create a pod with the label ephemeral-debug: true and verify that the volume is added to the pod
  • Step 3: Verify the security context of a newly created ephemeral container by ensuring that it is a read-only file system
  • Step 4: Check if volumeMounts are being correctly added

Signed-off-by: Darkhood148 <[email protected]>
@Darkhood148
Copy link
Contributor Author

Hi @realshuting I have done the requested changes. Here is the updated description of the chainsaw tests:

  • Step 1: Create the policy
  • Step 2: Create a pod with the label ephemeral-debug: true and verify that the volume is added to the pod
  • Step 3: Create ephemeral container for the pod
  • Step 4: Verify the security context of the pod and verify if volume mounts are correctly added

Copy link
Member

@realshuting realshuting left a comment

Choose a reason for hiding this comment

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

/lgtm

Thanks @Darkhood148 !

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.

[Sample] Mount volumes for ephemeral containers

2 participants