Skip to content

Commit f70822e

Browse files
wongniJoshua Reed
andauthored
Feature/support id as well as name (#47)
* Added testenv local install and few other fixes. * Revert test to lint first. * Use curl for prow compatibility. * Wrong repo derp. * Trigger prow. * Run tests in build to get tests in prow. * Trigger prow. * Take network ID as well as network name when resolving network * Support service offering ID and template ID * Support zone ID when getting ID with zone name * Update test contexts and 'it' descriptions Add a new test for service offering ID and template ID * Add binaries dependency to test target for missing binaries * Added testenv local install and few other fixes. * Revert test to lint first. * Use curl for prow compatibility. * Wrong repo derp. * Trigger prow. * Run tests in build to get tests in prow. * Trigger prow. * Add verbose to troubleshoot lint timeout. * Add lint timeout increase for non-caching-ness. * Cleanup in many spots. * Fix unit test failures * Use multierror package to handle errors from fetching resources by name and/or ID * Use := notions instead of explicit variable definitions Co-authored-by: Joshua Reed <[email protected]> Co-authored-by: Wonkun Kim <[email protected]>
1 parent 918112b commit f70822e

File tree

8 files changed

+200
-65
lines changed

8 files changed

+200
-65
lines changed

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ require (
66
github.com/apache/cloudstack-go/v2 v2.11.1-0.20211020121644-369057554f66
77
github.com/go-logr/logr v0.1.0
88
github.com/golang/mock v1.6.0
9+
github.com/hashicorp/go-multierror v1.1.1
910
github.com/onsi/ginkgo v1.16.4
1011
github.com/onsi/gomega v1.16.0
1112
github.com/pkg/errors v0.9.1

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,10 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de
224224
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
225225
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
226226
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
227+
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
228+
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
229+
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
230+
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
227231
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
228232
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
229233
github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=

pkg/cloud/cluster.go

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,39 @@ package cloud
1818

1919
import (
2020
infrav1 "github.com/aws/cluster-api-provider-cloudstack-staging/api/v1alpha3"
21+
multierror "github.com/hashicorp/go-multierror"
2122
"github.com/pkg/errors"
2223
)
2324

24-
func (c *client) GetOrCreateCluster(csCluster *infrav1.CloudStackCluster) (retErr error) {
25-
var count int
25+
func (c *client) ResolveZone(csCluster *infrav1.CloudStackCluster) (retErr error) {
26+
if zoneID, count, err := c.cs.Zone.GetZoneID(csCluster.Spec.Zone); err != nil {
27+
retErr = multierror.Append(retErr, errors.Wrapf(
28+
err, "Could not get Zone ID from %s.", csCluster.Spec.Zone))
29+
} else if count != 1 {
30+
retErr = multierror.Append(retErr, errors.Errorf(
31+
"Expected 1 Zone with name %s, but got %d.", csCluster.Spec.Zone, count))
32+
} else {
33+
csCluster.Status.ZoneID = zoneID
34+
}
2635

27-
// Translate zone name to zone ID.
28-
csCluster.Status.ZoneID, count, retErr = c.cs.Zone.GetZoneID(csCluster.Spec.Zone)
2936
if retErr != nil {
30-
return retErr
31-
} else if count != 1 {
32-
return errors.Errorf("Expected 1 zone with name %s, but got %d.", csCluster.Spec.Zone, count)
37+
if _, count, err := c.cs.Zone.GetZoneByID(csCluster.Spec.Zone); err != nil {
38+
return multierror.Append(retErr, errors.Wrapf(
39+
err, "Could not get Zone by ID %s.", csCluster.Spec.Zone))
40+
} else if count != 1 {
41+
return multierror.Append(retErr, errors.Errorf(
42+
"Expected 1 Zone with UUID %s, but got %d.", csCluster.Spec.Zone, count))
43+
} else {
44+
csCluster.Status.ZoneID = csCluster.Spec.Zone
45+
}
46+
}
47+
48+
return nil
49+
}
50+
51+
func (c *client) GetOrCreateCluster(csCluster *infrav1.CloudStackCluster) (retErr error) {
52+
if retErr = c.ResolveZone(csCluster); retErr != nil {
53+
return errors.Wrapf(retErr, "Error resolving Zone details for Cluster %s.", csCluster.Name)
3354
}
3455

3556
// Get or create network and needed network constructs.

pkg/cloud/cluster_test.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,12 @@ var _ = Describe("Cluster", func() {
3333
mockCtrl *gomock.Controller
3434
mockClient *cloudstack.CloudStackClient
3535
zs *cloudstack.MockZoneServiceIface
36-
ns *cloudstack.MockNetworkServiceIface
3736
)
3837

3938
BeforeEach(func() {
4039
mockCtrl = gomock.NewController(GinkgoT())
4140
mockClient = cloudstack.NewMockClient(mockCtrl)
4241
zs = mockClient.Zone.(*cloudstack.MockZoneServiceIface)
43-
ns = mockClient.Network.(*cloudstack.MockNetworkServiceIface)
4442
client = cloud.NewClientFromCSAPIClient(mockClient)
4543
})
4644

@@ -72,14 +70,21 @@ var _ = Describe("Cluster", func() {
7270
// })
7371

7472
It("handles zone not found.", func() {
75-
zs.EXPECT().GetZoneID(zoneName).Return(zoneID, 1, nil)
76-
7773
expectedErr := fmt.Errorf("Not found")
78-
ns.EXPECT().GetNetworkID(netName).Return("", -1, expectedErr)
74+
zs.EXPECT().GetZoneID(zoneName).Return("", -1, expectedErr)
75+
zs.EXPECT().GetZoneByID(zoneName).Return(nil, -1, expectedErr)
7976

8077
err := client.GetOrCreateCluster(cluster)
8178
Expect(errors.Cause(err)).To(MatchError(expectedErr))
8279
})
8380

81+
It("handles multiple zone IDs returned", func() {
82+
zs.EXPECT().GetZoneID(zoneName).Return(zoneID, 2, nil)
83+
zs.EXPECT().GetZoneByID(zoneName).Return(nil, -1, fmt.Errorf("Not found"))
84+
85+
err := client.GetOrCreateCluster(cluster)
86+
Expect(err.Error()).To(ContainSubstring("Expected 1 Zone with name zoneName, but got 2."))
87+
Expect(err.Error()).To(ContainSubstring("Could not get Zone by ID zoneName.: Not found"))
88+
})
8489
})
8590
})

pkg/cloud/instance.go

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717
package cloud
1818

1919
import (
20-
"errors"
2120
"fmt"
2221
"net"
2322

@@ -27,6 +26,8 @@ import (
2726

2827
"github.com/apache/cloudstack-go/v2/cloudstack"
2928
infrav1 "github.com/aws/cluster-api-provider-cloudstack-staging/api/v1alpha3"
29+
multierror "github.com/hashicorp/go-multierror"
30+
"github.com/pkg/errors"
3031
corev1 "k8s.io/api/core/v1"
3132
"k8s.io/utils/pointer"
3233
)
@@ -70,6 +71,56 @@ func (c *client) ResolveVMInstanceDetails(csMachine *infrav1.CloudStackMachine)
7071
return errors.New("no match found")
7172
}
7273

74+
func (c *client) ResolveServiceOffering(csMachine *infrav1.CloudStackMachine) (offeringID string, retErr error) {
75+
offeringID, count, err := c.cs.ServiceOffering.GetServiceOfferingID(csMachine.Spec.Offering)
76+
if err != nil {
77+
retErr = multierror.Append(retErr, errors.Wrapf(
78+
err, "Could not get Service Offering ID from %s.", csMachine.Spec.Offering))
79+
} else if count != 1 {
80+
retErr = multierror.Append(retErr, errors.Errorf(
81+
"Expected 1 Service Offering with name %s, but got %d.", csMachine.Spec.Offering, count))
82+
}
83+
84+
if retErr != nil {
85+
if _, count, err := c.cs.ServiceOffering.GetServiceOfferingByID(csMachine.Spec.Offering); err != nil {
86+
return "", multierror.Append(retErr, errors.Wrapf(
87+
err, "Could not get Service Offering by ID %s.", csMachine.Spec.Offering))
88+
} else if count != 1 {
89+
return "", multierror.Append(retErr, errors.Errorf(
90+
"Expected 1 Service Offering with UUID %s, but got %d.", csMachine.Spec.Offering, count))
91+
} else {
92+
offeringID = csMachine.Spec.Offering
93+
}
94+
}
95+
96+
return offeringID, nil
97+
}
98+
99+
func (c *client) ResolveTemplate(csCluster *infrav1.CloudStackCluster, csMachine *infrav1.CloudStackMachine) (templateID string, retErr error) {
100+
templateID, count, err := c.cs.Template.GetTemplateID(csMachine.Spec.Template, "all", csCluster.Status.ZoneID)
101+
if err != nil {
102+
retErr = multierror.Append(retErr, errors.Wrapf(
103+
err, "Could not get Template ID from %s.", csMachine.Spec.Template))
104+
} else if count != 1 {
105+
retErr = multierror.Append(retErr, errors.Errorf(
106+
"Expected 1 Template with name %s, but got %d.", csMachine.Spec.Template, count))
107+
}
108+
109+
if retErr != nil {
110+
if _, count, err := c.cs.Template.GetTemplateByID(csMachine.Spec.Template, "all"); err != nil {
111+
return "", multierror.Append(retErr, errors.Wrapf(
112+
err, "Could not get Template by ID %s.", csMachine.Spec.Template))
113+
} else if count != 1 {
114+
return "", multierror.Append(retErr, errors.Errorf(
115+
"Expected 1 Template with UUID %s, but got %d.", csMachine.Spec.Template, count))
116+
} else {
117+
templateID = csMachine.Spec.Template
118+
}
119+
}
120+
121+
return templateID, nil
122+
}
123+
73124
// CreateVMInstance will fetch or create a VM instance, and
74125
// sets the infrastructure machine spec and status accordingly.
75126
func (c *client) GetOrCreateVMInstance(
@@ -83,22 +134,14 @@ func (c *client) GetOrCreateVMInstance(
83134
!strings.Contains(strings.ToLower(err.Error()), "no match") {
84135
return err
85136
}
86-
// Get machine offering ID from name.
87-
offeringID, count, err := c.cs.ServiceOffering.GetServiceOfferingID(csMachine.Spec.Offering)
137+
offeringID, err := c.ResolveServiceOffering(csMachine)
88138
if err != nil {
89139
return err
90-
} else if count != 1 {
91-
return fmt.Errorf(
92-
"Did not find exactly one machine offering with the name %s", csMachine.Spec.Offering)
93140
}
94141

95-
// Get template ID from name.
96-
templateID, count, err := c.cs.Template.GetTemplateID(csMachine.Spec.Template, "all", csCluster.Status.ZoneID)
142+
templateID, err := c.ResolveTemplate(csCluster, csMachine)
97143
if err != nil {
98144
return err
99-
} else if count != 1 {
100-
return fmt.Errorf(
101-
"Did not find exactly one template with the name %s", csMachine.Spec.Template)
102145
}
103146

104147
// Create VM instance.

pkg/cloud/instance_test.go

Lines changed: 73 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -133,19 +133,20 @@ var _ = Describe("Instance", func() {
133133
Ω(client.GetOrCreateVMInstance(csMachine, machine, csCluster, "")).Should(MatchError("unknown err"))
134134
})
135135

136-
It("handles errors occuring while fetching sevice offering information", func() {
136+
It("returns errors occuring while fetching sevice offering information", func() {
137137
vms.EXPECT().GetVirtualMachinesMetricByID(*csMachine.Spec.InstanceID).Return(nil, -1, notFoundError)
138138
vms.EXPECT().GetVirtualMachinesMetricByName(csMachine.Name).Return(nil, -1, notFoundError)
139139
sos.EXPECT().GetServiceOfferingID(csMachine.Spec.Offering).Return("", -1, unknownError)
140-
Ω(client.GetOrCreateVMInstance(csMachine, machine, csCluster, "")).Should(MatchError("unknown err"))
140+
sos.EXPECT().GetServiceOfferingByID(csMachine.Spec.Offering).Return(nil, -1, unknownError)
141+
Ω(client.GetOrCreateVMInstance(csMachine, machine, csCluster, "")).ShouldNot(Succeed())
141142
})
142143

143-
It("returns an appropriate error if more than one sevice offering found", func() {
144+
It("returns errors if more than one sevice offering found", func() {
144145
vms.EXPECT().GetVirtualMachinesMetricByID(*csMachine.Spec.InstanceID).Return(nil, -1, notFoundError)
145146
vms.EXPECT().GetVirtualMachinesMetricByName(csMachine.Name).Return(nil, -1, notFoundError)
146147
sos.EXPECT().GetServiceOfferingID(csMachine.Spec.Offering).Return("", 2, nil)
147-
Ω(client.GetOrCreateVMInstance(csMachine, machine, csCluster, "")).Should(
148-
MatchError("Did not find exactly one machine offering with the name service-offering-name"))
148+
sos.EXPECT().GetServiceOfferingByID(csMachine.Spec.Offering).Return(nil, -1, unknownError)
149+
Ω(client.GetOrCreateVMInstance(csMachine, machine, csCluster, "")).ShouldNot(Succeed())
149150
})
150151

151152
It("returns errors encountered while fetching template", func() {
@@ -154,18 +155,17 @@ var _ = Describe("Instance", func() {
154155
sos.EXPECT().GetServiceOfferingID(csMachine.Spec.Offering).Return(serviceOfferingID, 1, nil)
155156
ts.EXPECT().GetTemplateID(csMachine.Spec.Template, "all", csCluster.Status.ZoneID).
156157
Return("", -1, unknownError)
157-
158-
Ω(client.GetOrCreateVMInstance(csMachine, machine, csCluster, "")).Should(MatchError("unknown err"))
158+
ts.EXPECT().GetTemplateByID(csMachine.Spec.Template, "all").Return(nil, -1, unknownError)
159+
Ω(client.GetOrCreateVMInstance(csMachine, machine, csCluster, "")).ShouldNot(Succeed())
159160
})
160161

161-
It("returns an appropriate error when more than one template found", func() {
162+
It("returns errors when more than one template found", func() {
162163
vms.EXPECT().GetVirtualMachinesMetricByID(*csMachine.Spec.InstanceID).Return(nil, -1, notFoundError)
163164
vms.EXPECT().GetVirtualMachinesMetricByName(csMachine.Name).Return(nil, -1, notFoundError)
164165
sos.EXPECT().GetServiceOfferingID(csMachine.Spec.Offering).Return(serviceOfferingID, 1, nil)
165166
ts.EXPECT().GetTemplateID(csMachine.Spec.Template, "all", csCluster.Status.ZoneID).Return("", 2, nil)
166-
167-
Ω(client.GetOrCreateVMInstance(csMachine, machine, csCluster, "")).
168-
Should(MatchError("Did not find exactly one template with the name template-name"))
167+
ts.EXPECT().GetTemplateByID(csMachine.Spec.Template, "all").Return(nil, -1, unknownError)
168+
Ω(client.GetOrCreateVMInstance(csMachine, machine, csCluster, "")).ShouldNot(Succeed())
169169
})
170170

171171
It("handles deployment errors", func() {
@@ -181,27 +181,68 @@ var _ = Describe("Instance", func() {
181181
Ω(client.GetOrCreateVMInstance(csMachine, machine, csCluster, "")).Should(MatchError("unknown err"))
182182
})
183183

184-
It("calls CloudStack to deploy a VM Instance and succeeds", func() {
185-
gomock.InOrder(
186-
vms.EXPECT().GetVirtualMachinesMetricByID(*csMachine.Spec.InstanceID).
187-
Return(nil, -1, notFoundError),
188-
vms.EXPECT().GetVirtualMachinesMetricByID(*csMachine.Spec.InstanceID).
189-
Return(&cloudstack.VirtualMachinesMetric{}, 1, nil))
190-
191-
vms.EXPECT().GetVirtualMachinesMetricByName(csMachine.Name).Return(nil, -1, notFoundError)
192-
193-
sos.EXPECT().GetServiceOfferingID(csMachine.Spec.Offering).Return(serviceOfferingID, 1, nil)
194-
ts.EXPECT().GetTemplateID(csMachine.Spec.Template, "all", csCluster.Status.ZoneID).
195-
Return(templateID, 1, nil)
196-
197-
vms.EXPECT().NewDeployVirtualMachineParams(serviceOfferingID, templateID, csCluster.Status.ZoneID).
198-
Return(&cloudstack.DeployVirtualMachineParams{})
199-
200-
deploymentResp := &cloudstack.DeployVirtualMachineResponse{Id: *csMachine.Spec.InstanceID}
201-
vms.EXPECT().DeployVirtualMachine(gomock.Any()).Return(deploymentResp, nil)
202-
203-
Ω(client.GetOrCreateVMInstance(csMachine, machine, csCluster, "")).Should(Succeed())
204-
Ω(csMachine.Status.Ready).Should(BeFalse())
184+
Context("when using UUIDs and/or names to locate service offerings and templates", func() {
185+
BeforeEach(func() {
186+
gomock.InOrder(
187+
vms.EXPECT().GetVirtualMachinesMetricByID(*csMachine.Spec.InstanceID).
188+
Return(nil, -1, notFoundError),
189+
vms.EXPECT().GetVirtualMachinesMetricByID(*csMachine.Spec.InstanceID).
190+
Return(&cloudstack.VirtualMachinesMetric{}, 1, nil))
191+
192+
vms.EXPECT().GetVirtualMachinesMetricByName(csMachine.Name).Return(nil, -1, notFoundError)
193+
})
194+
195+
ActionAndAssert := func() {
196+
vms.EXPECT().NewDeployVirtualMachineParams(serviceOfferingID, templateID, csCluster.Status.ZoneID).
197+
Return(&cloudstack.DeployVirtualMachineParams{})
198+
199+
deploymentResp := &cloudstack.DeployVirtualMachineResponse{Id: *csMachine.Spec.InstanceID}
200+
vms.EXPECT().DeployVirtualMachine(gomock.Any()).Return(deploymentResp, nil)
201+
202+
Ω(client.GetOrCreateVMInstance(csMachine, machine, csCluster, "")).Should(Succeed())
203+
}
204+
205+
It("works with service offering name and template name", func() {
206+
sos.EXPECT().GetServiceOfferingID(csMachine.Spec.Offering).Return(serviceOfferingID, 1, nil)
207+
ts.EXPECT().GetTemplateID(csMachine.Spec.Template, "all", csCluster.Status.ZoneID).
208+
Return(templateID, 1, nil)
209+
210+
ActionAndAssert()
211+
})
212+
213+
It("works with service offering ID and template name", func() {
214+
csMachine.Spec.Offering = serviceOfferingID
215+
sos.EXPECT().GetServiceOfferingID(csMachine.Spec.Offering).Return("", -1, notFoundError)
216+
sos.EXPECT().GetServiceOfferingByID(csMachine.Spec.Offering).Return(&cloudstack.ServiceOffering{}, 1, nil)
217+
ts.EXPECT().GetTemplateID(csMachine.Spec.Template, "all", csCluster.Status.ZoneID).
218+
Return(templateID, 1, nil)
219+
220+
ActionAndAssert()
221+
})
222+
223+
It("works with service offering name and template ID", func() {
224+
csMachine.Spec.Template = templateID
225+
sos.EXPECT().GetServiceOfferingID(csMachine.Spec.Offering).Return(serviceOfferingID, 1, nil)
226+
ts.EXPECT().GetTemplateID(csMachine.Spec.Template, "all", csCluster.Status.ZoneID).
227+
Return("", -1, notFoundError)
228+
ts.EXPECT().GetTemplateByID(csMachine.Spec.Template, "all").
229+
Return(&cloudstack.Template{}, 1, nil)
230+
231+
ActionAndAssert()
232+
})
233+
234+
It("works with service offering ID and template ID", func() {
235+
csMachine.Spec.Offering = serviceOfferingID
236+
csMachine.Spec.Template = templateID
237+
sos.EXPECT().GetServiceOfferingID(csMachine.Spec.Offering).Return("", -1, notFoundError)
238+
sos.EXPECT().GetServiceOfferingByID(csMachine.Spec.Offering).Return(&cloudstack.ServiceOffering{}, 1, nil)
239+
ts.EXPECT().GetTemplateID(csMachine.Spec.Template, "all", csCluster.Status.ZoneID).
240+
Return("", -1, notFoundError)
241+
ts.EXPECT().GetTemplateByID(csMachine.Spec.Template, "all").
242+
Return(&cloudstack.Template{}, 1, nil)
243+
244+
ActionAndAssert()
245+
})
205246
})
206247
})
207248
})

pkg/cloud/network.go

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222

2323
"github.com/apache/cloudstack-go/v2/cloudstack"
2424
infrav1 "github.com/aws/cluster-api-provider-cloudstack-staging/api/v1alpha3"
25+
multierror "github.com/hashicorp/go-multierror"
2526
"github.com/pkg/errors"
2627
)
2728

@@ -33,16 +34,26 @@ const (
3334
)
3435

3536
func (c *client) ResolveNetwork(csCluster *infrav1.CloudStackCluster) (retErr error) {
36-
if csCluster.Status.NetworkID, _, retErr = c.cs.Network.GetNetworkID(csCluster.Spec.Network); retErr != nil {
37-
return retErr
37+
networkID, count, err := c.cs.Network.GetNetworkID(csCluster.Spec.Network)
38+
if err != nil {
39+
retErr = multierror.Append(retErr, errors.Wrapf(
40+
err, "Could not get Network ID from %s.", csCluster.Spec.Network))
41+
networkID = csCluster.Spec.Network
42+
} else if count != 1 {
43+
retErr = multierror.Append(retErr, errors.Errorf(
44+
"Expected 1 Network with name %s, but got %d.", csCluster.Spec.Network, count))
3845
}
3946

40-
var networkDetails *cloudstack.Network
41-
if networkDetails, _, retErr = c.cs.Network.GetNetworkByID(csCluster.Status.NetworkID); retErr != nil {
42-
return retErr
47+
if networkDetails, count, err := c.cs.Network.GetNetworkByID(networkID); err != nil {
48+
return multierror.Append(retErr, errors.Wrapf(
49+
err, "Could not get Network by ID %s.", networkID))
50+
} else if count != 1 {
51+
return multierror.Append(retErr, errors.Errorf(
52+
"Expected 1 Network with UUID %s, but got %d.", networkID, count))
53+
} else {
54+
csCluster.Status.NetworkID = networkID
55+
csCluster.Status.NetworkType = networkDetails.Type
4356
}
44-
45-
csCluster.Status.NetworkType = networkDetails.Type
4657
return nil
4758
}
4859

0 commit comments

Comments
 (0)