-
Notifications
You must be signed in to change notification settings - Fork 58
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
Create a CSV webhook #516
base: main
Are you sure you want to change the base?
Create a CSV webhook #516
Conversation
Delay the creation of the console plugin until after verifying that the required CSVs are present. This ensures the necessary CRDs are present in the cluster, preventing UI errors like "Model does not exist." Signed-off-by: Nitin Goyal <[email protected]>
creating odf-deps subscription while starting manager will speed up the process. Signed-off-by: Nitin Goyal <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: iamniting The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
36219b1
to
a57ca02
Compare
Signed-off-by: Nitin Goyal <[email protected]>
Signed-off-by: Nitin Goyal <[email protected]>
Signed-off-by: Nitin Goyal <[email protected]>
Signed-off-by: Nitin Goyal <[email protected]>
Signed-off-by: Nitin Goyal <[email protected]>
@iamniting: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
@@ -25,6 +25,7 @@ namePrefix: odf-operator- | |||
# endpoint w/o any authn/z, please comment the following line. | |||
patchesStrategicMerge: | |||
- manager_auth_proxy_patch.yaml | |||
- manager_webhook_patch.yaml |
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.
why is this required?
csvWebhook := admrv1.MutatingWebhook{ | ||
Name: WebhookName, | ||
ClientConfig: admrv1.WebhookClientConfig{ | ||
Service: &admrv1.ServiceReference{ | ||
Name: WebhookServiceName, | ||
Path: ptr.To(odfwebhook.WebhookPath), | ||
Port: ptr.To(int32(443)), | ||
}, | ||
}, | ||
Rules: []admrv1.RuleWithOperations{ | ||
{ | ||
Rule: admrv1.Rule{ | ||
APIGroups: []string{"operators.coreos.com"}, | ||
APIVersions: []string{"v1alpha1"}, | ||
Resources: []string{"clusterserviceversions"}, | ||
Scope: ptr.To(admrv1.NamespacedScope), | ||
}, | ||
Operations: []admrv1.OperationType{admrv1.Create}, | ||
}, | ||
}, | ||
SideEffects: ptr.To(admrv1.SideEffectClassNone), | ||
TimeoutSeconds: ptr.To(int32(30)), | ||
AdmissionReviewVersions: []string{"v1"}, | ||
// fail the validation if webhook can't be reached | ||
FailurePolicy: ptr.To(admrv1.Fail), | ||
} |
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 is recreated in every func invocation, why can't move this to a template and deep copy whatever is required?
webhookService := corev1.Service{ | ||
ObjectMeta: metav1.ObjectMeta{ | ||
Name: WebhookServiceName, | ||
Namespace: operatorNamespace, | ||
}, | ||
Spec: corev1.ServiceSpec{ | ||
Ports: []corev1.ServicePort{ | ||
{ | ||
Name: "https", | ||
Port: 443, | ||
Protocol: corev1.ProtocolTCP, | ||
TargetPort: intstr.FromInt32(9443), | ||
}, | ||
}, | ||
Selector: map[string]string{ | ||
"app.kubernetes.io/name": "odf-operator", | ||
}, | ||
Type: corev1.ServiceTypeClusterIP, | ||
}, | ||
} | ||
|
||
svc := &corev1.Service{ | ||
ObjectMeta: webhookService.ObjectMeta, | ||
} |
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 is recreated in every func invocation, why can't move this to a template and deep copy whatever is required?
Signed-off-by: Nitin Goyal [email protected]
Depends on: #511