Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
1417 policy webhooks rev2 #3
1417 policy webhooks rev2 #3
Changes from all commits
b9c3883
3121044
57ac9c3
0850842
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Suggestion: I'm wondering if we want to add
cosigned.sigstore.dev
here. I don't have strong feelings.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.
I meant as group name https://github.com/coyote240/cosign/pull/3/files#diff-4c0f41345ba72055a1971348dbd7fa93e8a81cf4401816e3f26c83ea0ede56f2R8.
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.
This will be automatically populated by the webhook when it adds the
caBundle
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.
Oh cool, we didnt realize that knative was modifying the webhook configurations. Made the changes now!
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.
same
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.
Can we avoid checking in status with
crd-gen
?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.
sure! we will remove this.
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.
Revert before going upstream.
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.
yeah we are creating a new branch with merge commits and these changes removed
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.
I think we're pretty quickly get tired of juggling both of these, and I know when Knative Eventing briefly used controller-runtime they ended up having to maintain their own fork at times due to dependency hell.
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.
Sorry, I dont understand. Are you saying we should not use kubebuilder?
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.
I'm saying that if we use it, it shouldn't be "load bearing" and we should be prepared to rip it out if we need to (e.g. due to dep hell).
You can get basically every piece of codegen we need from K8s/Knative directly.
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.
@mattmoor Do you think we could use as example this https://github.com/knative-sandbox/sample-controller/blob/main/hack/update-codegen.sh#L34 and https://github.com/knative-sandbox/sample-controller/blob/main/pkg/apis/samples/v1alpha1/simple_deployment_types.go ? I think it does the same as the old kube-builder/controller-gen.
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.
That’s exactly what I’d 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.
We don't generate the whole CRD, which is mostly boilerplate. We have tooling to generate the openapiv3 schemas here: https://github.com/knative-sandbox/sample-controller/blob/6a2c2d197b4f37e6020ea19639a1077b7f6e50ab/cmd/schema/main.go#L30-L31
I can take care of adding this stuff (and the webhooks) if you want to focus on filling out the schema/defaulting/validation?
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.
so this: https://github.com/knative-sandbox/sample-controller/blob/6a2c2d197b4f37e6020ea19639a1077b7f6e50ab/config/300-simpledeployment.yaml is handwritten?
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.
oh it is okay, we can add it. We were looking to see examples of how it is generated, thats all.
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.
Most of the boilerplate is, like additionalPrinterColumns, but this is the output from the tool:
https://github.com/knative-sandbox/sample-controller/blob/6a2c2d197b4f37e6020ea19639a1077b7f6e50ab/config/300-simpledeployment.yaml#L32-L86
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.
We can probably use
yq
to get this added to./hack/update-codegen.sh
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.
I don't think the Images field should be omitted if empty.
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.
We've dropped
omitempty
for now.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.
same as above,
json:"pattern:
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.
I suggest you use instead *v1.SecretReference from ``k8s.io/api/core/v1` instead of creating a new type.
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.
suggestion: it'd be great to have some golang documentation to explain the purpose of each field. That would generate some valuable documentation.
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.
cool, sounds good. we will add it.