Skip to content

Commit

Permalink
Use vmware-system-csi namespace when generating certs for CSI webhooks (
Browse files Browse the repository at this point in the history
#2374)

Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>

Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
Co-authored-by: Marko Mudrinić <mudrinic.mare@gmail.com>
  • Loading branch information
kubermatic-bot and xmudrii authored Sep 24, 2022
1 parent 3115519 commit 23afc68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/addons/applier.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ func csiWebhookCerts(s *state.State, data *templateData, csiMigration bool, kube
if err := webhookCerts(data.Certificates,
webhookCertsCSI,
resources.GenericCSIWebhookName,
resources.GenericCSIWebhookNamespace,
resources.VsphereCSIWebhookNamespace,
s.Cluster.ClusterNetwork.ServiceDomainName,
kubeCAPrivateKey,
kubeCACert,
Expand All @@ -293,7 +293,7 @@ func csiWebhookCerts(s *state.State, data *templateData, csiMigration bool, kube
if err := webhookCerts(data.Certificates,
"CSIMigration",
resources.VsphereCSIWebhookName,
resources.GenericCSIWebhookNamespace,
resources.VsphereCSIWebhookNamespace,
s.Cluster.ClusterNetwork.ServiceDomainName,
kubeCAPrivateKey,
kubeCACert,
Expand All @@ -317,7 +317,7 @@ func csiWebhookCerts(s *state.State, data *templateData, csiMigration bool, kube
return nil
}

func webhookCerts(certs map[string]string, prefix, webhookName, webhookNamespace, serviceDomainName string, kubeCAPrivateKey *rsa.PrivateKey, kubeCACert *x509.Certificate) error { //nolint:unparam
func webhookCerts(certs map[string]string, prefix, webhookName, webhookNamespace, serviceDomainName string, kubeCAPrivateKey *rsa.PrivateKey, kubeCACert *x509.Certificate) error {
certsMap, err := certificate.NewSignedTLSCert(
webhookName,
webhookNamespace,
Expand Down
1 change: 1 addition & 0 deletions pkg/templates/resources/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const (
MetricsServerNamespace = metav1.NamespaceSystem

VsphereCSIWebhookName = "vsphere-webhook-svc"
VsphereCSIWebhookNamespace = "vmware-system-csi"
NutanixCSIWebhookName = "csi-snapshot-webhook"
GenericCSIWebhookName = "snapshot-validation-service"
GenericCSIWebhookNamespace = metav1.NamespaceSystem
Expand Down

0 comments on commit 23afc68

Please sign in to comment.