Skip to content

Commit 7dac510

Browse files
author
Joshua Reed
committed
Small fixup.
1 parent 72d9a2d commit 7dac510

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

controllers/cloudstackmachine_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func (r *CloudStackMachineReconciliationRunner) Reconcile() (retRes ctrl.Result,
9696
r.RequeueIfCloudStackClusterNotReady,
9797
r.ConsiderAffinity,
9898
r.SetFailureDomainOnCSMachine,
99-
r.GetObjectByName("placeholder", r.IsoNet, func() string { return r.FailureDomain.Spec.Network.Name }),
99+
r.GetObjectByName("placeholder", r.IsoNet, func() string { return r.IsoNetMetaName(r.FailureDomain.Spec.Network.Name) }),
100100
r.GetOrCreateVMInstance,
101101
r.RequeueIfInstanceNotRunning,
102102
r.AddToLBIfNeeded,

controllers/cloudstackzone_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func (r *CloudStackZoneReconciliationRunner) Reconcile() (retRes ctrl.Result, re
9696
netName := r.ReconciliationSubject.Spec.Network.Name
9797
if res, err := r.GenerateIsolatedNetwork(netName)(); r.ShouldReturn(res, err) {
9898
return res, err
99-
} else if res, err := r.GetObjectByName(netName, r.IsoNet)(); r.ShouldReturn(res, err) {
99+
} else if res, err := r.GetObjectByName(r.IsoNetMetaName(netName), r.IsoNet)(); r.ShouldReturn(res, err) {
100100
return res, err
101101
}
102102
if r.IsoNet.Name == "" {

controllers/utils/isolated_network.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ import (
2424
ctrl "sigs.k8s.io/controller-runtime"
2525
)
2626

27+
func (r *ReconciliationRunner) IsoNetMetaName(name string) string {
28+
return fmt.Sprintf("%s-%s", r.CSCluster.Name, strings.ToLower(name))
29+
}
30+
2731
// GenerateIsolatedNetwork of the passed name that's owned by the ReconciliationSubject.
2832
func (r *ReconciliationRunner) GenerateIsolatedNetwork(name string) CloudStackReconcilerMethod {
2933
return func() (ctrl.Result, error) {

0 commit comments

Comments
 (0)