Skip to content

Commit aa282c8

Browse files
committed
Upgrade to Operator SDK 1.41.1
This commit upgrades the telemetry-operator to use Operator SDK version 1.41.1, with the following major changes: Project Structure: - Move pkg/ packages to internal/ following Go best practices - Move controllers/ to internal/controller/ per new operator-sdk layout - Replace main.go with cmd/main.go - Add controller and webhook test suites Configuration Updates: - Split certificate management into separate metrics and webhook certs - Add network policies for metrics and webhook traffic - Rename auth_proxy resources to metrics for clarity - Add admin RBAC roles for all CRD types - Update manager deployment configuration and patches - Modernize kustomization configurations Webhook Changes: - Add dedicated webhook implementation in internal/webhook/v1beta1/ - Remove old CRD webhook and CA injection patches - Update webhook manifests and service configuration Cleanup: - Remove obsolete config patches and overlays Dependencies: - Update go.mod and go.sum for operator-sdk 1.41.1 dependencies Jira: OSPRH-22020 Assisted-by: claude-4-sonnet Signed-off-by: Martin Schuppert <[email protected]>
1 parent 6280f54 commit aa282c8

File tree

273 files changed

+2131
-1336
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

273 files changed

+2131
-1336
lines changed

.ci-operator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
build_root_image:
22
name: tools
33
namespace: openstack-k8s-operators
4-
tag: ci-build-root-golang-1.24-sdk-1.31
4+
tag: ci-build-root-golang-1.24-sdk-1.41.1

.github/workflows/build-telemetry-operator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
with:
1717
operator_name: telemetry
1818
go_version: 1.24.x
19-
operator_sdk_version: 1.31.0
19+
operator_sdk_version: 1.41.1
2020
secrets:
2121
IMAGENAMESPACE: ${{ secrets.IMAGENAMESPACE }}
2222
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}

.github/workflows/force-bump-pr-manual.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ jobs:
99
with:
1010
operator_name: telemetry
1111
branch_name: ${{ github.ref_name }}
12-
custom_image: quay.io/openstack-k8s-operators/openstack-k8s-operators-ci-build-tools:golang-1.24-sdk-1.31
12+
custom_image: quay.io/openstack-k8s-operators/openstack-k8s-operators-ci-build-tools:golang-1.24-sdk-1.41.1
1313
secrets:
1414
FORCE_BUMP_PULL_REQUEST_PAT: ${{ secrets.FORCE_BUMP_PULL_REQUEST_PAT }}

.github/workflows/force-bump-pr-scheduled.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ jobs:
1010
uses: openstack-k8s-operators/openstack-k8s-operators-ci/.github/workflows/force-bump-branches.yaml@main
1111
with:
1212
operator_name: telemetry
13-
custom_image: quay.io/openstack-k8s-operators/openstack-k8s-operators-ci-build-tools:golang-1.24-sdk-1.31
13+
custom_image: quay.io/openstack-k8s-operators/openstack-k8s-operators-ci-build-tools:golang-1.24-sdk-1.41.1
1414
secrets:
1515
FORCE_BUMP_PULL_REQUEST_PAT: ${{ secrets.FORCE_BUMP_PULL_REQUEST_PAT }}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ RUN mkdir -p ${DEST_ROOT}/usr/local/bin/
2626
RUN if [ ! -f $CACHITO_ENV_FILE ]; then go mod download ; fi
2727

2828
# Build manager
29-
RUN if [ -f $CACHITO_ENV_FILE ] ; then source $CACHITO_ENV_FILE ; fi ; env ${GO_BUILD_EXTRA_ENV_ARGS} go build ${GO_BUILD_EXTRA_ARGS} -a -o ${DEST_ROOT}/manager main.go
29+
RUN if [ -f $CACHITO_ENV_FILE ] ; then source $CACHITO_ENV_FILE ; fi ; env ${GO_BUILD_EXTRA_ENV_ARGS} go build ${GO_BUILD_EXTRA_ARGS} -a -o ${DEST_ROOT}/manager cmd/main.go
3030

3131
RUN cp -r templates ${DEST_ROOT}/templates
3232

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ endif
4848

