Skip to content

Commit

Permalink
test: add env var to allow setting CPI to insecure and use it in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
chrischdi committed Jul 24, 2024
1 parent 450ef20 commit 90bcae1
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packaging/flavorgen/flavors/crs/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ func newCPIConfig() ([]byte, error) {
"secretName": "cloud-provider-vsphere-credentials",
"secretNamespace": metav1.NamespaceSystem,
"thumbprint": env.VSphereThumbprint,
"port": 443,
// insecureFlag needs to be set to true in CI when using older CPI versions
// because old versions of CPI (<= v1.29.0) do not support SHA256 thumbprints.
"insecureFlag": env.VSphereInsecureCPI,
"port": 443,
},
"vcenter": map[string]interface{}{
env.VSphereServerVar: map[string]interface{}{
Expand Down
1 change: 1 addition & 0 deletions packaging/flavorgen/flavors/env/envsubts_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const (
NodeIPAMPoolName = "${NODE_IPAM_POOL_NAME}"
VSphereDataCenterVar = "${VSPHERE_DATACENTER}"
VSphereThumbprint = "${VSPHERE_TLS_THUMBPRINT}"
VSphereInsecureCPI = "${VSPHERE_INSECURE_CPI:=false}"
VSphereDatastoreVar = "${VSPHERE_DATASTORE}"
VSphereFolderVar = "${VSPHERE_FOLDER}"
VSphereNetworkVar = "${VSPHERE_NETWORK}"
Expand Down
1 change: 0 additions & 1 deletion packaging/flavorgen/flavors/util/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ var (
regexVar(env.VSphereServerVar),
regexVar(env.VSphereTemplateVar),
regexVar(env.VSphereStoragePolicyVar),
// TODO: Why was thumbprint not here?
regexVar(env.VSphereThumbprint),
}
)
Expand Down
1 change: 1 addition & 0 deletions templates/cluster-template-external-loadbalancer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1260,6 +1260,7 @@ data:
data:
vsphere.conf: |
global:
insecureFlag: ${VSPHERE_INSECURE_CPI:=false}
port: 443
secretName: cloud-provider-vsphere-credentials
secretNamespace: kube-system
Expand Down
1 change: 1 addition & 0 deletions templates/cluster-template-ignition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1464,6 +1464,7 @@ data:
data:
vsphere.conf: |
global:
insecureFlag: ${VSPHERE_INSECURE_CPI:=false}
port: 443
secretName: cloud-provider-vsphere-credentials
secretNamespace: kube-system
Expand Down
1 change: 1 addition & 0 deletions templates/cluster-template-node-ipam.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1385,6 +1385,7 @@ data:
data:
vsphere.conf: |
global:
insecureFlag: ${VSPHERE_INSECURE_CPI:=false}
port: 443
secretName: cloud-provider-vsphere-credentials
secretNamespace: kube-system
Expand Down
1 change: 1 addition & 0 deletions templates/cluster-template-topology.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,7 @@ data:
data:
vsphere.conf: |
global:
insecureFlag: ${VSPHERE_INSECURE_CPI:=false}
port: 443
secretName: cloud-provider-vsphere-credentials
secretNamespace: kube-system
Expand Down
1 change: 1 addition & 0 deletions templates/cluster-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1375,6 +1375,7 @@ data:
data:
vsphere.conf: |
global:
insecureFlag: ${VSPHERE_INSECURE_CPI:=false}
port: 443
secretName: cloud-provider-vsphere-credentials
secretNamespace: kube-system
Expand Down
1 change: 1 addition & 0 deletions test/e2e/config/vsphere-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ variables:
VSPHERE_TEMPLATE: "ubuntu-2204-kube-v1.29.0"
FLATCAR_VSPHERE_TEMPLATE: "flatcar-stable-3602.2.3-kube-v1.29.0"
VSPHERE_INSECURE_CSI: "true"
VSPHERE_INSECURE_CPI: "true"
KUBETEST_CONFIGURATION: "./data/kubetest/conformance.yaml"
NODE_DRAIN_TIMEOUT: "60s"
CLUSTER_TOPOLOGY: "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ stringData:
user = "${VSPHERE_USERNAME}"
password = "${VSPHERE_PASSWORD}"
datacenters = "${VSPHERE_DATACENTER}"
insecureFlag = "${VSPHERE_INSECURE_CPI:=false}"
[Network]
public-network = "${VSPHERE_NETWORK}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,9 @@ data:
- --cloud-config=/etc/cloud/vsphere.conf
image: gcr.io/cloud-provider-vsphere/cpi/release/manager:${CPI_IMAGE_K8S_VERSION}
name: vsphere-cloud-controller-manager
env:
- name: VSPHERE_INSECURE
value: ${VSPHERE_INSECURE_CPI:=false}
resources:
requests:
cpu: 200m
Expand Down

0 comments on commit 90bcae1

Please sign in to comment.