Open
Description
What do you want to happen?
For example, Defaulter webhook was already setup here
And manager started here
But example tells user to manually call Defaulter webhook
It could be simplified to
It("Should apply defaults when a required field is empty", func() {
By("creating a object where defaults should be applied")
obj.SomeFieldWithDefault = ""
Expect(k8sClient.Create(ctx, obj)).NotTo(HaveOccurred())
By("checking that the default values are set")
Expect(obj.SomeFieldWithDefault).To(Equal("default_value"))
})
Note: scaffold
internal/controller/suite_test.go
do not start a manager. Instead of changing users examples, another approach would be removing manager start up in webhooksuite_test.go
, which would be my suggestion.
Extra Labels
/kind cleanup