4949
# Set the Operator SDK version to use. By default, what is installed on the system is used.
5050
# This is useful for CI or a project to utilize a specific version of the operator-sdk toolkit.
51-
OPERATOR_SDK_VERSION ?= v1.31.0
51+
OPERATOR_SDK_VERSION ?= v1.41.1
5252

5353
# Image URL to use all building/pushing image targets
5454
DEFAULT_IMG ?= quay.io/openstack-k8s-operators/telemetry-operator:latest
@@ -122,7 +122,7 @@ test: manifests generate fmt vet envtest ## Run tests.
122122

123123
.PHONY: build
124124
build: generate fmt vet ## Build manager binary.
125-
go build -o bin/manager main.go
125+
go build -o bin/manager cmd/main.go
126126

127127
.PHONY: run
128128
run: export METRICS_PORT?=8080
@@ -131,7 +131,7 @@ run: export PPROF_PORT?=8082
131131
run: export ENABLE_WEBHOOKS?=false
132132
run: manifests generate fmt vet ## Run a controller from your host.
133133
/bin/bash hack/clean_local_webhook.sh
134-
go run ./main.go -metrics-bind-address ":$(METRICS_PORT)" -health-probe-bind-address ":$(HEALTH_PORT)" -pprof-bind-address ":$(PPROF_PORT)"
134+
go run ./cmd/main.go -metrics-bind-address ":$(METRICS_PORT)" -health-probe-bind-address ":$(HEALTH_PORT)" -pprof-bind-address ":$(PPROF_PORT)"
135135

136136
# Extra vars which will be passed to the Docker-build
137137
DOCKER_BUILD_ARGS ?=
@@ -197,7 +197,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
197197
ENVTEST ?= $(LOCALBIN)/setup-envtest
198198

199199
## Tool Versions
200-
KUSTOMIZE_VERSION ?= v3.8.7
200+
KUSTOMIZE_VERSION ?= v5.6.0
201201
CONTROLLER_TOOLS_VERSION ?= v0.18.0
202202
GOTOOLCHAIN_VERSION ?= go1.24.0
203203

PROJECT

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
# Code generated by tool. DO NOT EDIT.
2+
# This file is used to track the info used to scaffold your project
3+
# and allow the plugins properly work.
4+
# More info: https://book.kubebuilder.io/reference/project-config.html
15
domain: openstack.org
26
layout:
3-
- go.kubebuilder.io/v3
7+
- go.kubebuilder.io/v4
48
plugins:
59
manifests.sdk.operatorframework.io/v2: {}
610
scorecard.sdk.operatorframework.io/v2: {}
7-
sdk.x-openshift.io/v1: {}
811
projectName: telemetry-operator
912
repo: github.com/openstack-k8s-operators/telemetry-operator
1013
resources:
@@ -43,6 +46,10 @@ resources:
4346
kind: Autoscaling
4447
path: github.com/openstack-k8s-operators/telemetry-operator/api/v1beta1
4548
version: v1beta1
49+
webhooks:
50+
defaulting: true
51+
validation: true
52+
webhookVersion: v1
4653
- api:
4754
crdVersion: v1
4855
namespaced: true
@@ -92,4 +99,8 @@ resources:
9299
kind: CloudKitty
93100
path: github.com/openstack-k8s-operators/telemetry-operator/api/v1beta1
94101
version: v1beta1
102+
webhooks:
103+
defaulting: true
104+
validation: true
105+
webhookVersion: v1
95106
version: "3"

api/go.mod

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,15 @@ module github.com/openstack-k8s-operators/telemetry-operator/api
33
go 1.24.4
44

55
require (
6-
github.com/onsi/ginkgo/v2 v2.27.1
7-
github.com/onsi/gomega v1.38.2
86
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20251002120642-c2d58c6fc03e
97
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20250929092825-4c2402451077
108
github.com/rhobs/observability-operator v0.3.1
119
k8s.io/api v0.31.13
1210
k8s.io/apimachinery v0.31.13
13-
k8s.io/client-go v0.31.13
1411
sigs.k8s.io/controller-runtime v0.19.7
1512
)
1613

