Skip to content

Commit

Permalink
flavorgen: enforce VSPHERE_USERNAME and VSPHERE_PASSWORD variables to…
Browse files Browse the repository at this point in the history
… be set as string in templates
  • Loading branch information
chrischdi committed Jun 3, 2024
1 parent 6e8e237 commit 7ecaf89
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 29 deletions.
3 changes: 2 additions & 1 deletion packaging/flavorgen/flavors/util/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ var (
regexVar(env.VSphereServerVar),
regexVar(env.VSphereTemplateVar),
regexVar(env.VSphereStoragePolicyVar),
// TODO: Why was thumbprint not here?
regexVar(env.VSphereThumbprint),
regexVar(env.VSphereUsername),
regexVar(env.VSpherePassword),
}
)

Expand Down
8 changes: 4 additions & 4 deletions templates/cluster-template-external-loadbalancer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ metadata:
name: '${CLUSTER_NAME}'
namespace: '${NAMESPACE}'
stringData:
password: ${VSPHERE_PASSWORD}
username: ${VSPHERE_USERNAME}
password: '${VSPHERE_PASSWORD}'
username: '${VSPHERE_USERNAME}'
---
apiVersion: v1
kind: Secret
Expand Down Expand Up @@ -1124,8 +1124,8 @@ stringData:
name: cloud-provider-vsphere-credentials
namespace: kube-system
stringData:
${VSPHERE_SERVER}.password: ${VSPHERE_PASSWORD}
${VSPHERE_SERVER}.username: ${VSPHERE_USERNAME}
${VSPHERE_SERVER}.password: '${VSPHERE_PASSWORD}'
${VSPHERE_SERVER}.username: '${VSPHERE_USERNAME}'
type: Opaque
type: addons.cluster.x-k8s.io/resource-set
---
Expand Down
8 changes: 4 additions & 4 deletions templates/cluster-template-ignition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,8 @@ metadata:
name: '${CLUSTER_NAME}'
namespace: '${NAMESPACE}'
stringData:
password: ${VSPHERE_PASSWORD}
username: ${VSPHERE_USERNAME}
password: '${VSPHERE_PASSWORD}'
username: '${VSPHERE_USERNAME}'
---
apiVersion: v1
kind: Secret
Expand Down Expand Up @@ -1338,8 +1338,8 @@ stringData:
name: cloud-provider-vsphere-credentials
namespace: kube-system
stringData:
${VSPHERE_SERVER}.password: ${VSPHERE_PASSWORD}
${VSPHERE_SERVER}.username: ${VSPHERE_USERNAME}
${VSPHERE_SERVER}.password: '${VSPHERE_PASSWORD}'
${VSPHERE_SERVER}.username: '${VSPHERE_USERNAME}'
type: Opaque
type: addons.cluster.x-k8s.io/resource-set
---
Expand Down
8 changes: 4 additions & 4 deletions templates/cluster-template-node-ipam.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ metadata:
name: '${CLUSTER_NAME}'
namespace: '${NAMESPACE}'
stringData:
password: ${VSPHERE_PASSWORD}
username: ${VSPHERE_USERNAME}
password: '${VSPHERE_PASSWORD}'
username: '${VSPHERE_USERNAME}'
---
apiVersion: v1
kind: Secret
Expand Down Expand Up @@ -1259,8 +1259,8 @@ stringData:
name: cloud-provider-vsphere-credentials
namespace: kube-system
stringData:
${VSPHERE_SERVER}.password: ${VSPHERE_PASSWORD}
${VSPHERE_SERVER}.username: ${VSPHERE_USERNAME}
${VSPHERE_SERVER}.password: '${VSPHERE_PASSWORD}'
${VSPHERE_SERVER}.username: '${VSPHERE_USERNAME}'
type: Opaque
type: addons.cluster.x-k8s.io/resource-set
---
Expand Down
8 changes: 4 additions & 4 deletions templates/cluster-template-supervisor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ metadata:
name: '${CLUSTER_NAME}'
namespace: '${NAMESPACE}'
stringData:
password: ${VSPHERE_PASSWORD}
username: ${VSPHERE_USERNAME}
password: '${VSPHERE_PASSWORD}'
username: '${VSPHERE_USERNAME}'
---
apiVersion: v1
kind: Secret
Expand Down Expand Up @@ -1218,8 +1218,8 @@ stringData:
name: cloud-provider-vsphere-credentials
namespace: kube-system
stringData:
${VSPHERE_SERVER}.password: ${VSPHERE_PASSWORD}
${VSPHERE_SERVER}.username: ${VSPHERE_USERNAME}
${VSPHERE_SERVER}.password: '${VSPHERE_PASSWORD}'
${VSPHERE_SERVER}.username: '${VSPHERE_USERNAME}'
type: Opaque
type: addons.cluster.x-k8s.io/resource-set
---
Expand Down
8 changes: 4 additions & 4 deletions templates/cluster-template-topology-supervisor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ metadata:
name: '${CLUSTER_NAME}'
namespace: '${NAMESPACE}'
stringData:
password: ${VSPHERE_PASSWORD}
username: ${VSPHERE_USERNAME}
password: '${VSPHERE_PASSWORD}'
username: '${VSPHERE_USERNAME}'
---
apiVersion: addons.cluster.x-k8s.io/v1beta1
kind: ClusterResourceSet
Expand Down Expand Up @@ -1026,8 +1026,8 @@ stringData:
name: cloud-provider-vsphere-credentials
namespace: kube-system
stringData:
${VSPHERE_SERVER}.password: ${VSPHERE_PASSWORD}
${VSPHERE_SERVER}.username: ${VSPHERE_USERNAME}
${VSPHERE_SERVER}.password: '${VSPHERE_PASSWORD}'
${VSPHERE_SERVER}.username: '${VSPHERE_USERNAME}'
type: Opaque
type: addons.cluster.x-k8s.io/resource-set
---
Expand Down
8 changes: 4 additions & 4 deletions templates/cluster-template-topology.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ metadata:
name: '${CLUSTER_NAME}'
namespace: '${NAMESPACE}'
stringData:
password: ${VSPHERE_PASSWORD}
username: ${VSPHERE_USERNAME}
password: '${VSPHERE_PASSWORD}'
username: '${VSPHERE_USERNAME}'
---
apiVersion: addons.cluster.x-k8s.io/v1beta1
kind: ClusterResourceSet
Expand Down Expand Up @@ -1032,8 +1032,8 @@ stringData:
name: cloud-provider-vsphere-credentials
namespace: kube-system
stringData:
${VSPHERE_SERVER}.password: ${VSPHERE_PASSWORD}
${VSPHERE_SERVER}.username: ${VSPHERE_USERNAME}
${VSPHERE_SERVER}.password: '${VSPHERE_PASSWORD}'
${VSPHERE_SERVER}.username: '${VSPHERE_USERNAME}'
type: Opaque
type: addons.cluster.x-k8s.io/resource-set
---
Expand Down
8 changes: 4 additions & 4 deletions templates/cluster-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ metadata:
name: '${CLUSTER_NAME}'
namespace: '${NAMESPACE}'
stringData:
password: ${VSPHERE_PASSWORD}
username: ${VSPHERE_USERNAME}
password: '${VSPHERE_PASSWORD}'
username: '${VSPHERE_USERNAME}'
---
apiVersion: v1
kind: Secret
Expand Down Expand Up @@ -1249,8 +1249,8 @@ stringData:
name: cloud-provider-vsphere-credentials
namespace: kube-system
stringData:
${VSPHERE_SERVER}.password: ${VSPHERE_PASSWORD}
${VSPHERE_SERVER}.username: ${VSPHERE_USERNAME}
${VSPHERE_SERVER}.password: '${VSPHERE_PASSWORD}'
${VSPHERE_SERVER}.username: '${VSPHERE_USERNAME}'
type: Opaque
type: addons.cluster.x-k8s.io/resource-set
---
Expand Down

0 comments on commit 7ecaf89

Please sign in to comment.