crdmanagement

package
v2.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoDifference     = DiffResult("NoDifference")
	SpecDifferent    = DiffResult("SpecDifferent")
	VersionDifferent = DiffResult("VersionDifferent")
)
View Source
const (
	MatchedExistingCRD = FilterResult("MatchedExistingCRD")
	MatchedPattern     = FilterResult("MatchedPattern")
	Excluded           = FilterResult("Excluded")
)
View Source
const (
	ServiceOperatorVersionLabelOld = "serviceoperator.azure.com/version"
	ServiceOperatorVersionLabel    = "app.kubernetes.io/version"
	ServiceOperatorAppLabel        = "app.kubernetes.io/name"
	ServiceOperatorAppValue        = "azure-service-operator"
)

ServiceOperatorVersionLabelOld is the label the CRDs have on them containing the ASO version. This value must match the value injected by config/crd/labels.yaml

View Source
const CRDLocation = "crds"

Variables

This section is empty.

Functions

func FilterKnownTypesByReadyCRDs

func FilterKnownTypesByReadyCRDs(
	logger logr.Logger,
	scheme *runtime.Scheme,
	skip map[string]apiextensions.CustomResourceDefinition,
	knownTypes []client.Object,
) ([]client.Object, error)

func FilterStorageTypesByReadyCRDs

func FilterStorageTypesByReadyCRDs(
	logger logr.Logger,
	scheme *runtime.Scheme,
	skip map[string]apiextensions.CustomResourceDefinition,
	storageTypes []*registration.StorageType,
) ([]*registration.StorageType, error)

Types

type CRDInstallationInstruction added in v2.1.0

type CRDInstallationInstruction struct {
	CRD apiextensions.CustomResourceDefinition

	// FilterResult contains the result of if the CRD was considered for installation or not
	FilterResult FilterResult
	// FilterReason contains a user-facing reason for why the CRD was or was not considered for installation
	FilterReason string

	// DiffResult contains the result of the diff between the existing CRD (if any) and the goal CRD. This may
	// be NoDifference if the CRD was filtered from consideration before the diff phase.
	DiffResult DiffResult
}

func IncludedCRDs added in v2.1.0

func IncludedCRDs(instructions []*CRDInstallationInstruction) []*CRDInstallationInstruction

func (*CRDInstallationInstruction) ShouldApply added in v2.1.0

func (i *CRDInstallationInstruction) ShouldApply() (bool, string)

type DiffResult added in v2.1.0

type DiffResult string

func (DiffResult) DiffReason added in v2.1.0

type FilterResult added in v2.1.0

type FilterResult string

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(logger logr.Logger, kubeClient kubeclient.Client) *Manager

func (*Manager) ApplyCRDs

func (m *Manager) ApplyCRDs(
	ctx context.Context,
	instructions []*CRDInstallationInstruction,
) error

func (*Manager) DetermineCRDsToInstallOrUpgrade added in v2.1.0

func (m *Manager) DetermineCRDsToInstallOrUpgrade(
	goalCRDs []apiextensions.CustomResourceDefinition,
	existingCRDs []apiextensions.CustomResourceDefinition,
	patterns string,
) ([]*CRDInstallationInstruction, error)

DetermineCRDsToInstallOrUpgrade examines the set of goal CRDs and installed CRDs to determine the set which should be installed or upgraded.

func (*Manager) FindMatchingCRDs

FindMatchingCRDs finds the CRDs in "goal" that are in "existing" AND compare as equal according to the comparators with the corresponding CRD in "goal"

func (*Manager) FindNonMatchingCRDs

FindNonMatchingCRDs finds the CRDs in "goal" that are not in "existing" OR are in "existing" but mismatch with the "goal" based on the comparator functions.

func (*Manager) ListOperatorCRDs

func (m *Manager) ListOperatorCRDs(ctx context.Context) ([]apiextensions.CustomResourceDefinition, error)

func (*Manager) LoadOperatorCRDs

func (m *Manager) LoadOperatorCRDs(path string, podNamespace string) ([]apiextensions.CustomResourceDefinition, error)

Jump to

Keyboard shortcuts

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