@@ -19,66 +19,66 @@ package v1beta3_test
1919import (
2020 "context"
2121
22- . "github.com/onsi/ginkgo/v2"
23- . "github.com/onsi/gomega"
22+ "github.com/onsi/ginkgo/v2"
23+ "github.com/onsi/gomega"
2424 infrav1 "sigs.k8s.io/cluster-api-provider-cloudstack/api/v1beta3"
2525 dummies "sigs.k8s.io/cluster-api-provider-cloudstack/test/dummies/v1beta3"
2626)
2727
28- var _ = Describe ("CloudStackCluster webhooks" , func () {
28+ var _ = ginkgo . Describe ("CloudStackCluster webhooks" , func () {
2929 var ctx context.Context
3030 forbiddenRegex := "admission webhook.*denied the request.*Forbidden\\ : %s"
3131 requiredRegex := "admission webhook.*denied the request.*Required value\\ : %s"
3232
33- BeforeEach (func () { // Reset test vars to initial state.
33+ ginkgo . BeforeEach (func () { // Reset test vars to initial state.
3434 ctx = context .Background ()
3535 dummies .SetDummyVars () // Reset cluster var.
3636 _ = k8sClient .Delete (ctx , dummies .CSCluster ) // Delete any remnants.
3737 dummies .SetDummyVars () // Reset again since the k8s client can set this on delete.
3838 })
3939
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 ())
4343 })
4444
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 () {
4646 dummies .CSCluster .Spec .FailureDomains = []infrav1.CloudStackFailureDomainSpec {{}}
4747 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" )))
5050 })
5151
52- It ("Should reject a CloudStackCluster with missing Zone attribute" , func () {
52+ ginkgo . It ("Should reject a CloudStackCluster with missing Zone attribute" , func () {
5353 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 ,
5555 "each Zone requires a Network specification" )))
5656 })
5757 })
5858
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 ())
6262 })
6363
64- It ("Should reject updates to CloudStackCluster FailureDomains" , func () {
64+ ginkgo . It ("Should reject updates to CloudStackCluster FailureDomains" , func () {
6565 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" )))
6767 })
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 () {
6969 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" )))
7171 })
72- It ("Should reject updates to CloudStackCluster controlplaneendpoint.host" , func () {
72+ ginkgo . It ("Should reject updates to CloudStackCluster controlplaneendpoint.host" , func () {
7373 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" )))
7676 })
7777
78- It ("Should reject updates to CloudStackCluster controlplaneendpoint.port" , func () {
78+ ginkgo . It ("Should reject updates to CloudStackCluster controlplaneendpoint.port" , func () {
7979 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" )))
8282 })
8383 })
8484})
0 commit comments