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

add: preserve unknown fields in vulnerabilityreport #1455

Merged
merged 1 commit into from
Aug 28, 2023

Conversation

rndmh3ro
Copy link
Contributor

@rndmh3ro rndmh3ro commented Aug 23, 2023

Description

I built a custom operator (https://github.com/telekom-mms/trivy-dojo-report-operator) that uses the kopf-operator (github.com/nolar/kopf/) framework. This framework can act on kubernetes-resource creation. To detect which resources were already worked on, kopf adds a the last state of the resource as an annotation or status to the resource.I cannot use the annotation-feature, because of this issue: kubernetes-sigs/kubebuilder#2556 (annotations get too long).

So my proposal is to preserve unknown fields in the vulnerabilityreport-crd. This way I can add a status-field which kopf then can use to store the state.

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@rndmh3ro rndmh3ro changed the title preserve unknown fields in vulnerabilityreport add: preserve unknown fields in vulnerabilityreport Aug 23, 2023
@CLAassistant
Copy link

CLAassistant commented Aug 24, 2023

CLA assistant check
All committers have signed the CLA.

@chen-keinan
Copy link
Contributor

chen-keinan commented Aug 28, 2023

@rndmh3ro thank you for the contribution , I'm happy to add such annotation however the kubebuilder:validation:XPreserveUnknownFields variant is deprecated in favor of the kubebuilder:pruning:PreserveUnknownFields variant. They function identically.

Adding docs ref better to use the 2nd one. wdyt?

I built a custom operator (https://github.com/telekom-mms/trivy-dojo-report-operator)
that uses the kopf-operator (github.com/nolar/kopf/) framework.
This framework can act on kubernetes-resource creation. To detect which resources
were already worked on, kopf adds a the last state of the resource as an
annotation or status to the resource.I cannot use the annotation-feature, because
of this issue: kubernetes-sigs/kubebuilder#2556 (annotations
get too long).

So my proposal is to preseve unknown fields in the vulnerabilityreport-crd. This way
I can add a status-field which kopf then can use to store the state.
@rndmh3ro
Copy link
Contributor Author

Thanks @chen-keinan! I updated the code.

> make generate-all && make verify-generated ran successfully on my local machine.

@chen-keinan chen-keinan merged commit 7fe8c39 into aquasecurity:main Aug 28, 2023
7 checks passed
@chen-keinan
Copy link
Contributor

lgtm 🚀

This pull request was closed.
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.

3 participants