1714
require (
18-
github.com/Masterminds/semver/v3 v3.4.0 // indirect
1915
github.com/beorn7/perks v1.0.1 // indirect
2016
github.com/cespare/xxhash/v2 v2.3.0 // indirect
2117
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
@@ -25,18 +21,15 @@ require (
2521
github.com/fsnotify/fsnotify v1.9.0 // indirect
2622
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
2723
github.com/go-logr/logr v1.4.3 // indirect
28-
github.com/go-logr/zapr v1.3.0 // indirect
2924
github.com/go-openapi/jsonpointer v0.21.1 // indirect
3025
github.com/go-openapi/jsonreference v0.21.0 // indirect
3126
github.com/go-openapi/swag v0.23.1 // indirect
32-
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
3327
github.com/gogo/protobuf v1.3.2 // indirect
3428
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
3529
github.com/golang/protobuf v1.5.4 // indirect
3630
github.com/google/gnostic-models v0.7.0 // indirect
3731
github.com/google/go-cmp v0.7.0 // indirect
3832
github.com/google/gofuzz v1.2.0 // indirect
39-
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect
4033
github.com/google/uuid v1.6.0 // indirect
4134
github.com/imdario/mergo v0.3.16 // indirect
4235
github.com/josharian/intern v1.0.0 // indirect
@@ -45,6 +38,7 @@ require (
4538
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
4639
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
4740
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
41+
github.com/onsi/ginkgo/v2 v2.27.1 // indirect
4842
github.com/pkg/errors v0.9.1 // indirect
4943
github.com/prometheus/client_golang v1.22.0 // indirect
5044
github.com/prometheus/client_model v0.6.2 // indirect
@@ -53,26 +47,21 @@ require (
5347
github.com/rhobs/obo-prometheus-operator/pkg/apis/monitoring v0.71.0-rhobs1 // indirect
5448
github.com/spf13/pflag v1.0.7 // indirect
5549
github.com/x448/float16 v0.8.4 // indirect
56-
go.uber.org/automaxprocs v1.6.0 // indirect
57-
go.uber.org/multierr v1.11.0 // indirect
58-
go.uber.org/zap v1.27.0 // indirect
5950
go.yaml.in/yaml/v2 v2.4.2 // indirect
6051
go.yaml.in/yaml/v3 v3.0.4 // indirect
6152
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 // indirect
62-
golang.org/x/mod v0.27.0 // indirect
6353
golang.org/x/net v0.43.0 // indirect
6454
golang.org/x/oauth2 v0.30.0 // indirect
65-
golang.org/x/sync v0.16.0 // indirect
6655
golang.org/x/sys v0.35.0 // indirect
6756
golang.org/x/term v0.34.0 // indirect
6857
golang.org/x/text v0.28.0 // indirect
6958
golang.org/x/time v0.12.0 // indirect
70-
golang.org/x/tools v0.36.0 // indirect
7159
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
7260
google.golang.org/protobuf v1.36.7 // indirect
7361
gopkg.in/inf.v0 v0.9.1 // indirect
7462
gopkg.in/yaml.v3 v3.0.1 // indirect
7563
k8s.io/apiextensions-apiserver v0.33.2 // indirect
64+
k8s.io/client-go v0.31.13 // indirect
7665
k8s.io/klog/v2 v2.130.1 // indirect
7766
k8s.io/kube-openapi v0.0.0-20250902184714-7fc278399c7f // indirect
7867
k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d // indirect

api/go.sum

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S
1818
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
1919
github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM=
2020
github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
21-
github.com/gkampitakis/ciinfo v0.3.2 h1:JcuOPk8ZU7nZQjdUhctuhQofk7BGHuIy0c9Ez8BNhXs=
22-
github.com/gkampitakis/ciinfo v0.3.2/go.mod h1:1NIwaOcFChN4fa/B0hEBdAb6npDlFL8Bwx4dfRLRqAo=
23-
github.com/gkampitakis/go-diff v1.3.2 h1:Qyn0J9XJSDTgnsgHRdz9Zp24RaJeKMUHg2+PDZZdC4M=
24-
github.com/gkampitakis/go-diff v1.3.2/go.mod h1:LLgOrpqleQe26cte8s36HTWcTmMEur6OPYerdAAS9tk=
25-
github.com/gkampitakis/go-snaps v0.5.15 h1:amyJrvM1D33cPHwVrjo9jQxX8g/7E2wYdZ+01KS3zGE=
26-
github.com/gkampitakis/go-snaps v0.5.15/go.mod h1:HNpx/9GoKisdhw9AFOBT1N7DBs9DiHo/hGheFGBZ+mc=
2721
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
2822
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
2923
github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ=
@@ -36,8 +30,6 @@ github.com/go-openapi/swag v0.23.1 h1:lpsStH0n2ittzTnbaSloVZLuB5+fvSY/+hnagBjSNZ
3630
github.com/go-openapi/swag v0.23.1/go.mod h1:STZs8TbRvEQQKUA+JZNAm3EWlgaOBGpyFDqQnDHMef0=
3731
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
3832
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
39-
github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=
40-
github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
4133
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
4234
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
4335
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
@@ -60,8 +52,6 @@ github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4=
6052
github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY=
6153
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
6254
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
63-
github.com/joshdk/go-junit v1.0.0 h1:S86cUKIdwBHWwA6xCmFlf3RTLfVXYQfvanM5Uh+K6GE=
64-
github.com/joshdk/go-junit v1.0.0/go.mod h1:TiiV0PqkaNfFXjEiyjWM3XXrhVyCa1K4Zfga6W52ung=
6555
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
6656
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
6757
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
@@ -76,10 +66,6 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0
7666
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
7767
github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4=
7868
github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
79-
github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo=
80-
github.com/maruel/natural v1.1.1/go.mod h1:v+Rfd79xlw1AgVBjbO0BEQmptqb5HvL/k9GRHB7ZKEg=
81-
github.com/mfridman/tparse v0.18.0 h1:wh6dzOKaIwkUGyKgOntDW4liXSo37qg5AXbIhkMV3vE=
82-
github.com/mfridman/tparse v0.18.0/go.mod h1:gEvqZTuCgEhPbYk/2lS3Kcxg1GmTxxU7kTC8DvP0i/A=
8369
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
8470
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
8571
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -101,8 +87,6 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
10187
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
10288
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
10389
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
104-
github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
105-
github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U=
10690
github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/Y92Vm0Zc6Q=
10791
github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0=
10892
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
@@ -123,14 +107,6 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
123107
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
124108
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
125109
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
126-
github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=
127-
github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
128-
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
129-
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
130-
github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
131-
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
132-
github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY=
133-
github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
134110
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
135111
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
136112
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=

api/v1beta1/autoscaling_webhook.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"fmt"
2121

2222
"k8s.io/apimachinery/pkg/runtime"
23-
ctrl "sigs.k8s.io/controller-runtime"
2423
logf "sigs.k8s.io/controller-runtime/pkg/log"
2524
"sigs.k8s.io/controller-runtime/pkg/webhook"
2625
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
@@ -45,15 +44,6 @@ func SetupAutoscalingDefaults(defaults AutoscalingDefaults) {
4544
autoscalinglog.Info("Autoscaling defaults initialized", "defaults", defaults)
4645
}
4746

48-
// SetupWebhookWithManager - setups webhook with the adequate manager
49-
func (r *Autoscaling) SetupWebhookWithManager(mgr ctrl.Manager) error {
50-
return ctrl.NewWebhookManagedBy(mgr).
51-
For(r).
52-
Complete()
53-
}
54-
55-
//+kubebuilder:webhook:path=/mutate-telemetry-openstack-org-v1beta1-autoscaling,mutating=true,failurePolicy=fail,sideEffects=None,groups=telemetry.openstack.org,resources=autoscalings,verbs=create;update,versions=v1beta1,name=mautoscaling.kb.io,admissionReviewVersions=v1
56-
5747
var _ webhook.Defaulter = &Autoscaling{}
5848

5949
// Default implements webhook.Defaulter so a webhook will be registered for the type
@@ -115,9 +105,6 @@ func (spec *AutoscalingSpecCore) SetDefaultRouteAnnotations(annotations map[stri
115105
annotations[haProxyAnno] = timeout
116106
}
117107

118-
// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
119-
//+kubebuilder:webhook:path=/validate-telemetry-openstack-org-v1beta1-autoscaling,mutating=false,failurePolicy=fail,sideEffects=None,groups=telemetry.openstack.org,resources=autoscalings,verbs=create;update,versions=v1beta1,name=vautoscaling.kb.io,admissionReviewVersions=v1
120-
121108
var _ webhook.Validator = &Autoscaling{}
122109

123110
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type

0 commit comments

Comments
 (0)