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

Create a CSV webhook #516

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

iamniting
Copy link
Member

Signed-off-by: Nitin Goyal [email protected]

Depends on: #511

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]>
Copy link
Contributor

openshift-ci bot commented Jan 15, 2025

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 15, 2025
@iamniting iamniting force-pushed the webhook branch 2 times, most recently from 36219b1 to a57ca02 Compare January 15, 2025 08:11
Signed-off-by: Nitin Goyal <[email protected]>
Copy link
Contributor

openshift-ci bot commented Jan 15, 2025

@iamniting: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/odf-operator-e2e-aws 1d1b666 link true /test odf-operator-e2e-aws

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this required?

Comment on lines +55 to +80
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),
}
Copy link
Contributor

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?

Comment on lines +128 to +151
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,
}
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants