Documentation ¶
Index ¶
- Constants
- func FilterKnownTypesByReadyCRDs(logger logr.Logger, scheme *runtime.Scheme, ...) ([]client.Object, error)
- func FilterStorageTypesByReadyCRDs(logger logr.Logger, scheme *runtime.Scheme, ...) ([]*registration.StorageType, error)
- func MakeCRDMap(crds []apiextensions.CustomResourceDefinition) map[string]apiextensions.CustomResourceDefinition
- func SpecEqual(a apiextensions.CustomResourceDefinition, ...) bool
- func SpecEqualIgnoreConversionWebhook(a apiextensions.CustomResourceDefinition, ...) bool
- func VersionEqual(a apiextensions.CustomResourceDefinition, ...) bool
- type CRDInstallationInstruction
- type DiffResult
- type FilterResult
- type LeaderElector
- type Manager
- func (m *Manager) DetermineCRDsToInstallOrUpgrade(goalCRDs []apiextensions.CustomResourceDefinition, ...) ([]*CRDInstallationInstruction, error)
- func (m *Manager) FindMatchingCRDs(existing []apiextensions.CustomResourceDefinition, ...) map[string]apiextensions.CustomResourceDefinition
- func (m *Manager) FindNonMatchingCRDs(existing []apiextensions.CustomResourceDefinition, ...) map[string]apiextensions.CustomResourceDefinition
- func (m *Manager) Install(ctx context.Context, options Options) error
- func (m *Manager) ListCRDs(ctx context.Context) ([]apiextensions.CustomResourceDefinition, error)
- func (m *Manager) LoadOperatorCRDs(path string, podNamespace string) ([]apiextensions.CustomResourceDefinition, error)
- type Options
Constants ¶
const ( NoDifference = DiffResult("NoDifference") SpecDifferent = DiffResult("SpecDifferent") VersionDifferent = DiffResult("VersionDifferent") )
const ( MatchedExistingCRD = FilterResult("MatchedExistingCRD") MatchedPattern = FilterResult("MatchedPattern") Excluded = FilterResult("Excluded") )
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
const CRDLocation = "crds"
Variables ¶
This section is empty.
Functions ¶
func FilterStorageTypesByReadyCRDs ¶
func FilterStorageTypesByReadyCRDs( logger logr.Logger, scheme *runtime.Scheme, include map[string]apiextensions.CustomResourceDefinition, storageTypes []*registration.StorageType, ) ([]*registration.StorageType, error)
func MakeCRDMap ¶
func MakeCRDMap( crds []apiextensions.CustomResourceDefinition, ) map[string]apiextensions.CustomResourceDefinition
func SpecEqual ¶
func SpecEqual(a apiextensions.CustomResourceDefinition, b apiextensions.CustomResourceDefinition) bool
func SpecEqualIgnoreConversionWebhook ¶
func SpecEqualIgnoreConversionWebhook(a apiextensions.CustomResourceDefinition, b apiextensions.CustomResourceDefinition) bool
func VersionEqual ¶
func VersionEqual(a apiextensions.CustomResourceDefinition, b apiextensions.CustomResourceDefinition) bool
Types ¶
type CRDInstallationInstruction ¶
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 ¶
func IncludedCRDs(instructions []*CRDInstallationInstruction) []*CRDInstallationInstruction
func (*CRDInstallationInstruction) ShouldApply ¶
func (i *CRDInstallationInstruction) ShouldApply() (bool, string)
type DiffResult ¶
type DiffResult string
func (DiffResult) DiffReason ¶
func (i DiffResult) DiffReason(crd apiextensions.CustomResourceDefinition) string
type FilterResult ¶
type FilterResult string
type LeaderElector ¶
type LeaderElector struct { Elector *leaderelection.LeaderElector LeaseAcquired *sync.WaitGroup LeaseReleased *sync.WaitGroup }
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(logger logr.Logger, kubeClient kubeclient.Client, leaderElection *LeaderElector) *Manager
NewManager creates a new CRD manager. The leaderElection argument is optional, but strongly recommended.
func (*Manager) DetermineCRDsToInstallOrUpgrade ¶
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 ¶
func (m *Manager) FindMatchingCRDs( existing []apiextensions.CustomResourceDefinition, goal []apiextensions.CustomResourceDefinition, comparators ...func(a apiextensions.CustomResourceDefinition, b apiextensions.CustomResourceDefinition) bool, ) map[string]apiextensions.CustomResourceDefinition
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 ¶
func (m *Manager) FindNonMatchingCRDs( existing []apiextensions.CustomResourceDefinition, goal []apiextensions.CustomResourceDefinition, comparators ...func(a apiextensions.CustomResourceDefinition, b apiextensions.CustomResourceDefinition) bool, ) map[string]apiextensions.CustomResourceDefinition
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) ListCRDs ¶
func (m *Manager) ListCRDs(ctx context.Context) ([]apiextensions.CustomResourceDefinition, error)
func (*Manager) LoadOperatorCRDs ¶
func (m *Manager) LoadOperatorCRDs(path string, podNamespace string) ([]apiextensions.CustomResourceDefinition, error)
type Options ¶
type Options struct { Path string Namespace string CRDPatterns string ExistingCRDs []apiextensions.CustomResourceDefinition }