resolver

package
v0.0.0-1e295784b-1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExistingOperator = OperatorSourceInfo{"", "", CatalogKey{"", ""}}

Functions

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 NewStepResourceFromBundle

func NewStepResourceFromBundle(bundle *registry.Bundle, namespace, 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 NewSubscriptionStepResource

func NewSubscriptionStepResource(namespace string, info OperatorSourceInfo) (v1alpha1.StepResource, error)

func RBACForClusterServiceVersion

func RBACForClusterServiceVersion(csv *v1alpha1.ClusterServiceVersion) (map[string]*OperatorPermissions, error)

Types

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 APISet

type APISet map[opregistry.APIKey]struct{}

func EmptyAPISet

func EmptyAPISet() APISet

func (APISet) PopAPIKey

func (s APISet) PopAPIKey() *opregistry.APIKey

type CatalogKey

type CatalogKey struct {
	Name      string
	Namespace string
}

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 NamespaceSourceQuerier

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

func NewNamespaceSourceQuerier

func NewNamespaceSourceQuerier(sources map[CatalogKey]client.Interface) *NamespaceSourceQuerier

func (*NamespaceSourceQuerier) FindPackage

func (q *NamespaceSourceQuerier) FindPackage(pkgName, channelName string, initialSource CatalogKey) (*opregistry.Bundle, *CatalogKey, error)

func (*NamespaceSourceQuerier) FindProvider

func (*NamespaceSourceQuerier) FindReplacement

func (q *NamespaceSourceQuerier) FindReplacement(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, sourceKey CatalogKey) (*Operator, error)

func NewOperatorFromCSV

func NewOperatorFromCSV(csv *v1alpha1.ClusterServiceVersion) (*Operator, error)

func (*Operator) Bundle

func (o *Operator) Bundle() *opregistry.Bundle

func (*Operator) Identifier

func (o *Operator) Identifier() string

func (*Operator) Package

func (o *Operator) Package() string

func (*Operator) ProvidedAPIs

func (o *Operator) ProvidedAPIs() APISet

func (*Operator) Replaces

func (o *Operator) Replaces() string

func (*Operator) RequiredAPIs

func (o *Operator) RequiredAPIs() APISet

func (*Operator) SourceInfo

func (o *Operator) SourceInfo() *OperatorSourceInfo

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

type OperatorSourceInfo

type OperatorSourceInfo struct {
	Package string
	Channel string
	Catalog CatalogKey
}

func (*OperatorSourceInfo) String

func (i *OperatorSourceInfo) String() string

type OperatorSurface

type OperatorSurface interface {
	ProvidedAPIs() APISet
	RequiredAPIs() APISet
	Identifier() string
	Replaces() string
	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 (*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)
	FindPackage(pkgName, channelName string, initialSource CatalogKey) (*opregistry.Bundle, *CatalogKey, error)
	FindReplacement(bundleName, pkgName, channelName string, initialSource CatalogKey) (*opregistry.Bundle, *CatalogKey, error)
	Queryable() error
}

type SourceRef

type SourceRef struct {
	Address     string
	Client      client.Interface
	LastConnect metav1.Time
	LastHealthy metav1.Time
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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