@@ -22,89 +22,89 @@ import (
2222 infrav1 "sigs.k8s.io/cluster-api-provider-cloudstack/api/v1beta3"
2323 dummies "sigs.k8s.io/cluster-api-provider-cloudstack/test/dummies/v1beta3"
2424
25- . "github.com/onsi/ginkgo/v2"
26- . "github.com/onsi/gomega"
25+ "github.com/onsi/ginkgo/v2"
26+ gomega "github.com/onsi/gomega"
2727)
2828
29- var _ = Describe ("CloudStackMachine webhook" , func () {
29+ var _ = ginkgo . Describe ("CloudStackMachine webhook" , func () {
3030 var ctx context.Context
3131 forbiddenRegex := "admission webhook.*denied the request.*Forbidden\\ : %s"
3232 requiredRegex := "admission webhook.*denied the request.*Required value\\ : %s"
3333
34- BeforeEach (func () { // Reset test vars to initial state.
34+ ginkgo . BeforeEach (func () { // Reset test vars to initial state.
3535 dummies .SetDummyVars ()
3636 ctx = context .Background ()
3737 _ = k8sClient .Delete (ctx , dummies .CSMachine1 ) // Clear out any remaining machines. Ignore errors.
3838 })
3939
40- Context ("When creating a CloudStackMachine" , func () {
41- It ("should accept CloudStackMachine with all attributes" , func () {
42- Expect (k8sClient .Create (ctx , dummies .CSMachine1 )).Should (Succeed ())
40+ ginkgo . Context ("When creating a CloudStackMachine" , func () {
41+ ginkgo . It ("should accept CloudStackMachine with all attributes" , func () {
42+ gomega . Expect (k8sClient .Create (ctx , dummies .CSMachine1 )).Should (gomega . Succeed ())
4343 })
4444
45- It ("should accept a CloudStackMachine with disk Offering attribute" , func () {
45+ ginkgo . It ("should accept a CloudStackMachine with disk Offering attribute" , func () {
4646 dummies .CSMachine1 .Spec .DiskOffering = dummies .DiskOffering
47- Expect (k8sClient .Create (ctx , dummies .CSMachine1 )).Should (Succeed ())
47+ gomega . Expect (k8sClient .Create (ctx , dummies .CSMachine1 )).Should (gomega . Succeed ())
4848 })
4949
50- It ("should accept a CloudStackMachine with positive disk Offering size attribute" , func () {
50+ ginkgo . It ("should accept a CloudStackMachine with positive disk Offering size attribute" , func () {
5151 dummies .CSMachine1 .Spec .DiskOffering = dummies .DiskOffering
5252 dummies .CSMachine1 .Spec .DiskOffering .CustomSize = 1
53- Expect (k8sClient .Create (ctx , dummies .CSMachine1 )).Should (Succeed ())
53+ gomega . Expect (k8sClient .Create (ctx , dummies .CSMachine1 )).Should (gomega . Succeed ())
5454 })
5555
56- It ("should not accept a CloudStackMachine with negative disk Offering size attribute" , func () {
56+ ginkgo . It ("should not accept a CloudStackMachine with negative disk Offering size attribute" , func () {
5757 dummies .CSMachine1 .Spec .DiskOffering = dummies .DiskOffering
5858 dummies .CSMachine1 .Spec .DiskOffering .CustomSize = - 1
59- Expect (k8sClient .Create (ctx , dummies .CSMachine1 )).Should (MatchError (MatchRegexp (forbiddenRegex , "customSizeInGB" )))
59+ gomega . Expect (k8sClient .Create (ctx , dummies .CSMachine1 )).Should (gomega . MatchError (gomega . MatchRegexp (forbiddenRegex , "customSizeInGB" )))
6060 })
6161
62- It ("should reject a CloudStackMachine with missing Offering attribute" , func () {
62+ ginkgo . It ("should reject a CloudStackMachine with missing Offering attribute" , func () {
6363 dummies .CSMachine1 .Spec .Offering = infrav1.CloudStackResourceIdentifier {ID : "" , Name : "" }
64- Expect (k8sClient .Create (ctx , dummies .CSMachine1 )).
65- Should (MatchError (MatchRegexp (requiredRegex , "Offering" )))
64+ gomega . Expect (k8sClient .Create (ctx , dummies .CSMachine1 )).
65+ Should (gomega . MatchError (gomega . MatchRegexp (requiredRegex , "Offering" )))
6666 })
6767
68- It ("should reject a CloudStackMachine with missing Template attribute" , func () {
68+ ginkgo . It ("should reject a CloudStackMachine with missing Template attribute" , func () {
6969 dummies .CSMachine1 .Spec .Template = infrav1.CloudStackResourceIdentifier {ID : "" , Name : "" }
70- Expect (k8sClient .Create (ctx , dummies .CSMachine1 )).
71- Should (MatchError (MatchRegexp (requiredRegex , "Template" )))
70+ gomega . Expect (k8sClient .Create (ctx , dummies .CSMachine1 )).
71+ Should (gomega . MatchError (gomega . MatchRegexp (requiredRegex , "Template" )))
7272 })
7373 })
7474
75- Context ("When updating a CloudStackMachine" , func () {
76- BeforeEach (func () {
77- Ω (k8sClient .Create (ctx , dummies .CSMachine1 )).Should (Succeed ())
75+ ginkgo . Context ("When updating a CloudStackMachine" , func () {
76+ ginkgo . BeforeEach (func () {
77+ gomega . Ω (k8sClient .Create (ctx , dummies .CSMachine1 )).Should (gomega . Succeed ())
7878 })
7979
80- It ("should reject VM offering updates to the CloudStackMachine" , func () {
80+ ginkgo . It ("should reject VM offering updates to the CloudStackMachine" , func () {
8181 dummies .CSMachine1 .Spec .Offering = infrav1.CloudStackResourceIdentifier {Name : "ArbitraryUpdateOffering" }
82- Ω (k8sClient .Update (ctx , dummies .CSMachine1 )).
83- Should (MatchError (MatchRegexp (forbiddenRegex , "offering" )))
82+ gomega . Ω (k8sClient .Update (ctx , dummies .CSMachine1 )).
83+ Should (gomega . MatchError (gomega . MatchRegexp (forbiddenRegex , "offering" )))
8484 })
8585
86- It ("should reject VM template updates to the CloudStackMachine" , func () {
86+ ginkgo . It ("should reject VM template updates to the CloudStackMachine" , func () {
8787 dummies .CSMachine1 .Spec .Template = infrav1.CloudStackResourceIdentifier {Name : "ArbitraryUpdateTemplate" }
88- Ω (k8sClient .Update (ctx , dummies .CSMachine1 )).
89- Should (MatchError (MatchRegexp (forbiddenRegex , "template" )))
88+ gomega . Ω (k8sClient .Update (ctx , dummies .CSMachine1 )).
89+ Should (gomega . MatchError (gomega . MatchRegexp (forbiddenRegex , "template" )))
9090 })
9191
92- It ("should reject VM disk offering updates to the CloudStackMachine" , func () {
92+ ginkgo . It ("should reject VM disk offering updates to the CloudStackMachine" , func () {
9393 dummies .CSMachine1 .Spec .DiskOffering .Name = "medium"
94- Ω (k8sClient .Update (ctx , dummies .CSMachine1 )).
95- Should (MatchError (MatchRegexp (forbiddenRegex , "diskOffering" )))
94+ gomega . Ω (k8sClient .Update (ctx , dummies .CSMachine1 )).
95+ Should (gomega . MatchError (gomega . MatchRegexp (forbiddenRegex , "diskOffering" )))
9696 })
9797
98- It ("should reject updates to VM details of the CloudStackMachine" , func () {
98+ ginkgo . It ("should reject updates to VM details of the CloudStackMachine" , func () {
9999 dummies .CSMachine1 .Spec .Details = map [string ]string {"memoryOvercommitRatio" : "1.5" }
100- Ω (k8sClient .Update (ctx , dummies .CSMachine1 )).
101- Should (MatchError (MatchRegexp (forbiddenRegex , "details" )))
100+ gomega . Ω (k8sClient .Update (ctx , dummies .CSMachine1 )).
101+ Should (gomega . MatchError (gomega . MatchRegexp (forbiddenRegex , "details" )))
102102 })
103103
104- It ("should reject updates to the list of affinty groups of the CloudStackMachine" , func () {
104+ ginkgo . It ("should reject updates to the list of affinty groups of the CloudStackMachine" , func () {
105105 dummies .CSMachine1 .Spec .AffinityGroupIDs = []string {"28b907b8-75a7-4214-bd3d-6c61961fc2af" }
106- Ω (k8sClient .Update (ctx , dummies .CSMachine1 )).
107- Should (MatchError (MatchRegexp (forbiddenRegex , "AffinityGroupIDs" )))
106+ gomega . Ω (k8sClient .Update (ctx , dummies .CSMachine1 )).
107+ Should (gomega . MatchError (gomega . MatchRegexp (forbiddenRegex , "AffinityGroupIDs" )))
108108 })
109109 })
110110})
0 commit comments