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

Don't block things being deleted. #803

Merged
merged 1 commit into from
Sep 26, 2021

Conversation

mattmoor
Copy link
Member

This changes the cosigned webhook to ignore things that are being cleaned up.

As resources are cleaned up in Kubernetes (typically things with finalizers), they are first tombstoned by setting metadata.deletionTimestamp and once the finalizers have fully executed they are actually deleted.

To the webhook, these look like UPDATE operations, but are distinguishable because we can check for this field.

This also adds unit test coverage for the duckv1.Pod and duckv1.WithPod wrappers around the core validation and resolution logic.

Signed-off-by: Matt Moore mattomata@gmail.com

Ticket Link

Release Note

The cosigned webhook now ignores resources that are being deleted.

This changes the `cosigned` webhook to ignore things that are being cleaned up.

As resources are cleaned up in Kubernetes (typically things with finalizers), they are first tombstoned by setting `metadata.deletionTimestamp` and once the finalizers have fully executed they are actually deleted.

To the webhook, these look like `UPDATE` operations, but are distinguishable because we can check for this field.

This also adds unit test coverage for the `duckv1.Pod` and `duckv1.WithPod` wrappers around the core validation and resolution logic.

Signed-off-by: Matt Moore <mattomata@gmail.com>
@mattmoor mattmoor merged commit ff31e13 into sigstore:main Sep 26, 2021
@mattmoor mattmoor deleted the deletion-timestamp branch September 26, 2021 16:02
@github-actions github-actions bot added this to the v1.3.0 milestone Sep 26, 2021
mrjoelkamp pushed a commit to mrjoelkamp/cosign that referenced this pull request Sep 28, 2021
This changes the `cosigned` webhook to ignore things that are being cleaned up.

As resources are cleaned up in Kubernetes (typically things with finalizers), they are first tombstoned by setting `metadata.deletionTimestamp` and once the finalizers have fully executed they are actually deleted.

To the webhook, these look like `UPDATE` operations, but are distinguishable because we can check for this field.

This also adds unit test coverage for the `duckv1.Pod` and `duckv1.WithPod` wrappers around the core validation and resolution logic.

Signed-off-by: Matt Moore <mattomata@gmail.com>
Signed-off-by: Joel Kamp <joel.kamp@invitae.com>
mrjoelkamp pushed a commit to mrjoelkamp/cosign that referenced this pull request Sep 28, 2021
This changes the `cosigned` webhook to ignore things that are being cleaned up.

As resources are cleaned up in Kubernetes (typically things with finalizers), they are first tombstoned by setting `metadata.deletionTimestamp` and once the finalizers have fully executed they are actually deleted.

To the webhook, these look like `UPDATE` operations, but are distinguishable because we can check for this field.

This also adds unit test coverage for the `duckv1.Pod` and `duckv1.WithPod` wrappers around the core validation and resolution logic.

Signed-off-by: Matt Moore <mattomata@gmail.com>
Signed-off-by: Joel Kamp <joel.kamp@invitae.com>
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.

2 participants