fix

package
v1.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CRDPluralizationFix

type CRDPluralizationFix struct{}

This fix cleans up the singular version of two pluralized CRDs. * An upgrade [1] to the controller-runtime dependency also upgraded the code generators that generate our * CustomResourceDefinition manifests from the apis package. This upgrade fixed a pluralization library used * in the generators, which in turn 'fixed' the `plural` names of the CRDs `ClusterObjectSlices` and * `ObjectSlices` and appended a missing 's' to both names. * - `objectslice` -> `objectslices` * - `clusterobjectslice` -> `clusterobjectslices` * * Upgrading from an existing PKO installation with the old (singular) CRDs in place to a new version with * the new (pluralized) CRDs results in a broken state because the old singular CRDs must be removed from the * apiserver for the new pluralized CRDs to become ready. PKO can't handle this situation when it tries to * upgrade itself and the ClusterObjectSet for PKO's new version will never be able to adopt all PKO resources, * thus stalling the upgrade, leaving the old PKO version running indefinitely. * Luckily the old singular CRDs can just be deleted because PKO is not using this api yet. * * Rough overview of the steps this fix takes to rectify the upgrade: * - Needs package-operator-manager to be stopped (which the take-over bootstrap procedure already handles). * - Remove all ClusterObjectSets under the package-operator ClusterPackage with propagation policy set to * `Orphan`, thus leaving all children objects intact. This is really important to avoid the loss of every * installed package in the cluster. * - Remove the singular CRDs. * - Continue with the bootstrap process which will recreate a ClusterObjectSet, adopt all PKO resources * and spin up a fresh PKO deployment which then takes over.

* [1] https://github.com/package-operator/package-operator/commit/928fbace122d35d4d5002d740d7d6ca14248f315

func (CRDPluralizationFix) Check

func (f CRDPluralizationFix) Check(ctx context.Context, fc Context) (bool, error)

func (CRDPluralizationFix) Run

type Context

type Context struct {
	Client       client.Client
	Log          logr.Logger
	PKONamespace string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL