Skip to content

Commit

Permalink
Merge pull request #203 from spolti/RHOAIENG-6877
Browse files Browse the repository at this point in the history
[RHOAIENG-6877] - odh-model-controller breaks Knative if KServe-Serve…
  • Loading branch information
openshift-merge-bot[bot] authored May 9, 2024
2 parents d53cc50 + 020d1bf commit c5de0a4
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ help: ## Display this help.

.PHONY: manifests
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=odh-model-controller-role,headerFile="hack/manifests_boilerplate.yaml.txt" crd paths="./..." output:crd:artifacts:config=config/crd/bases
# Any customization needed, apply to the webhook_patch.yaml file
$(CONTROLLER_GEN) rbac:roleName=odh-model-controller-role,headerFile="hack/manifests_boilerplate.yaml.txt" crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases

external-manifests:
go get github.com/kserve/modelmesh-serving
Expand Down
3 changes: 3 additions & 0 deletions config/webhook/field_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- op: replace
path: /metadata/name
value: validating.odh-model-controller.opendatahub.io
20 changes: 18 additions & 2 deletions config/webhook/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,21 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- manifests.yaml
- service.yaml
- manifests.yaml
- service.yaml


patches:
- path: webhook_patch.yaml
target:
group: admissionregistration.k8s.io
kind: ValidatingWebhookConfiguration
name: validating-webhook-configuration
version: v1
- path: field_patch.yaml
target:
group: admissionregistration.k8s.io
kind: ValidatingWebhookConfiguration
name: validating-webhook-configuration
version: v1

7 changes: 3 additions & 4 deletions config/webhook/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
name: validating.odh-model-controller.opendatahub.io
annotations:
service.beta.openshift.io/inject-cabundle: true
name: validating-webhook-configuration
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
service:
name: odh-model-controller-webhook-service
name: webhook-service
namespace: system
path: /validate-serving-knative-dev-v1-service
failurePolicy: Fail
name: validating.ksvc.odh-model-controller.opendatahub.io
Expand Down
16 changes: 16 additions & 0 deletions config/webhook/webhook_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
name: validating.odh-model-controller.opendatahub.io
annotations:
service.beta.openshift.io/inject-cabundle: true
webhooks:
- name: validating.ksvc.odh-model-controller.opendatahub.io
clientConfig:
service:
name: odh-model-controller-webhook-service
objectSelector:
matchExpressions:
- key: serving.kserve.io/inferenceservice
operator: Exists

0 comments on commit c5de0a4

Please sign in to comment.