@@ -19,66 +19,66 @@ package v1beta3_test
19
19
import (
20
20
"context"
21
21
22
- . "github.com/onsi/ginkgo/v2"
23
- . "github.com/onsi/gomega"
22
+ "github.com/onsi/ginkgo/v2"
23
+ "github.com/onsi/gomega"
24
24
infrav1 "sigs.k8s.io/cluster-api-provider-cloudstack/api/v1beta3"
25
25
dummies "sigs.k8s.io/cluster-api-provider-cloudstack/test/dummies/v1beta3"
26
26
)
27
27
28
- var _ = Describe ("CloudStackCluster webhooks" , func () {
28
+ var _ = ginkgo . Describe ("CloudStackCluster webhooks" , func () {
29
29
var ctx context.Context
30
30
forbiddenRegex := "admission webhook.*denied the request.*Forbidden\\ : %s"
31
31
requiredRegex := "admission webhook.*denied the request.*Required value\\ : %s"
32
32
33
- BeforeEach (func () { // Reset test vars to initial state.
33
+ ginkgo . BeforeEach (func () { // Reset test vars to initial state.
34
34
ctx = context .Background ()
35
35
dummies .SetDummyVars () // Reset cluster var.
36
36
_ = k8sClient .Delete (ctx , dummies .CSCluster ) // Delete any remnants.
37
37
dummies .SetDummyVars () // Reset again since the k8s client can set this on delete.
38
38
})
39
39
40
- Context ("When creating a CloudStackCluster" , func () {
41
- It ("Should accept a CloudStackCluster with all attributes present" , func () {
42
- Ω (k8sClient .Create (ctx , dummies .CSCluster )).Should (Succeed ())
40
+ ginkgo . Context ("When creating a CloudStackCluster" , func () {
41
+ ginkgo . It ("Should accept a CloudStackCluster with all attributes present" , func () {
42
+ gomega . Expect (k8sClient .Create (ctx , dummies .CSCluster )).Should (gomega . Succeed ())
43
43
})
44
44
45
- It ("Should reject a CloudStackCluster with missing Zones.Network attribute" , func () {
45
+ ginkgo . It ("Should reject a CloudStackCluster with missing Zones.Network attribute" , func () {
46
46
dummies .CSCluster .Spec .FailureDomains = []infrav1.CloudStackFailureDomainSpec {{}}
47
47
dummies .CSCluster .Spec .FailureDomains [0 ].Zone .Name = "ZoneWNoNetwork"
48
- Ω (k8sClient .Create (ctx , dummies .CSCluster )).Should (
49
- MatchError (MatchRegexp (requiredRegex , "each Zone requires a Network specification" )))
48
+ gomega . Expect (k8sClient .Create (ctx , dummies .CSCluster )).Should (
49
+ gomega . MatchError (gomega . MatchRegexp (requiredRegex , "each Zone requires a Network specification" )))
50
50
})
51
51
52
- It ("Should reject a CloudStackCluster with missing Zone attribute" , func () {
52
+ ginkgo . It ("Should reject a CloudStackCluster with missing Zone attribute" , func () {
53
53
dummies .CSCluster .Spec .FailureDomains [0 ].Zone = infrav1.CloudStackZoneSpec {}
54
- Ω (k8sClient .Create (ctx , dummies .CSCluster )).Should (MatchError (MatchRegexp (requiredRegex ,
54
+ gomega . Expect (k8sClient .Create (ctx , dummies .CSCluster )).Should (gomega . MatchError (gomega . MatchRegexp (requiredRegex ,
55
55
"each Zone requires a Network specification" )))
56
56
})
57
57
})
58
58
59
- Context ("When updating a CloudStackCluster" , func () {
60
- BeforeEach (func () {
61
- Ω (k8sClient .Create (ctx , dummies .CSCluster )).Should (Succeed ())
59
+ ginkgo . Context ("When updating a CloudStackCluster" , func () {
60
+ ginkgo . BeforeEach (func () {
61
+ gomega . Expect (k8sClient .Create (ctx , dummies .CSCluster )).Should (gomega . Succeed ())
62
62
})
63
63
64
- It ("Should reject updates to CloudStackCluster FailureDomains" , func () {
64
+ ginkgo . It ("Should reject updates to CloudStackCluster FailureDomains" , func () {
65
65
dummies .CSCluster .Spec .FailureDomains [0 ].Zone .Name = "SomeRandomUpdate"
66
- Ω (k8sClient .Update (ctx , dummies .CSCluster )).Should (MatchError (MatchRegexp (forbiddenRegex , "Cannot change FailureDomain" )))
66
+ gomega . Expect (k8sClient .Update (ctx , dummies .CSCluster )).Should (gomega . MatchError (gomega . MatchRegexp (forbiddenRegex , "Cannot change FailureDomain" )))
67
67
})
68
- It ("Should reject updates to Networks specified in CloudStackCluster Zones" , func () {
68
+ ginkgo . It ("Should reject updates to Networks specified in CloudStackCluster Zones" , func () {
69
69
dummies .CSCluster .Spec .FailureDomains [0 ].Zone .Network .Name = "ArbitraryUpdateNetworkName"
70
- Ω (k8sClient .Update (ctx , dummies .CSCluster )).Should (MatchError (MatchRegexp (forbiddenRegex , "Cannot change FailureDomain" )))
70
+ gomega . Expect (k8sClient .Update (ctx , dummies .CSCluster )).Should (gomega . MatchError (gomega . MatchRegexp (forbiddenRegex , "Cannot change FailureDomain" )))
71
71
})
72
- It ("Should reject updates to CloudStackCluster controlplaneendpoint.host" , func () {
72
+ ginkgo . It ("Should reject updates to CloudStackCluster controlplaneendpoint.host" , func () {
73
73
dummies .CSCluster .Spec .ControlPlaneEndpoint .Host = "1.1.1.1"
74
- Ω (k8sClient .Update (ctx , dummies .CSCluster )).
75
- Should (MatchError (MatchRegexp (forbiddenRegex , "controlplaneendpoint\\ .host" )))
74
+ gomega . Expect (k8sClient .Update (ctx , dummies .CSCluster )).
75
+ Should (gomega . MatchError (gomega . MatchRegexp (forbiddenRegex , "controlplaneendpoint\\ .host" )))
76
76
})
77
77
78
- It ("Should reject updates to CloudStackCluster controlplaneendpoint.port" , func () {
78
+ ginkgo . It ("Should reject updates to CloudStackCluster controlplaneendpoint.port" , func () {
79
79
dummies .CSCluster .Spec .ControlPlaneEndpoint .Port = int32 (1234 )
80
- Ω (k8sClient .Update (ctx , dummies .CSCluster )).
81
- Should (MatchError (MatchRegexp (forbiddenRegex , "controlplaneendpoint\\ .port" )))
80
+ gomega . Expect (k8sClient .Update (ctx , dummies .CSCluster )).
81
+ Should (gomega . MatchError (gomega . MatchRegexp (forbiddenRegex , "controlplaneendpoint\\ .port" )))
82
82
})
83
83
})
84
84
})
0 commit comments