Skip to content

Commit

Permalink
Remove CAPI webhook (#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomleb authored Mar 19, 2024
1 parent 92ab3ea commit 128b387
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 283 deletions.
3 changes: 0 additions & 3 deletions charts/rancher-webhook/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,3 @@ annotations:
catalog.cattle.io/permits-os: linux,windows
catalog.cattle.io/rancher-version: ">= 2.9.0-0 < 2.10.0-0"
catalog.cattle.io/kube-version: ">= 1.23.0-0 < 1.28.0-0"
dependencies:
- name: capi
condition: capi.enabled
4 changes: 0 additions & 4 deletions charts/rancher-webhook/charts/capi/Chart.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions charts/rancher-webhook/charts/capi/templates/service.yaml

This file was deleted.

24 changes: 2 additions & 22 deletions charts/rancher-webhook/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,8 @@ spec:
labels:
app: rancher-webhook
spec:
{{- if or .Values.capi.enabled $auth.clientCA }}
volumes:
{{- end }}
{{- if .Values.capi.enabled }}
- name: tls
secret:
secretName: rancher-webhook-tls
{{- end }}
{{- if $auth.clientCA }}
volumes:
- name: client-ca
secret:
secretName: client-ca
Expand All @@ -40,14 +33,10 @@ spec:
- env:
- name: STAMP
value: "{{.Values.stamp}}"
- name: ENABLE_CAPI
value: "{{.Values.capi.enabled}}"
- name: ENABLE_MCM
value: "{{.Values.mcm.enabled}}"
- name: CATTLE_PORT
value: {{.Values.port | default 9443 | quote}}
- name: CATTLE_CAPI_PORT
value: {{.Values.capi.port | default 8777 | quote}}
- name: NAMESPACE
valueFrom:
fieldRef:
Expand All @@ -62,8 +51,6 @@ spec:
ports:
- name: https
containerPort: {{ .Values.port | default 9443 }}
- name: capi-https
containerPort: {{ .Values.capi.port | default 8777}}
startupProbe:
httpGet:
path: "/healthz"
Expand All @@ -77,15 +64,8 @@ spec:
port: "https"
scheme: "HTTPS"
periodSeconds: 5
{{- if or .Values.capi.enabled $auth.clientCA }}
volumeMounts:
{{- end }}
{{- if .Values.capi.enabled }}
- name: tls
mountPath: /tmp/k8s-webhook-server/serving-certs
readOnly: true
{{- end }}
{{- if $auth.clientCA }}
volumeMounts:
- name: client-ca
mountPath: /tmp/k8s-webhook-server/client-ca
readOnly: true
Expand Down
20 changes: 0 additions & 20 deletions charts/rancher-webhook/tests/capi-service_test.yaml

This file was deleted.

21 changes: 0 additions & 21 deletions charts/rancher-webhook/tests/deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@ tests:
- equal:
path: spec.template.spec.containers[0].ports[0].containerPort
value: 9443
- equal:
path: spec.template.spec.containers[0].ports[1].containerPort
value: 8777
- contains:
path: spec.template.spec.containers[0].env
content:
name: CATTLE_PORT
value: "9443"
- contains:
path: spec.template.spec.containers[0].env
content:
name: CATTLE_CAPI_PORT
value: "8777"

- it: should set updated webhook port
set:
Expand All @@ -35,19 +27,6 @@ tests:
name: CATTLE_PORT
value: "2319"

- it: should set updated capi port
set:
capi.port: 2319
asserts:
- equal:
path: spec.template.spec.containers[0].ports[1].containerPort
value: 2319
- contains:
path: spec.template.spec.containers[0].env
content:
name: CATTLE_CAPI_PORT
value: "2319"

- it: should not set capabilities by default.
asserts:
- isNull:
Expand Down
4 changes: 0 additions & 4 deletions charts/rancher-webhook/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ global:
systemDefaultRegistry: ""
hostNetwork: false

capi:
enabled: false
port: 8777

mcm:
enabled: true

Expand Down
19 changes: 4 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ require (
github.com/gorilla/mux v1.8.0
github.com/rancher/dynamiclistener v0.3.5
github.com/rancher/lasso v0.0.0-20230830164424-d684fdeb6f29
github.com/rancher/lasso/controller-runtime v0.0.0-20230830164424-d684fdeb6f29
github.com/rancher/rancher/pkg/apis v0.0.0-20240110005939-7c3215d8c035
github.com/rancher/rke v1.5.0
github.com/rancher/wrangler v1.1.1
Expand All @@ -52,24 +51,19 @@ require (
golang.org/x/text v0.13.0
golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846
k8s.io/api v0.27.6
k8s.io/apiextensions-apiserver v0.27.6
k8s.io/apimachinery v0.27.6
k8s.io/apiserver v0.27.6
k8s.io/client-go v12.0.0+incompatible
k8s.io/kubernetes v1.27.6
k8s.io/pod-security-admission v0.27.6
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
sigs.k8s.io/cluster-api v1.5.0
sigs.k8s.io/controller-runtime v0.15.0
sigs.k8s.io/yaml v1.3.0
)

require (
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.2.0 // indirect
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
github.com/NYTimes/gziphandler v1.1.1 // indirect
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect
github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 // indirect
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
Expand All @@ -89,31 +83,26 @@ require (
github.com/go-openapi/jsonpointer v0.20.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/gobuffalo/flect v1.0.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/cel-go v0.16.0 // indirect
github.com/google/cel-go v0.12.6 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
github.com/huandu/xstrings v1.3.3 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/onsi/gomega v1.27.10 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
Expand All @@ -126,8 +115,6 @@ require (
github.com/rancher/fleet/pkg/apis v0.0.0-20231017140638-93432f288e79 // indirect
github.com/rancher/gke-operator v1.2.0 // indirect
github.com/rancher/norman v0.0.0-20230831160711-5de27f66385d // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stoewer/go-strcase v1.2.0 // indirect
Expand Down Expand Up @@ -166,6 +153,7 @@ require (
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.27.5 // indirect
k8s.io/cloud-provider v0.0.0 // indirect
k8s.io/code-generator v0.27.5 // indirect
k8s.io/component-base v0.27.6 // indirect
Expand All @@ -180,6 +168,7 @@ require (
k8s.io/kubelet v0.0.0 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.2 // indirect
sigs.k8s.io/cli-utils v0.27.0 // indirect
sigs.k8s.io/cluster-api v1.5.0 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect
)
Loading

0 comments on commit 128b387

Please sign in to comment.