Documentation ¶
Index ¶
- Constants
- Variables
- func APIKeyToGVKHash(key opregistry.APIKey) (string, error)
- func APIKeyToGVKString(key opregistry.APIKey) string
- func LabelSetsFor(obj interface{}) ([]labels.Set, error)
- func NewServiceAccountStepResources(csv *v1alpha1.ClusterServiceVersion, ...) ([]v1alpha1.StepResource, error)
- func NewStepResourceFromBundle(bundle *registry.Bundle, ...) ([]v1alpha1.StepResource, error)
- func NewStepResourceFromObject(obj runtime.Object, catalogSourceName, catalogSourceNamespace string) (v1alpha1.StepResource, error)
- func NewSubscriptionStepResource(namespace string, info OperatorSourceInfo) (v1alpha1.StepResource, error)
- func RBACForClusterServiceVersion(csv *v1alpha1.ClusterServiceVersion) (map[string]*OperatorPermissions, error)
- type APIIntersectionReconcileFunc
- type APIIntersectionReconciler
- type APIMultiOwnerSet
- type APIOwnerSet
- type APIReconciliationResult
- type APISet
- func (s APISet) Difference(set APISet) APISet
- func (s APISet) Intersection(sets ...APISet) APISet
- func (s APISet) IsSubset(set APISet) bool
- func (s APISet) PopAPIKey() *opregistry.APIKey
- func (s APISet) String() string
- func (s APISet) StripPlural() APISet
- func (s APISet) Union(sets ...APISet) APISet
- type CatalogKey
- type Evolver
- type Generation
- type NamespaceGeneration
- func (g *NamespaceGeneration) AddOperator(o OperatorSurface) error
- func (g *NamespaceGeneration) MarkAPIChecked(key registry.APIKey)
- func (g *NamespaceGeneration) MissingAPIs() APIMultiOwnerSet
- func (g *NamespaceGeneration) Operators() OperatorSet
- func (g *NamespaceGeneration) RemoveOperator(o OperatorSurface)
- func (g *NamespaceGeneration) ResetUnchecked()
- func (g *NamespaceGeneration) UncheckedAPIs() APISet
- type NamespaceGenerationEvolver
- type NamespaceSet
- type NamespaceSourceQuerier
- func (q *NamespaceSourceQuerier) FindBundle(pkgName, channelName, bundleName string, initialSource CatalogKey) (*opregistry.Bundle, *CatalogKey, error)
- func (q *NamespaceSourceQuerier) FindLatestBundle(pkgName, channelName string, initialSource CatalogKey) (*opregistry.Bundle, *CatalogKey, error)
- func (q *NamespaceSourceQuerier) FindProvider(api opregistry.APIKey) (*opregistry.Bundle, *CatalogKey, error)
- func (q *NamespaceSourceQuerier) FindReplacement(currentVersion *semver.Version, bundleName, pkgName, channelName string, ...) (*opregistry.Bundle, *CatalogKey, error)
- func (q *NamespaceSourceQuerier) Queryable() error
- type Operator
- func (o *Operator) Bundle() *opregistry.Bundle
- func (o *Operator) Identifier() string
- func (o *Operator) Package() string
- func (o *Operator) ProvidedAPIs() APISet
- func (o *Operator) Replaces() string
- func (o *Operator) RequiredAPIs() APISet
- func (o *Operator) SourceInfo() *OperatorSourceInfo
- func (o *Operator) Version() *semver.Version
- type OperatorGroup
- type OperatorGroupSurface
- type OperatorPermissions
- func (o *OperatorPermissions) AddClusterRole(clusterRole *rbacv1.ClusterRole)
- func (o *OperatorPermissions) AddClusterRoleBinding(clusterRoleBinding *rbacv1.ClusterRoleBinding)
- func (o *OperatorPermissions) AddRole(role *rbacv1.Role)
- func (o *OperatorPermissions) AddRoleBinding(roleBinding *rbacv1.RoleBinding)
- type OperatorSet
- type OperatorSourceInfo
- type OperatorSurface
- type OperatorsV1alpha1Resolver
- type Resolver
- type SourceQuerier
- type SourceRef
Constants ¶
const (
// APILabelKeyPrefix is the key prefix for a CSV's APIs label
APILabelKeyPrefix = "olm.api."
)
const SkipPackageAnnotationKey = "olm.skipRange"
Variables ¶
var ExistingOperator = OperatorSourceInfo{"", "", "", CatalogKey{"", ""}}
Functions ¶
func APIKeyToGVKHash ¶
func APIKeyToGVKHash(key opregistry.APIKey) (string, error)
func APIKeyToGVKString ¶
func APIKeyToGVKString(key opregistry.APIKey) string
func LabelSetsFor ¶
LabelSetsFor returns API label sets for the given object. Concrete types other than OperatorSurface and CustomResource definition no-op.
func NewServiceAccountStepResources ¶
func NewServiceAccountStepResources(csv *v1alpha1.ClusterServiceVersion, catalogSourceName, catalogSourceNamespace string) ([]v1alpha1.StepResource, error)
NewServiceAccountStepResources returns a list of step resources required to satisfy the RBAC requirements of the given CSV's InstallStrategy
func NewStepResourceFromObject ¶
func NewStepResourceFromObject(obj runtime.Object, catalogSourceName, catalogSourceNamespace string) (v1alpha1.StepResource, error)
NewStepResourceForObject returns a new StepResource for the provided object
func NewSubscriptionStepResource ¶
func NewSubscriptionStepResource(namespace string, info OperatorSourceInfo) (v1alpha1.StepResource, error)
func RBACForClusterServiceVersion ¶
func RBACForClusterServiceVersion(csv *v1alpha1.ClusterServiceVersion) (map[string]*OperatorPermissions, error)
Types ¶
type APIIntersectionReconcileFunc ¶
type APIIntersectionReconcileFunc func(add APISet, group OperatorGroupSurface, otherGroups ...OperatorGroupSurface) APIReconciliationResult
func (APIIntersectionReconcileFunc) Reconcile ¶
func (a APIIntersectionReconcileFunc) Reconcile(add APISet, group OperatorGroupSurface, otherGroups ...OperatorGroupSurface) APIReconciliationResult
type APIIntersectionReconciler ¶
type APIIntersectionReconciler interface {
Reconcile(add APISet, group OperatorGroupSurface, otherGroups ...OperatorGroupSurface) APIReconciliationResult
}
type APIMultiOwnerSet ¶
type APIMultiOwnerSet map[opregistry.APIKey]OperatorSet
func EmptyAPIMultiOwnerSet ¶
func EmptyAPIMultiOwnerSet() APIMultiOwnerSet
func (APIMultiOwnerSet) PopAPIKey ¶
func (s APIMultiOwnerSet) PopAPIKey() *opregistry.APIKey
func (APIMultiOwnerSet) PopAPIRequirers ¶
func (s APIMultiOwnerSet) PopAPIRequirers() OperatorSet
type APIOwnerSet ¶
type APIOwnerSet map[opregistry.APIKey]OperatorSurface
func EmptyAPIOwnerSet ¶
func EmptyAPIOwnerSet() APIOwnerSet
type APIReconciliationResult ¶
type APIReconciliationResult int
const ( RemoveAPIs APIReconciliationResult = iota AddAPIs APIConflict NoAPIConflict )
func ReconcileAPIIntersection ¶
func ReconcileAPIIntersection(add APISet, group OperatorGroupSurface, otherGroups ...OperatorGroupSurface) APIReconciliationResult
type APISet ¶
type APISet map[opregistry.APIKey]struct{}
func EmptyAPISet ¶
func EmptyAPISet() APISet
func (APISet) Difference ¶
func (APISet) Intersection ¶
Intersection returns the intersection of the APISet and the given list of APISets
func (APISet) PopAPIKey ¶
func (s APISet) PopAPIKey() *opregistry.APIKey
func (APISet) StripPlural ¶
StripPlural returns the APISet with the Plural field of all APIKeys removed
type CatalogKey ¶
func (*CatalogKey) String ¶
func (k *CatalogKey) String() string
type Evolver ¶
type Evolver interface {
Evolve(add map[OperatorSourceInfo]struct{}) error
}
Evolvers modify a generation to a new state
func NewNamespaceGenerationEvolver ¶
func NewNamespaceGenerationEvolver(querier SourceQuerier, gen Generation) Evolver
type Generation ¶
type Generation interface { AddOperator(o OperatorSurface) error RemoveOperator(o OperatorSurface) ResetUnchecked() MissingAPIs() APIMultiOwnerSet Operators() OperatorSet MarkAPIChecked(key registry.APIKey) UncheckedAPIs() APISet }
Generation represents a set of operators and their required/provided API surfaces at a point in time.
type NamespaceGeneration ¶
type NamespaceGeneration struct {
// contains filtered or unexported fields
}
NamespaceGeneration represents a generation of operators in a single namespace with methods for managing api checks
func NewEmptyGeneration ¶
func NewEmptyGeneration() *NamespaceGeneration
func NewGenerationFromCluster ¶
func NewGenerationFromCluster(csvs []*v1alpha1.ClusterServiceVersion, subs []*v1alpha1.Subscription) (*NamespaceGeneration, error)
func (*NamespaceGeneration) AddOperator ¶
func (g *NamespaceGeneration) AddOperator(o OperatorSurface) error
func (*NamespaceGeneration) MarkAPIChecked ¶
func (g *NamespaceGeneration) MarkAPIChecked(key registry.APIKey)
func (*NamespaceGeneration) MissingAPIs ¶
func (g *NamespaceGeneration) MissingAPIs() APIMultiOwnerSet
func (*NamespaceGeneration) Operators ¶
func (g *NamespaceGeneration) Operators() OperatorSet
func (*NamespaceGeneration) RemoveOperator ¶
func (g *NamespaceGeneration) RemoveOperator(o OperatorSurface)
func (*NamespaceGeneration) ResetUnchecked ¶
func (g *NamespaceGeneration) ResetUnchecked()
func (*NamespaceGeneration) UncheckedAPIs ¶
func (g *NamespaceGeneration) UncheckedAPIs() APISet
type NamespaceGenerationEvolver ¶
type NamespaceGenerationEvolver struct {
// contains filtered or unexported fields
}
func (*NamespaceGenerationEvolver) Evolve ¶
func (e *NamespaceGenerationEvolver) Evolve(add map[OperatorSourceInfo]struct{}) error
Evolve takes new requested operators, adds them to the generation, and attempts to resolve dependencies with querier
type NamespaceSet ¶
type NamespaceSet map[string]struct{}
func NewNamespaceSet ¶
func NewNamespaceSet(namespaces []string) NamespaceSet
func NewNamespaceSetFromString ¶
func NewNamespaceSetFromString(namespaces string) NamespaceSet
NewNamespaceSetFromString creates a namespace set from a comma-delimited list of namespaces
func (NamespaceSet) Contains ¶
func (n NamespaceSet) Contains(namespace string) bool
func (NamespaceSet) Intersection ¶
func (n NamespaceSet) Intersection(set NamespaceSet) NamespaceSet
func (NamespaceSet) IsAllNamespaces ¶
func (n NamespaceSet) IsAllNamespaces() bool
func (NamespaceSet) Peek ¶
func (n NamespaceSet) Peek() string
func (NamespaceSet) Union ¶
func (n NamespaceSet) Union(set NamespaceSet) NamespaceSet
type NamespaceSourceQuerier ¶
type NamespaceSourceQuerier struct {
// contains filtered or unexported fields
}
func NewNamespaceSourceQuerier ¶
func NewNamespaceSourceQuerier(sources map[CatalogKey]client.Interface) *NamespaceSourceQuerier
func (*NamespaceSourceQuerier) FindBundle ¶
func (q *NamespaceSourceQuerier) FindBundle(pkgName, channelName, bundleName string, initialSource CatalogKey) (*opregistry.Bundle, *CatalogKey, error)
func (*NamespaceSourceQuerier) FindLatestBundle ¶
func (q *NamespaceSourceQuerier) FindLatestBundle(pkgName, channelName string, initialSource CatalogKey) (*opregistry.Bundle, *CatalogKey, error)
func (*NamespaceSourceQuerier) FindProvider ¶
func (q *NamespaceSourceQuerier) FindProvider(api opregistry.APIKey) (*opregistry.Bundle, *CatalogKey, error)
func (*NamespaceSourceQuerier) FindReplacement ¶
func (q *NamespaceSourceQuerier) FindReplacement(currentVersion *semver.Version, bundleName, pkgName, channelName string, initialSource CatalogKey) (*opregistry.Bundle, *CatalogKey, error)
func (*NamespaceSourceQuerier) Queryable ¶
func (q *NamespaceSourceQuerier) Queryable() error
type Operator ¶
type Operator struct {
// contains filtered or unexported fields
}
func NewOperatorFromBundle ¶
func NewOperatorFromBundle(bundle *opregistry.Bundle, replaces string, startingCSV string, sourceKey CatalogKey) (*Operator, error)
func NewOperatorFromV1Alpha1CSV ¶
func NewOperatorFromV1Alpha1CSV(csv *v1alpha1.ClusterServiceVersion) (*Operator, error)
func (*Operator) Bundle ¶
func (o *Operator) Bundle() *opregistry.Bundle
func (*Operator) Identifier ¶
func (*Operator) ProvidedAPIs ¶
func (*Operator) RequiredAPIs ¶
func (*Operator) SourceInfo ¶
func (o *Operator) SourceInfo() *OperatorSourceInfo
type OperatorGroup ¶
type OperatorGroup struct {
// contains filtered or unexported fields
}
func NewOperatorGroup ¶
func NewOperatorGroup(group *v1.OperatorGroup) *OperatorGroup
func (*OperatorGroup) GroupIntersection ¶
func (g *OperatorGroup) GroupIntersection(groups ...OperatorGroupSurface) []OperatorGroupSurface
func (*OperatorGroup) Identifier ¶
func (g *OperatorGroup) Identifier() string
func (*OperatorGroup) Namespace ¶
func (g *OperatorGroup) Namespace() string
func (*OperatorGroup) ProvidedAPIs ¶
func (g *OperatorGroup) ProvidedAPIs() APISet
func (*OperatorGroup) Targets ¶
func (g *OperatorGroup) Targets() NamespaceSet
type OperatorGroupSurface ¶
type OperatorGroupSurface interface { Identifier() string Namespace() string Targets() NamespaceSet ProvidedAPIs() APISet GroupIntersection(groups ...OperatorGroupSurface) []OperatorGroupSurface }
func NewOperatorGroupSurfaces ¶
func NewOperatorGroupSurfaces(groups ...v1.OperatorGroup) []OperatorGroupSurface
type OperatorPermissions ¶
type OperatorPermissions struct { ServiceAccount *corev1.ServiceAccount Roles []*rbacv1.Role RoleBindings []*rbacv1.RoleBinding ClusterRoles []*rbacv1.ClusterRole ClusterRoleBindings []*rbacv1.ClusterRoleBinding }
func NewOperatorPermissions ¶
func NewOperatorPermissions(serviceAccount *corev1.ServiceAccount) *OperatorPermissions
func (*OperatorPermissions) AddClusterRole ¶
func (o *OperatorPermissions) AddClusterRole(clusterRole *rbacv1.ClusterRole)
func (*OperatorPermissions) AddClusterRoleBinding ¶
func (o *OperatorPermissions) AddClusterRoleBinding(clusterRoleBinding *rbacv1.ClusterRoleBinding)
func (*OperatorPermissions) AddRole ¶
func (o *OperatorPermissions) AddRole(role *rbacv1.Role)
func (*OperatorPermissions) AddRoleBinding ¶
func (o *OperatorPermissions) AddRoleBinding(roleBinding *rbacv1.RoleBinding)
type OperatorSet ¶
type OperatorSet map[string]OperatorSurface
func EmptyOperatorSet ¶
func EmptyOperatorSet() OperatorSet
func (OperatorSet) Snapshot ¶
func (o OperatorSet) Snapshot() OperatorSet
Snapshot returns a new set, pointing to the same values
type OperatorSourceInfo ¶
type OperatorSourceInfo struct { Package string Channel string StartingCSV string Catalog CatalogKey }
func (*OperatorSourceInfo) String ¶
func (i *OperatorSourceInfo) String() string
type OperatorSurface ¶
type OperatorSurface interface { ProvidedAPIs() APISet RequiredAPIs() APISet Identifier() string Replaces() string Version() *semver.Version SourceInfo() *OperatorSourceInfo Bundle() *opregistry.Bundle }
OperatorSurface describes the API surfaces provided and required by an Operator.
type OperatorsV1alpha1Resolver ¶
type OperatorsV1alpha1Resolver struct {
// contains filtered or unexported fields
}
func NewOperatorsV1alpha1Resolver ¶
func NewOperatorsV1alpha1Resolver(lister operatorlister.OperatorLister) *OperatorsV1alpha1Resolver
func (*OperatorsV1alpha1Resolver) ResolveSteps ¶
func (r *OperatorsV1alpha1Resolver) ResolveSteps(namespace string, sourceQuerier SourceQuerier) ([]*v1alpha1.Step, []*v1alpha1.Subscription, error)
type Resolver ¶
type Resolver interface {
ResolveSteps(namespace string, sourceQuerier SourceQuerier) ([]*v1alpha1.Step, []*v1alpha1.Subscription, error)
}
type SourceQuerier ¶
type SourceQuerier interface { FindProvider(api opregistry.APIKey) (*opregistry.Bundle, *CatalogKey, error) FindBundle(pkgName, channelName, bundleName string, initialSource CatalogKey) (*opregistry.Bundle, *CatalogKey, error) FindLatestBundle(pkgName, channelName string, initialSource CatalogKey) (*opregistry.Bundle, *CatalogKey, error) FindReplacement(currentVersion *semver.Version, bundleName, pkgName, channelName string, initialSource CatalogKey) (*opregistry.Bundle, *CatalogKey, error) Queryable() error }