Documentation ¶
Index ¶
- Constants
- func EnsurePackageProperty(o *cache.Entry, name, version string)
- func IsFailForwardEnabled(ogLister v1listers.OperatorGroupNamespaceLister) (bool, error)
- func NewInvalidSubscriptionVariable(name string, reason string) solver.Variable
- func NewServiceAccountStepResources(csv *v1alpha1.ClusterServiceVersion, ...) ([]v1alpha1.StepResource, error)
- func NewSingleAPIProviderVariable(group, version, kind string, providers []solver.Identifier) solver.Variable
- func NewSinglePackageInstanceVariable(pkg string, providers []solver.Identifier) solver.Variable
- func NewStepResourceFromBundle(bundle *api.Bundle, ...) ([]v1alpha1.StepResource, error)
- func NewStepResourceFromObject(obj runtime.Object, catalogSourceName, catalogSourceNamespace string) (v1alpha1.StepResource, error)
- func NewStepsFromBundle(bundle *api.Bundle, ...) ([]*v1alpha1.Step, error)
- func NewSubscriptionStepResource(namespace string, info cache.OperatorSourceInfo) (v1alpha1.StepResource, error)
- func NewSubscriptionVariable(name string, dependencies []solver.Identifier) solver.Variable
- func PolicyRuleHashLabelValue(rules []rbacv1.PolicyRule) (string, error)
- func PrettyConstraint(c solver.Constraint, msg string) solver.Constraint
- func RBACForClusterServiceVersion(csv *v1alpha1.ClusterServiceVersion) (map[string]*OperatorPermissions, error)
- func ReplacementMapping(csvs []*operatorsv1alpha1.ClusterServiceVersion) map[string]*operatorsv1alpha1.ClusterServiceVersion
- func RoleReferenceAndSubjectHashLabelValue(roleRef rbacv1.RoleRef, subjects []rbacv1.Subject) (string, error)
- func V1alpha1CSVFromBundle(bundle *api.Bundle) (*v1alpha1.ClusterServiceVersion, error)
- func WalkReplacementChain(csv *operatorsv1alpha1.ClusterServiceVersion, ...) (*operatorsv1alpha1.ClusterServiceVersion, error)
- func WithCSVPhase(phase operatorsv1alpha1.ClusterServiceVersionPhase) walkOption
- func WithUniqueCSVs() walkOption
- type BundleVariable
- func (i *BundleVariable) AddConflict(id solver.Identifier)
- func (i *BundleVariable) AddConstraint(c solver.Constraint)
- func (i *BundleVariable) BundleSourceInfo() (string, string, cache.SourceKey, error)
- func (i BundleVariable) Constraints() []solver.Constraint
- func (i BundleVariable) Identifier() solver.Identifier
- func (i *BundleVariable) MakeProhibited()
- type GenericVariable
- type InstrumentedResolver
- 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 OperatorStepResolver
- type RegistryClientProvider
- type RegistrySourceProvider
- type Resolver
- type StepResolver
Constants ¶
const (
BundleLookupConditionPacked v1alpha1.BundleLookupConditionType = "BundleLookupNotPersisted"
)
const (
BundleSecretKind = "BundleSecret"
)
const ContentHashLabelKey = "olm.permissions.hash"
Variables ¶
This section is empty.
Functions ¶
func EnsurePackageProperty ¶ added in v0.19.0
func IsFailForwardEnabled ¶ added in v0.21.0
func IsFailForwardEnabled(ogLister v1listers.OperatorGroupNamespaceLister) (bool, error)
IsFailForwardEnabled takes a namespaced operatorGroup lister and returns True if an operatorGroup exists in the namespace and its upgradeStrategy is set to UnsafeFailForward and false otherwise. An error is returned if an more than one operatorGroup exists in the namespace. No error is returned if no OperatorGroups are found to keep the resolver backwards compatible.
func NewInvalidSubscriptionVariable ¶ added in v0.21.0
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 NewSingleAPIProviderVariable ¶ added in v0.21.0
func NewSingleAPIProviderVariable(group, version, kind string, providers []solver.Identifier) solver.Variable
func NewSinglePackageInstanceVariable ¶ added in v0.21.0
func NewSinglePackageInstanceVariable(pkg string, providers []solver.Identifier) solver.Variable
func NewStepResourceFromObject ¶
func NewStepResourceFromObject(obj runtime.Object, catalogSourceName, catalogSourceNamespace string) (v1alpha1.StepResource, error)
NewStepResourceForObject returns a new StepResource for the provided object
func NewStepsFromBundle ¶
func NewSubscriptionStepResource ¶
func NewSubscriptionStepResource(namespace string, info cache.OperatorSourceInfo) (v1alpha1.StepResource, error)
func NewSubscriptionVariable ¶ added in v0.21.0
func NewSubscriptionVariable(name string, dependencies []solver.Identifier) solver.Variable
func PolicyRuleHashLabelValue ¶ added in v0.26.0
func PolicyRuleHashLabelValue(rules []rbacv1.PolicyRule) (string, error)
func PrettyConstraint ¶ added in v0.18.0
func PrettyConstraint(c solver.Constraint, msg string) solver.Constraint
func RBACForClusterServiceVersion ¶
func RBACForClusterServiceVersion(csv *v1alpha1.ClusterServiceVersion) (map[string]*OperatorPermissions, error)
func ReplacementMapping ¶ added in v0.21.0
func ReplacementMapping(csvs []*operatorsv1alpha1.ClusterServiceVersion) map[string]*operatorsv1alpha1.ClusterServiceVersion
ReplacementMapping takes a list of CSVs and returns a map that maps a CSV's name to the CSV that replaces it.
func RoleReferenceAndSubjectHashLabelValue ¶ added in v0.26.0
func V1alpha1CSVFromBundle ¶
func V1alpha1CSVFromBundle(bundle *api.Bundle) (*v1alpha1.ClusterServiceVersion, error)
func WalkReplacementChain ¶ added in v0.21.0
func WalkReplacementChain(csv *operatorsv1alpha1.ClusterServiceVersion, csvToReplacement map[string]*operatorsv1alpha1.ClusterServiceVersion, options ...walkOption) (*operatorsv1alpha1.ClusterServiceVersion, error)
WalkReplacementChain walks along the chain of clusterServiceVersions being replaced and returns the last clusterServiceVersions in the replacement chain. An error is returned if any of the clusterServiceVersions before the last is not in the replaces phase or if an infinite replacement chain is detected.
func WithCSVPhase ¶ added in v0.21.0
func WithCSVPhase(phase operatorsv1alpha1.ClusterServiceVersionPhase) walkOption
WithCSVPhase returns an error if the CSV is not in the given phase.
func WithUniqueCSVs ¶ added in v0.21.0
func WithUniqueCSVs() walkOption
WithUniqueCSVs returns an error if the CSV has been seen before.
Types ¶
type BundleVariable ¶ added in v0.21.0
type BundleVariable struct { Replaces string // contains filtered or unexported fields }
func NewBundleVariableFromOperator ¶ added in v0.21.0
func NewBundleVariableFromOperator(o *cache.Entry) (BundleVariable, error)
func (*BundleVariable) AddConflict ¶ added in v0.21.0
func (i *BundleVariable) AddConflict(id solver.Identifier)
func (*BundleVariable) AddConstraint ¶ added in v0.21.0
func (i *BundleVariable) AddConstraint(c solver.Constraint)
func (*BundleVariable) BundleSourceInfo ¶ added in v0.21.0
func (BundleVariable) Constraints ¶ added in v0.21.0
func (i BundleVariable) Constraints() []solver.Constraint
func (BundleVariable) Identifier ¶ added in v0.21.0
func (i BundleVariable) Identifier() solver.Identifier
func (*BundleVariable) MakeProhibited ¶ added in v0.21.0
func (i *BundleVariable) MakeProhibited()
type GenericVariable ¶ added in v0.21.0
type GenericVariable struct {
// contains filtered or unexported fields
}
func (GenericVariable) Constraints ¶ added in v0.21.0
func (i GenericVariable) Constraints() []solver.Constraint
func (GenericVariable) Identifier ¶ added in v0.21.0
func (i GenericVariable) Identifier() solver.Identifier
type InstrumentedResolver ¶
type InstrumentedResolver struct {
// contains filtered or unexported fields
}
func NewInstrumentedResolver ¶
func NewInstrumentedResolver(resolver StepResolver, successMetricsEmitter, failureMetricsEmitter func(time.Duration)) *InstrumentedResolver
func (*InstrumentedResolver) ResolveSteps ¶
func (ir *InstrumentedResolver) ResolveSteps(namespace string) ([]*v1alpha1.Step, []v1alpha1.BundleLookup, []*v1alpha1.Subscription, error)
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 OperatorStepResolver ¶
type OperatorStepResolver struct {
// contains filtered or unexported fields
}
func NewOperatorStepResolver ¶
func NewOperatorStepResolver(lister operatorlister.OperatorLister, client versioned.Interface, globalCatalogNamespace string, sourceProvider cache.SourceProvider, log logrus.FieldLogger) *OperatorStepResolver
func (*OperatorStepResolver) ResolveSteps ¶
func (r *OperatorStepResolver) ResolveSteps(namespace string) ([]*v1alpha1.Step, []v1alpha1.BundleLookup, []*v1alpha1.Subscription, error)
type RegistryClientProvider ¶
type RegistryClientProvider interface {
ClientsForNamespaces(namespaces ...string) map[registry.CatalogKey]client.Interface
}
type RegistrySourceProvider ¶ added in v0.21.0
type RegistrySourceProvider struct {
// contains filtered or unexported fields
}
func SourceProviderFromRegistryClientProvider ¶ added in v0.19.0
func SourceProviderFromRegistryClientProvider(rcp RegistryClientProvider, catsrcLister v1alpha1listers.CatalogSourceLister, logger logrus.StdLogger) *RegistrySourceProvider
func (*RegistrySourceProvider) Invalidate ¶ added in v0.21.0
func (a *RegistrySourceProvider) Invalidate(key cache.SourceKey)
type Resolver ¶ added in v0.21.0
type Resolver struct {
// contains filtered or unexported fields
}
func NewDefaultResolver ¶ added in v0.21.0
func NewDefaultResolver(rcp cache.SourceProvider, sourcePriorityProvider cache.SourcePriorityProvider, logger logrus.FieldLogger) *Resolver
type StepResolver ¶
type StepResolver interface {
ResolveSteps(namespace string) ([]*v1alpha1.Step, []v1alpha1.BundleLookup, []*v1alpha1.Subscription, error)
}
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package solver implements a general-purpose solver for boolean constraint satisfiability problems.
|
Package solver implements a general-purpose solver for boolean constraint satisfiability problems. |