-
Notifications
You must be signed in to change notification settings - Fork 66
Closed
Labels
good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.kind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.Categorizes issue or PR as related to cleaning up code, process, or technical debt.
Description
We already have multiple places where we setup scheme:
operator-controller/cmd/manager/main.go
Lines 49 to 53 in fa84c73
utilruntime.Must(clientgoscheme.AddToScheme(scheme)) utilruntime.Must(operatorsv1alpha1.AddToScheme(scheme)) utilruntime.Must(rukpakv1alpha1.AddToScheme(scheme)) utilruntime.Must(catalogd.AddToScheme(scheme)) operator-controller/cmd/resolutioncli/main.go
Lines 62 to 65 in fa84c73
utilruntime.Must(clientgoscheme.AddToScheme(scheme)) utilruntime.Must(operatorsv1alpha1.AddToScheme(scheme)) utilruntime.Must(rukpakv1alpha1.AddToScheme(scheme)) utilruntime.Must(catalogd.AddToScheme(scheme)) operator-controller/internal/controllers/suite_test.go
Lines 70 to 74 in fa84c73
sch = runtime.NewScheme() err = operatorsv1alpha1.AddToScheme(sch) Expect(err).NotTo(HaveOccurred()) err = rukpakv1alpha1.AddToScheme(sch) Expect(err).NotTo(HaveOccurred()) - Various tests
And more will be introduced (e.g #286 adds a new one, see test/operator-framework-e2e/operator_framework_test.go
).
To avoid having this repeated setup and inconsistent schemas we should consider creating a scheme package in the project which will be setting up a scheme. In rest of the places we will just be able to import already constructed scheme.
Example:
Metadata
Metadata
Assignees
Labels
good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.kind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.Categorizes issue or PR as related to cleaning up code, process, or technical debt.