Skip to content

Commit

Permalink
Rename new option to SkipPrimaryGVKSchemeRegistration
Browse files Browse the repository at this point in the history
  • Loading branch information
mtesseract committed Feb 16, 2022
1 parent ca6b7d6 commit 9608c54
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions pkg/reconciler/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ type Reconciler struct {
maxConcurrentReconciles int
reconcilePeriod time.Duration
maxHistory int
skipGenericGVKSchemeRegistration bool
skipPrimaryGVKSchemeRegistration bool

annotSetupOnce sync.Once
annotations map[string]struct{}
Expand Down Expand Up @@ -132,7 +132,7 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error {
controllerName := fmt.Sprintf("%v-controller", strings.ToLower(r.gvk.Kind))

r.addDefaults(mgr, controllerName)
if !r.skipGenericGVKSchemeRegistration {
if !r.skipPrimaryGVKSchemeRegistration {
r.setupScheme(mgr)
}

Expand Down Expand Up @@ -260,7 +260,7 @@ func SkipDependentWatches(skip bool) Option {
}
}

// SkipGenericGVKSchemeRegistration is an Option that allows to disable the default behaviour of
// SkipPrimaryGVKSchemeRegistration is an Option that allows to disable the default behaviour of
// registering unstructured.Unstructured as underlying type for the GVK scheme.
//
// Disabling this built-in registration is necessary when building operators
Expand Down Expand Up @@ -290,7 +290,7 @@ func SkipDependentWatches(skip bool) Option {
// // Create reconciler with generic scheme registration being disabled.
// r, err := reconciler.New(
// reconciler.WithChart(chart),
// reconciler.SkipGenericGVKSchemeRegistration(true),
// reconciler.SkipPrimaryGVKSchemeRegistration(true),
// // [...]
// )
//
Expand All @@ -299,9 +299,9 @@ func SkipDependentWatches(skip bool) Option {
//
// By default, skipping of the generic scheme setup is disabled, which means that
// unstructured.Unstructured is used for the GVK scheme.
func SkipGenericGVKSchemeRegistration(skip bool) Option {
func SkipPrimaryGVKSchemeRegistration(skip bool) Option {
return func(r *Reconciler) error {
r.skipGenericGVKSchemeRegistration = skip
r.skipPrimaryGVKSchemeRegistration = skip
return nil
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ var _ = Describe("Reconciler", func() {
WithOverrideValues(map[string]string{
"image.repository": "custom-nginx",
}),
SkipGenericGVKSchemeRegistration(true),
SkipPrimaryGVKSchemeRegistration(true),
)
} else {
// Default behaviour using generic GVK scheme based on unstructured.Unstructured
Expand Down

0 comments on commit 9608c54

Please sign in to comment.