-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Bump knative.dev/pkg to 528ad1c 🔥 #1412
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,32 +79,37 @@ func main() { | |
} | ||
|
||
options := webhook.ControllerOptions{ | ||
ServiceName: "tekton-pipelines-webhook", | ||
DeploymentName: "tekton-pipelines-webhook", | ||
Namespace: system.GetNamespace(), | ||
Port: 8443, | ||
SecretName: "webhook-certs", | ||
WebhookName: "webhook.tekton.dev", | ||
ServiceName: "tekton-pipelines-webhook", | ||
DeploymentName: "tekton-pipelines-webhook", | ||
Namespace: system.GetNamespace(), | ||
Port: 8443, | ||
SecretName: "webhook-certs", | ||
WebhookName: "webhook.tekton.dev", | ||
ResourceAdmissionControllerPath: "/", | ||
} | ||
//TODO add validations here | ||
controller := webhook.AdmissionController{ | ||
Client: kubeClient, | ||
Options: options, | ||
Handlers: map[schema.GroupVersionKind]webhook.GenericCRD{ | ||
v1alpha1.SchemeGroupVersion.WithKind("Pipeline"): &v1alpha1.Pipeline{}, | ||
v1alpha1.SchemeGroupVersion.WithKind("PipelineResource"): &v1alpha1.PipelineResource{}, | ||
v1alpha1.SchemeGroupVersion.WithKind("Task"): &v1alpha1.Task{}, | ||
v1alpha1.SchemeGroupVersion.WithKind("ClusterTask"): &v1alpha1.ClusterTask{}, | ||
v1alpha1.SchemeGroupVersion.WithKind("TaskRun"): &v1alpha1.TaskRun{}, | ||
v1alpha1.SchemeGroupVersion.WithKind("PipelineRun"): &v1alpha1.PipelineRun{}, | ||
v1alpha1.SchemeGroupVersion.WithKind("Condition"): &v1alpha1.Condition{}, | ||
}, | ||
Logger: logger, | ||
DisallowUnknownFields: true, | ||
// Decorate contexts with the current state of the config. | ||
WithContext: func(ctx context.Context) context.Context { | ||
return v1alpha1.WithDefaultConfigurationName(store.ToContext(ctx)) | ||
}, | ||
resourceHandlers := map[schema.GroupVersionKind]webhook.GenericCRD{ | ||
v1alpha1.SchemeGroupVersion.WithKind("Pipeline"): &v1alpha1.Pipeline{}, | ||
v1alpha1.SchemeGroupVersion.WithKind("PipelineResource"): &v1alpha1.PipelineResource{}, | ||
v1alpha1.SchemeGroupVersion.WithKind("Task"): &v1alpha1.Task{}, | ||
v1alpha1.SchemeGroupVersion.WithKind("ClusterTask"): &v1alpha1.ClusterTask{}, | ||
v1alpha1.SchemeGroupVersion.WithKind("TaskRun"): &v1alpha1.TaskRun{}, | ||
v1alpha1.SchemeGroupVersion.WithKind("PipelineRun"): &v1alpha1.PipelineRun{}, | ||
v1alpha1.SchemeGroupVersion.WithKind("Condition"): &v1alpha1.Condition{}, | ||
} | ||
|
||
resourceAdmissionController := webhook.NewResourceAdmissionController(resourceHandlers, options, true) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NIT: The third parameter here is the "DisallowUnknownFields" - but to know that one has to lookup the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @afrittoli I agree 😅 We should either name that boolean or propose some changes upstream to make the |
||
admissionControllers := map[string]webhook.AdmissionController{ | ||
options.ResourceAdmissionControllerPath: resourceAdmissionController, | ||
} | ||
|
||
// Decorate contexts with the current state of the config. | ||
ctxFunc := func(ctx context.Context) context.Context { | ||
return v1alpha1.WithDefaultConfigurationName(store.ToContext(ctx)) | ||
} | ||
|
||
controller, err := webhook.New(kubeClient, options, admissionControllers, logger, ctxFunc) | ||
if err != nil { | ||
logger.Fatal("Error creating admission controller", zap.Error(err)) | ||
} | ||
|
||
if err := controller.Run(stopCh); err != nil { | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Do we need to lose this comment?
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 I removed it because we are already doing validation in the webhook, so I felt it wasn't necessary anymore.