(env *environment.TestingEnvironment, mutating, validating string)
| 139 | }) |
| 140 | |
| 141 | func AssertWebhookEnabled(env *environment.TestingEnvironment, mutating, validating string) { |
| 142 | By("re-setting namespace selector for all admission controllers", func() { |
| 143 | // Setting the namespace selector in MutatingWebhook and ValidatingWebhook |
| 144 | // to nil will go back to the default behaviour |
| 145 | mWhc, position, err := operator.GetMutatingWebhookByName(env.Ctx, env.Client, mutating) |
| 146 | Expect(err).ToNot(HaveOccurred()) |
| 147 | mWhc.Webhooks[position].NamespaceSelector = nil |
| 148 | err = operator.UpdateMutatingWebhookConf(env.Ctx, env.Interface, mWhc) |
| 149 | Expect(err).ToNot(HaveOccurred()) |
| 150 | |
| 151 | vWhc, position, err := operator.GetValidatingWebhookByName(env.Ctx, env.Client, validating) |
| 152 | Expect(err).ToNot(HaveOccurred()) |
| 153 | vWhc.Webhooks[position].NamespaceSelector = nil |
| 154 | err = operator.UpdateValidatingWebhookConf(env.Ctx, env.Interface, vWhc) |
| 155 | Expect(err).ToNot(HaveOccurred()) |
| 156 | }) |
| 157 | } |
no test coverage detected