Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] 🌱 clustermodule: create cluster module when template does not define any server #3377

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions packaging/flavorgen/flavors/generators.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ func defaultVirtualMachineCloneSpec() infrav1.VirtualMachineCloneSpec {
MemoryMiB: env.DefaultMemoryMiB,
Template: env.VSphereTemplateVar,
Server: env.VSphereServerVar,
Thumbprint: env.VSphereThumbprint,
ResourcePool: env.VSphereResourcePoolVar,
Datastore: env.VSphereDatastoreVar,
StoragePolicyName: env.VSphereStoragePolicyVar,
Expand Down Expand Up @@ -433,7 +432,6 @@ func nodeIPAMVirtualMachineCloneSpec() infrav1.VirtualMachineCloneSpec {
MemoryMiB: env.DefaultMemoryMiB,
Template: env.VSphereTemplateVar,
Server: env.VSphereServerVar,
Thumbprint: env.VSphereThumbprint,
ResourcePool: env.VSphereResourcePoolVar,
Datastore: env.VSphereDatastoreVar,
StoragePolicyName: env.VSphereStoragePolicyVar,
Expand Down
2 changes: 1 addition & 1 deletion pkg/clustermodule/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (s *service) Create(ctx context.Context, clusterCtx *capvcontext.ClusterCon
if err != nil {
return "", errors.Wrapf(err, "error fetching machine template for object %s/%s", wrapper.GetNamespace(), wrapper.GetName())
}
if server := template.Spec.Template.Spec.Server; server != clusterCtx.VSphereCluster.Spec.Server {
if server := template.Spec.Template.Spec.Server; server != "" && server != clusterCtx.VSphereCluster.Spec.Server {
log.V(4).Info("Skipping module creation for object since template uses a different server", "server", server)
return "", nil
}
Expand Down
2 changes: 0 additions & 2 deletions templates/cluster-template-external-loadbalancer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ spec:
server: '${VSPHERE_SERVER}'
storagePolicyName: '${VSPHERE_STORAGE_POLICY}'
template: '${VSPHERE_TEMPLATE}'
thumbprint: '${VSPHERE_TLS_THUMBPRINT}'
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: VSphereMachineTemplate
Expand All @@ -86,7 +85,6 @@ spec:
server: '${VSPHERE_SERVER}'
storagePolicyName: '${VSPHERE_STORAGE_POLICY}'
template: '${VSPHERE_TEMPLATE}'
thumbprint: '${VSPHERE_TLS_THUMBPRINT}'
---
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: KubeadmControlPlane
Expand Down
1 change: 0 additions & 1 deletion templates/cluster-template-ignition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ spec:
server: '${VSPHERE_SERVER}'
storagePolicyName: '${VSPHERE_STORAGE_POLICY}'
template: '${VSPHERE_TEMPLATE}'
thumbprint: '${VSPHERE_TLS_THUMBPRINT}'
---
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: KubeadmControlPlane
Expand Down
2 changes: 0 additions & 2 deletions templates/cluster-template-node-ipam.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ spec:
server: '${VSPHERE_SERVER}'
storagePolicyName: '${VSPHERE_STORAGE_POLICY}'
template: '${VSPHERE_TEMPLATE}'
thumbprint: '${VSPHERE_TLS_THUMBPRINT}'
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: VSphereMachineTemplate
Expand Down Expand Up @@ -96,7 +95,6 @@ spec:
server: '${VSPHERE_SERVER}'
storagePolicyName: '${VSPHERE_STORAGE_POLICY}'
template: '${VSPHERE_TEMPLATE}'
thumbprint: '${VSPHERE_TLS_THUMBPRINT}'
---
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: KubeadmControlPlane
Expand Down
2 changes: 0 additions & 2 deletions templates/cluster-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ spec:
server: '${VSPHERE_SERVER}'
storagePolicyName: '${VSPHERE_STORAGE_POLICY}'
template: '${VSPHERE_TEMPLATE}'
thumbprint: '${VSPHERE_TLS_THUMBPRINT}'
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: VSphereMachineTemplate
Expand All @@ -86,7 +85,6 @@ spec:
server: '${VSPHERE_SERVER}'
storagePolicyName: '${VSPHERE_STORAGE_POLICY}'
template: '${VSPHERE_TEMPLATE}'
thumbprint: '${VSPHERE_TLS_THUMBPRINT}'
---
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: KubeadmControlPlane
Expand Down
2 changes: 0 additions & 2 deletions templates/clusterclass-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ spec:
server: '${VSPHERE_SERVER}'
storagePolicyName: '${VSPHERE_STORAGE_POLICY}'
template: '${VSPHERE_TEMPLATE}'
thumbprint: '${VSPHERE_TLS_THUMBPRINT}'
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: VSphereMachineTemplate
Expand All @@ -312,7 +311,6 @@ spec:
server: '${VSPHERE_SERVER}'
storagePolicyName: '${VSPHERE_STORAGE_POLICY}'
template: '${VSPHERE_TEMPLATE}'
thumbprint: '${VSPHERE_TLS_THUMBPRINT}'
---
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: KubeadmControlPlaneTemplate
Expand Down
Loading