From 204f963d42a3f78d7865adadec54d423c62767f2 Mon Sep 17 00:00:00 2001 From: PatrickLaabs Date: Wed, 8 Mar 2023 10:19:17 +0100 Subject: [PATCH 1/4] Added Thumbprint and Insecure configuration for the csi-driver --- packaging/flavorgen/flavors/crs/csi.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packaging/flavorgen/flavors/crs/csi.go b/packaging/flavorgen/flavors/crs/csi.go index 703e3e98a2..d1f4b9c360 100644 --- a/packaging/flavorgen/flavors/crs/csi.go +++ b/packaging/flavorgen/flavors/crs/csi.go @@ -128,6 +128,8 @@ func ConfigForCSI() *types.CPIConfig { config := &types.CPIConfig{} config.Global.ClusterID = fmt.Sprintf("%s/%s", env.NamespaceVar, env.ClusterNameVar) + config.Global.Thumbprint = env.VSphereThumbprint + config.Global.Insecure = env.VSphereInsecure config.Network.Name = env.VSphereNetworkVar config.VCenter = map[string]types.CPIVCenterConfig{ From d2f865ab855abe5c01eb5f355834bf009d430f1e Mon Sep 17 00:00:00 2001 From: PatrickLaabs Date: Wed, 8 Mar 2023 10:20:00 +0100 Subject: [PATCH 2/4] Added VSphereInsecure to the envs --- packaging/flavorgen/flavors/env/envsubts_consts.go | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/flavorgen/flavors/env/envsubts_consts.go b/packaging/flavorgen/flavors/env/envsubts_consts.go index a2ca6d790c..0e65fb7712 100644 --- a/packaging/flavorgen/flavors/env/envsubts_consts.go +++ b/packaging/flavorgen/flavors/env/envsubts_consts.go @@ -47,4 +47,5 @@ const ( VSphereUsername = "${VSPHERE_USERNAME}" VSpherePassword = "${VSPHERE_PASSWORD}" /* #nosec */ ClusterResourceSetNameSuffix = "-crs-0" + VSphereInsecure = true ) From 2ce72fdd33f2f1cb5ed17047ee2e01dfe10010cf Mon Sep 17 00:00:00 2001 From: PatrickLaabs Date: Wed, 8 Mar 2023 10:22:10 +0100 Subject: [PATCH 3/4] new generated template-files added, Thumbprint and Insecure-Flag is now being set --- templates/cluster-template-external-loadbalancer.yaml | 2 ++ templates/cluster-template-ignition.yaml | 2 ++ templates/cluster-template-topology.yaml | 2 ++ templates/cluster-template.yaml | 2 ++ 4 files changed, 8 insertions(+) diff --git a/templates/cluster-template-external-loadbalancer.yaml b/templates/cluster-template-external-loadbalancer.yaml index 678df92845..6e8c5caa14 100644 --- a/templates/cluster-template-external-loadbalancer.yaml +++ b/templates/cluster-template-external-loadbalancer.yaml @@ -390,6 +390,8 @@ stringData: stringData: csi-vsphere.conf: |+ [Global] + insecure-flag = true + thumbprint = "${VSPHERE_TLS_THUMBPRINT}" cluster-id = "${NAMESPACE}/${CLUSTER_NAME}" [VirtualCenter "${VSPHERE_SERVER}"] diff --git a/templates/cluster-template-ignition.yaml b/templates/cluster-template-ignition.yaml index 0ef212de26..01fc05bac7 100644 --- a/templates/cluster-template-ignition.yaml +++ b/templates/cluster-template-ignition.yaml @@ -533,6 +533,8 @@ stringData: stringData: csi-vsphere.conf: |+ [Global] + insecure-flag = true + thumbprint = "${VSPHERE_TLS_THUMBPRINT}" cluster-id = "${NAMESPACE}/${CLUSTER_NAME}" [VirtualCenter "${VSPHERE_SERVER}"] diff --git a/templates/cluster-template-topology.yaml b/templates/cluster-template-topology.yaml index 49d69170c0..de2ff024c1 100644 --- a/templates/cluster-template-topology.yaml +++ b/templates/cluster-template-topology.yaml @@ -285,6 +285,8 @@ stringData: stringData: csi-vsphere.conf: |+ [Global] + insecure-flag = true + thumbprint = "${VSPHERE_TLS_THUMBPRINT}" cluster-id = "${NAMESPACE}/${CLUSTER_NAME}" [VirtualCenter "${VSPHERE_SERVER}"] diff --git a/templates/cluster-template.yaml b/templates/cluster-template.yaml index 078f41163b..f2b5cf10a7 100644 --- a/templates/cluster-template.yaml +++ b/templates/cluster-template.yaml @@ -446,6 +446,8 @@ stringData: stringData: csi-vsphere.conf: |+ [Global] + insecure-flag = true + thumbprint = "${VSPHERE_TLS_THUMBPRINT}" cluster-id = "${NAMESPACE}/${CLUSTER_NAME}" [VirtualCenter "${VSPHERE_SERVER}"] From 32a0e8ef13ced7369cd57b289f39751958ef4189 Mon Sep 17 00:00:00 2001 From: PatrickLaabs Date: Fri, 28 Apr 2023 10:13:36 +0200 Subject: [PATCH 4/4] Removed Insecure-Flag changes, keeping Thumbprint passing and added Thumbprint passing to node-ipam-template Author: PatrickLaabs --- packaging/flavorgen/flavors/crs/csi.go | 1 - packaging/flavorgen/flavors/env/envsubts_consts.go | 1 - templates/cluster-template-external-loadbalancer.yaml | 1 - templates/cluster-template-ignition.yaml | 1 - templates/cluster-template-node-ipam.yaml | 1 + templates/cluster-template-topology.yaml | 1 - templates/cluster-template.yaml | 1 - 7 files changed, 1 insertion(+), 6 deletions(-) diff --git a/packaging/flavorgen/flavors/crs/csi.go b/packaging/flavorgen/flavors/crs/csi.go index d1f4b9c360..7974bb1a03 100644 --- a/packaging/flavorgen/flavors/crs/csi.go +++ b/packaging/flavorgen/flavors/crs/csi.go @@ -129,7 +129,6 @@ func ConfigForCSI() *types.CPIConfig { config.Global.ClusterID = fmt.Sprintf("%s/%s", env.NamespaceVar, env.ClusterNameVar) config.Global.Thumbprint = env.VSphereThumbprint - config.Global.Insecure = env.VSphereInsecure config.Network.Name = env.VSphereNetworkVar config.VCenter = map[string]types.CPIVCenterConfig{ diff --git a/packaging/flavorgen/flavors/env/envsubts_consts.go b/packaging/flavorgen/flavors/env/envsubts_consts.go index 0ad96d4fb8..5bab921cd5 100644 --- a/packaging/flavorgen/flavors/env/envsubts_consts.go +++ b/packaging/flavorgen/flavors/env/envsubts_consts.go @@ -51,5 +51,4 @@ const ( VSphereUsername = "${VSPHERE_USERNAME}" VSpherePassword = "${VSPHERE_PASSWORD}" /* #nosec */ ClusterResourceSetNameSuffix = "-crs-0" - VSphereInsecure = true ) diff --git a/templates/cluster-template-external-loadbalancer.yaml b/templates/cluster-template-external-loadbalancer.yaml index 6e8c5caa14..8252a0d5b6 100644 --- a/templates/cluster-template-external-loadbalancer.yaml +++ b/templates/cluster-template-external-loadbalancer.yaml @@ -390,7 +390,6 @@ stringData: stringData: csi-vsphere.conf: |+ [Global] - insecure-flag = true thumbprint = "${VSPHERE_TLS_THUMBPRINT}" cluster-id = "${NAMESPACE}/${CLUSTER_NAME}" diff --git a/templates/cluster-template-ignition.yaml b/templates/cluster-template-ignition.yaml index 4865d5b36c..5ed2e32150 100644 --- a/templates/cluster-template-ignition.yaml +++ b/templates/cluster-template-ignition.yaml @@ -533,7 +533,6 @@ stringData: stringData: csi-vsphere.conf: |+ [Global] - insecure-flag = true thumbprint = "${VSPHERE_TLS_THUMBPRINT}" cluster-id = "${NAMESPACE}/${CLUSTER_NAME}" diff --git a/templates/cluster-template-node-ipam.yaml b/templates/cluster-template-node-ipam.yaml index 8eb82e8e33..ac0901f058 100644 --- a/templates/cluster-template-node-ipam.yaml +++ b/templates/cluster-template-node-ipam.yaml @@ -456,6 +456,7 @@ stringData: stringData: csi-vsphere.conf: |+ [Global] + thumbprint = "${VSPHERE_TLS_THUMBPRINT}" cluster-id = "${NAMESPACE}/${CLUSTER_NAME}" [VirtualCenter "${VSPHERE_SERVER}"] diff --git a/templates/cluster-template-topology.yaml b/templates/cluster-template-topology.yaml index 85188ae57e..078653a4be 100644 --- a/templates/cluster-template-topology.yaml +++ b/templates/cluster-template-topology.yaml @@ -285,7 +285,6 @@ stringData: stringData: csi-vsphere.conf: |+ [Global] - insecure-flag = true thumbprint = "${VSPHERE_TLS_THUMBPRINT}" cluster-id = "${NAMESPACE}/${CLUSTER_NAME}" diff --git a/templates/cluster-template.yaml b/templates/cluster-template.yaml index 5588258ba5..0048c12797 100644 --- a/templates/cluster-template.yaml +++ b/templates/cluster-template.yaml @@ -446,7 +446,6 @@ stringData: stringData: csi-vsphere.conf: |+ [Global] - insecure-flag = true thumbprint = "${VSPHERE_TLS_THUMBPRINT}" cluster-id = "${NAMESPACE}/${CLUSTER_NAME}"