Skip to content

Commit 050ca1f

Browse files
committed
Make webhook annotations a global configuration
The webhook annotations shouldn't be a DSPA configuration since the webhook is global to the cluster. Signed-off-by: mprahl <[email protected]>
1 parent 5fb9ca8 commit 050ca1f

17 files changed

+75
-42
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ vet: ## Run go vet against code.
121121

122122
.PHONY: test
123123
test: manifests generate fmt vet envtest ## Run tests.
124-
export SSL_CERT_FILE=${ROOT_DIR}/controllers/testdata/tls/ca-bundle.crt && KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... --tags=test_all -coverprofile cover.out
124+
export SSL_CERT_FILE=${ROOT_DIR}/controllers/testdata/tls/ca-bundle.crt && export DSPO_NAMESPACE=$(DSPO_NAMESPACE) && KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... --tags=test_all -coverprofile cover.out
125125

126126
.PHONY: unittest
127127
unittest: manifests generate fmt vet envtest ## Run tests.

api/v1/dspipeline_types.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,6 @@ type APIServer struct {
162162
// Enable/disable caching in the DSP API server. Default: true
163163
// +kubebuilder:default:=true
164164
CacheEnabled *bool `json:"cacheEnabled,omitempty"`
165-
166-
// WebhookAnnotations is a map of annotations to add to the validating and mutating webhooks.
167-
// +kubebuilder:validation:Optional
168-
WebhookAnnotations map[string]string `json:"webhookAnnotations,omitempty"`
169165
}
170166

171167
type CABundle struct {

api/v1/zz_generated.deepcopy.go

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1alpha1/dspipeline_types.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,6 @@ type APIServer struct {
214214
// Enable/disable caching in the DSP API server. Default: true
215215
// +kubebuilder:default:=true
216216
CacheEnabled *bool `json:"cacheEnabled,omitempty"`
217-
218-
// WebhookAnnotations is a map of annotations to add to the validating and mutating webhooks.
219-
// +kubebuilder:validation:Optional
220-
WebhookAnnotations map[string]string `json:"webhookAnnotations,omitempty"`
221217
}
222218

223219
type CABundle struct {

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/base/params.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ DSPO_APISERVER_INCLUDE_OWNERREFERENCE=true
2222
MANAGEDPIPELINES="{}"
2323
PLATFORMVERSION="v0.0.0"
2424
FIPSENABLED=false
25+
WEBHOOK_ANNOTATIONS=""

config/crd/bases/datasciencepipelinesapplications.opendatahub.io_datasciencepipelinesapplications.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,6 @@ spec:
241241
description: Toolbox image used for basic container spec runtime
242242
operations in managed pipelines.
243243
type: string
244-
webhookAnnotations:
245-
additionalProperties:
246-
type: string
247-
description: WebhookAnnotations is a map of annotations to add
248-
to the validating and mutating webhooks.
249-
type: object
250244
type: object
251245
database:
252246
default:
@@ -1250,12 +1244,6 @@ spec:
12501244
description: 'Default: true Deprecated: DSP V1 only, will be removed
12511245
in the future.'
12521246
type: boolean
1253-
webhookAnnotations:
1254-
additionalProperties:
1255-
type: string
1256-
description: WebhookAnnotations is a map of annotations to add
1257-
to the validating and mutating webhooks.
1258-
type: object
12591247
type: object
12601248
database:
12611249
default:

config/internal/webhook/mutating_webhook.yaml.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ metadata:
44
name: pipelineversions.pipelines.kubeflow.org
55
annotations:
66
service.beta.openshift.io/inject-cabundle: "true"
7-
{{ if .APIServer.WebhookAnnotations }}
8-
{{ range $key, $value := .APIServer.WebhookAnnotations }}
7+
{{ if .WebhookAnnotations }}
8+
{{ range $key, $value := .WebhookAnnotations }}
99
{{ printf "%q" $key }}: {{ printf "%q" $value }}
1010
{{ end }}
1111
{{end}}

config/internal/webhook/validating_webhook.yaml.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ metadata:
44
name: pipelineversions.pipelines.kubeflow.org
55
annotations:
66
service.beta.openshift.io/inject-cabundle: "true"
7-
{{ if .APIServer.WebhookAnnotations }}
8-
{{ range $key, $value := .APIServer.WebhookAnnotations }}
7+
{{ if .WebhookAnnotations }}
8+
{{ range $key, $value := .WebhookAnnotations }}
99
{{ printf "%q" $key }}: {{ printf "%q" $value }}
1010
{{ end }}
1111
{{end}}

config/manager/manager.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ spec:
8585
value: $(PLATFORMVERSION)
8686
- name: DSPO_FIPSENABLED
8787
value: $(FIPSENABLED)
88+
- name: WEBHOOK_ANNOTATIONS
89+
value: $(WEBHOOK_ANNOTATIONS)
8890
securityContext:
8991
allowPrivilegeEscalation: false
9092
capabilities:

0 commit comments

Comments
 (0)