@@ -44,21 +44,23 @@ diff --color -r operator-v1/README.md operator-v2/README.md
4444---
4545> # operator-v2
4646diff --color -r operator-v1/api/v1/foo_types.go operator-v2/api/v1/foo_types.go
47- 32a33,35
47+ 33a34,36
4848>
49- > // Foo's favorite colour
50- > Colour string `json:"colour,omitempty"`
51- Only in operator-v2: color
49+ > // Foo's favorite colour
50+ > Colour string `json:"colour,omitempty"`
51+ Binary files operator-v1/bin/kustomize and operator-v2/bin/kustomize differ
52+ Binary files operator-v1/bin/setup-envtest and operator-v2/bin/setup-envtest differ
5253diff --color -r operator-v1/config/crd/bases/tutorial.my.domain_foos.yaml operator-v2/config/crd/bases/tutorial.my.domain_foos.yaml
53- 46a47,49
54+ 45a46,48
5455> colour:
5556> description: Foo's favorite colour
5657> type: string
57- diff --color -r operator-v1/controllers/foo_controller.go operator-v2/controllers/foo_controller.go
58- 32a33
59- > color "my.domain/tutorial/color"
60- 77a79
61- > foo.Status.Colour = color.ConvertStrToColor(foo.Name + foo.Namespace)
58+ Only in operator-v2/internal: color
59+ diff --color -r operator-v1/internal/controller/foo_controller.go operator-v2/internal/controller/foo_controller.go
60+ 31a32
61+ > "my.domain/tutorial/internal/color"
62+ 75a77
63+ > foo.Status.Colour = color.ConvertStrToColor(foo.Name + foo.Namespace)
6264```
6365
6466### ` v2 ` <> ` v2-with-tests `
@@ -70,46 +72,52 @@ diff --color -r operator-v2/README.md operator-v2-with-tests/README.md
7072< # operator-v2
7173---
7274> # operator-v2-with-tests
73- Only in operator-v2-with-tests/color: color_test.go
74- Only in operator-v2-with-tests/controllers: foo_controller_test.go
75- diff --color -r operator-v2/controllers/suite_test.go operator-v2-with-tests/controllers/suite_test.go
75+ Only in operator-v2-with-tests/bin: manager
76+ diff --color -r operator-v2/go.mod operator-v2-with-tests/go.mod
77+ 7a8
78+ > k8s.io/api v0.28.0
79+ 64d64
80+ < k8s.io/api v0.28.0 // indirect
81+ Only in operator-v2-with-tests/internal/color: color_test.go
82+ Only in operator-v2-with-tests/internal/controller: foo_controller_test.go
83+ diff --color -r operator-v2/internal/controller/suite_test.go operator-v2-with-tests/internal/controller/suite_test.go
768419a20
77- > "context"
78- 22a24,25
79- > ctrl "sigs.k8s.io/controller-runtime"
85+ > "context"
86+ 24a26,27
87+ > ctrl "sigs.k8s.io/controller-runtime"
8088>
81- 40,42c43,49
89+ 42,44c45,51
8290< var cfg *rest.Config
8391< var k8sClient client.Client
8492< var testEnv *envtest.Environment
8593---
8694> var (
87- > cfg *rest.Config
88- > k8sClient client.Client
89- > testEnv *envtest.Environment
90- > ctx context.Context
91- > cancel context.CancelFunc
95+ > cfg *rest.Config
96+ > k8sClient client.Client
97+ > testEnv *envtest.Environment
98+ > ctx context.Context
99+ > cancel context.CancelFunc
92100> )
9310153a61
94- > ctx, cancel = context.WithCancel(context.TODO())
95- 75a84,100
96- > // Register and start the Foo controller
97- > k8sManager, err := ctrl.NewManager(cfg, ctrl.Options{
98- > Scheme: scheme.Scheme,
99- > })
100- > Expect(err).ToNot(HaveOccurred())
102+ > ctx, cancel = context.WithCancel(context.TODO())
103+ 83a92,108
104+ > // Register and start the Foo controller
105+ > k8sManager, err := ctrl.NewManager(cfg, ctrl.Options{
106+ > Scheme: scheme.Scheme,
107+ > })
108+ > Expect(err).ToNot(HaveOccurred())
101109>
102- > err = (&FooReconciler{
103- > Client: k8sManager.GetClient(),
104- > Scheme: k8sManager.GetScheme(),
105- > }).SetupWithManager(k8sManager)
106- > Expect(err).ToNot(HaveOccurred())
110+ > err = (&FooReconciler{
111+ > Client: k8sManager.GetClient(),
112+ > Scheme: k8sManager.GetScheme(),
113+ > }).SetupWithManager(k8sManager)
114+ > Expect(err).ToNot(HaveOccurred())
107115>
108- > go func() {
109- > defer GinkgoRecover()
110- > err = k8sManager.Start(ctx)
111- > Expect(err).ToNot(HaveOccurred(), "failed to run manager")
112- > }()
113- 78a104
114- > cancel()
116+ > go func() {
117+ > defer GinkgoRecover()
118+ > err = k8sManager.Start(ctx)
119+ > Expect(err).ToNot(HaveOccurred(), "failed to run manager")
120+ > }()
121+ 86a112
122+ > cancel()
115123```
0 commit comments