Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a package for scheme setup #322

Closed
m1kola opened this issue Aug 7, 2023 · 2 comments
Closed

Create a package for scheme setup #322

m1kola opened this issue Aug 7, 2023 · 2 comments
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.

Comments

@m1kola
Copy link
Member

m1kola commented Aug 7, 2023

We already have multiple places where we setup scheme:

  • utilruntime.Must(clientgoscheme.AddToScheme(scheme))
    utilruntime.Must(operatorsv1alpha1.AddToScheme(scheme))
    utilruntime.Must(rukpakv1alpha1.AddToScheme(scheme))
    utilruntime.Must(catalogd.AddToScheme(scheme))
  • utilruntime.Must(clientgoscheme.AddToScheme(scheme))
    utilruntime.Must(operatorsv1alpha1.AddToScheme(scheme))
    utilruntime.Must(rukpakv1alpha1.AddToScheme(scheme))
    utilruntime.Must(catalogd.AddToScheme(scheme))
  • 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:

@m1kola m1kola added good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Aug 7, 2023
@acmenezes
Copy link
Contributor

/assign

@grokspawn
Copy link
Contributor

solved by #770

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.
Projects
None yet
Development

No branches or pull requests

3 participants