resolver

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 44 Imported by: 1

Documentation

Index

Constants

View Source
const (
	BundleLookupConditionPacked v1alpha1.BundleLookupConditionType = "BundleLookupNotPersisted"
)
View Source
const (
	BundleSecretKind = "BundleSecret"
)
View Source
const ContentHashLabelKey = "olm.permissions.hash"

Variables

This section is empty.

Functions

func EnsurePackageProperty added in v0.19.0

func EnsurePackageProperty(o *cache.Entry, name, version string)

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 NewInvalidSubscriptionVariable(name string, reason string) solver.Variable

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 NewStepResourceFromBundle

func NewStepResourceFromBundle(bundle *api.Bundle, namespace, replaces, catalogSourceName, catalogSourceNamespace string) ([]v1alpha1.StepResource, error)

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 NewStepsFromBundle(bundle *api.Bundle, namespace, replaces, catalogSourceName, catalogSourceNamespace string) ([]*v1alpha1.Step, error)

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

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 RoleReferenceAndSubjectHashLabelValue(roleRef rbacv1.RoleRef, subjects []rbacv1.Subject) (string, error)

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 (i *BundleVariable) BundleSourceInfo() (string, string, cache.SourceKey, error)

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, logger logrus.StdLogger) *RegistrySourceProvider

func (*RegistrySourceProvider) Invalidate added in v0.21.0

func (a *RegistrySourceProvider) Invalidate(key cache.SourceKey)

func (*RegistrySourceProvider) Sources added in v0.21.0

func (a *RegistrySourceProvider) Sources(namespaces ...string) map[cache.SourceKey]cache.Source

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

func (*Resolver) Resolve added in v0.21.0

func (r *Resolver) Resolve(namespaces []string, subs []*v1alpha1.Subscription) ([]*cache.Entry, error)

type StepResolver

type StepResolver interface {
	ResolveSteps(namespace string) ([]*v1alpha1.Step, []v1alpha1.BundleLookup, []*v1alpha1.Subscription, error)
}

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.

Jump to

Keyboard shortcuts

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