Skip to content

Commit 50950e4

Browse files
committed
deepcopy_integration_test: Add a (failing) check that generators don't interfere with eachother [ci-skip]
1 parent 0afacab commit 50950e4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/deepcopy/deepcopy_integration_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
. "github.com/onsi/ginkgo"
2727
. "github.com/onsi/gomega"
2828

29+
"sigs.k8s.io/controller-tools/pkg/crd"
2930
"sigs.k8s.io/controller-tools/pkg/deepcopy"
3031
"sigs.k8s.io/controller-tools/pkg/genall"
3132
"sigs.k8s.io/controller-tools/pkg/loader"
@@ -76,8 +77,12 @@ var _ = Describe("CRD Generation From Parsing to CustomResourceDefinition", func
7677

7778
By("initializing the runtime")
7879
optionsRegistry := &markers.Registry{}
80+
Expect(optionsRegistry.Register(markers.Must(markers.MakeDefinition("crd", markers.DescribesPackage, crd.Generator{})))).To(Succeed())
7981
Expect(optionsRegistry.Register(markers.Must(markers.MakeDefinition("object", markers.DescribesPackage, deepcopy.Generator{})))).To(Succeed())
80-
rt, err := genall.FromOptions(optionsRegistry, []string{"object"})
82+
rt, err := genall.FromOptions(optionsRegistry, []string{
83+
"crd", // Run another generator first to make sure they don't interfere; see also: the comment on cronjob_types.go:UntypedBlob
84+
"object",
85+
})
8186
Expect(err).NotTo(HaveOccurred())
8287
rt.OutputRules = genall.OutputRules{Default: output}
8388

0 commit comments

Comments
 (0)