Skip to content

Commit

Permalink
Merge pull request #761 from alexanderConstantinescu/simplify-ca-bund…
Browse files Browse the repository at this point in the history
…le-injection

Simplify CA Bundle injection for multus admission webhook
  • Loading branch information
openshift-merge-robot committed Oct 28, 2020
2 parents dc872a6 + 3a2d240 commit 5483fd3
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 130 deletions.
2 changes: 2 additions & 0 deletions bindata/network/multus-admission-controller/003-webhook.yaml
Expand Up @@ -5,6 +5,8 @@ metadata:
name: {{.MultusValidatingWebhookName}}
labels:
app: multus-admission-controller
annotations:
service.beta.openshift.io/inject-cabundle: "true"
webhooks:
- name: multus-validating-config.k8s.io
clientConfig:
Expand Down
10 changes: 0 additions & 10 deletions bindata/network/multus-admission-controller/004-configmap.yaml

This file was deleted.

1 change: 0 additions & 1 deletion pkg/controller/add_networkconfig.go
Expand Up @@ -15,7 +15,6 @@ func init() {
proxyconfig.Add,
operconfig.Add,
clusterconfig.Add,
operconfig.AddConfigMapReconciler,
configmapcainjector.Add,
)
}
112 changes: 0 additions & 112 deletions pkg/controller/operconfig/configmap_controller.go

This file was deleted.

4 changes: 0 additions & 4 deletions pkg/names/names.go
Expand Up @@ -44,10 +44,6 @@ const KuryrOctaviaProviderAnnotation = "networkoperator.openshift.io/kuryr-octav
// KuryrOctaviaVersionAnnotation is used to save latest Octavia version detected
const KuryrOctaviaVersionAnnotation = "networkoperator.openshift.io/kuryr-octavia-version"

// SERVICE_CA_CONFIGMAP is the name of the ConfigMap that contains service CA bundle
// that is used in multus admission controller deployment
const SERVICE_CA_CONFIGMAP = "openshift-service-ca"

// MULTUS_VALIDATING_WEBHOOK is the name of the ValidatingWebhookConfiguration for multus-admission-controller
// that is used in multus admission controller deployment
const MULTUS_VALIDATING_WEBHOOK = "multus.openshift.io"
Expand Down
1 change: 0 additions & 1 deletion pkg/network/multus_admission_controller.go
Expand Up @@ -19,7 +19,6 @@ func renderMultusAdmissonControllerConfig(manifestDir string) ([]*uns.Unstructur
data.Data["ReleaseVersion"] = os.Getenv("RELEASE_VERSION")
data.Data["MultusAdmissionControllerImage"] = os.Getenv("MULTUS_ADMISSION_CONTROLLER_IMAGE")
data.Data["MultusValidatingWebhookName"] = names.MULTUS_VALIDATING_WEBHOOK
data.Data["ServiceCAConfigMap"] = names.SERVICE_CA_CONFIGMAP
data.Data["KubeRBACProxyImage"] = os.Getenv("KUBE_RBAC_PROXY_IMAGE")

manifests, err := render.RenderDir(filepath.Join(manifestDir, "network/multus-admission-controller"), &data)
Expand Down
3 changes: 1 addition & 2 deletions pkg/network/multus_admission_controller_test.go
Expand Up @@ -50,12 +50,11 @@ func TestRenderMultusAdmissionController(t *testing.T) {
g.Expect(objs).To(ContainElement(HaveKubernetesID("DaemonSet", "openshift-multus", "multus-admission-controller")))

// Check rendered object
g.Expect(len(objs)).To(Equal(10))
g.Expect(len(objs)).To(Equal(9))
g.Expect(objs).To(ContainElement(HaveKubernetesID("Service", "openshift-multus", "multus-admission-controller")))
g.Expect(objs).To(ContainElement(HaveKubernetesID("ClusterRole", "", "multus-admission-controller-webhook")))
g.Expect(objs).To(ContainElement(HaveKubernetesID("ClusterRoleBinding", "", "multus-admission-controller-webhook")))
g.Expect(objs).To(ContainElement(HaveKubernetesID("ValidatingWebhookConfiguration", "", names.MULTUS_VALIDATING_WEBHOOK)))
g.Expect(objs).To(ContainElement(HaveKubernetesID("ConfigMap", "openshift-network-operator", names.SERVICE_CA_CONFIGMAP)))
g.Expect(objs).To(ContainElement(HaveKubernetesID("DaemonSet", "openshift-multus", "multus-admission-controller")))

// Make sure every obj is reasonable:
Expand Down

0 comments on commit 5483fd3

Please sign in to comment.