@@ -60,44 +60,31 @@ var _ = Describe("kubebuilder", func() {
60
60
kbc , err = utils .NewTestContext (util .KubebuilderBinName , "GO111MODULE=on" )
61
61
Expect (err ).NotTo (HaveOccurred ())
62
62
Expect (kbc .Prepare ()).To (Succeed ())
63
-
64
- By ("installing the cert-manager bundle" )
65
- Expect (kbc .InstallCertManager ()).To (Succeed ())
66
-
67
- By ("installing the Prometheus operator" )
68
- Expect (kbc .InstallPrometheusOperManager ()).To (Succeed ())
69
63
})
70
64
71
65
AfterEach (func () {
72
66
By ("clean up API objects created during the test" )
73
67
kbc .CleanupManifests (filepath .Join ("config" , "default" ))
74
68
75
- By ("uninstalling the Prometheus manager bundle" )
76
- kbc .UninstallPrometheusOperManager ()
77
-
78
- By ("uninstalling the cert-manager bundle" )
79
- kbc .UninstallCertManager ()
80
-
81
69
By ("removing controller image and working dir" )
82
70
kbc .Destroy ()
83
71
})
84
- It ("should generate a runnable project" +
85
- " with restricted pods" , func () {
86
- kbc .IsRestricted = true
72
+ It ("should generate a runnable project" , func () {
73
+ kbc .IsRestricted = false
87
74
GenerateV4 (kbc )
88
75
Run (kbc , true , false )
89
76
})
90
- It ("should generate a runnable project without webhooks" +
91
- " with restricted pods" , func () {
77
+ It ("should generate a runnable project with the Installer" , func () {
78
+ kbc .IsRestricted = false
79
+ GenerateV4 (kbc )
80
+ Run (kbc , false , true )
81
+ })
82
+ It ("should generate a runnable project with the manager running " +
83
+ "as restricted and without webhooks" , func () {
92
84
kbc .IsRestricted = true
93
85
GenerateV4WithoutWebhooks (kbc )
94
86
Run (kbc , false , false )
95
87
})
96
- It ("should generate a runnable project" +
97
- " with the Installer" , func () {
98
- GenerateV4 (kbc )
99
- Run (kbc , false , true )
100
- })
101
88
})
102
89
})
103
90
@@ -162,7 +149,7 @@ func Run(kbc *utils.TestContext, hasWebhook, isToUseInstaller bool) {
162
149
ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
163
150
}
164
151
165
- if kbc .IsRestricted && ! isToUseInstaller {
152
+ if kbc .IsRestricted {
166
153
By ("validating that manager Pod/container(s) are restricted" )
167
154
ExpectWithOffset (1 , output ).NotTo (ContainSubstring ("Warning: would violate PodSecurity" ))
168
155
}
0 commit comments