install

package
v0.10.1-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: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StrategyErrReasonComponentMissing   = "ComponentMissing"
	StrategyErrReasonAnnotationsMissing = "AnnotationsMissing"
	StrategyErrReasonWaiting            = "Waiting"
	StrategyErrReasonInvalidStrategy    = "InvalidStrategy"
	StrategyErrReasonTimeout            = "Timeout"
	StrategyErrReasonUnknown            = "Unknown"
)
View Source
const (
	InstallStrategyNameDeployment = "deployment"
)
View Source
const TimedOutReason = "ProgressDeadlineExceeded"

Variables

This section is empty.

Functions

func DeploymentStatus

func DeploymentStatus(deployment *appsv1.Deployment) (string, bool, error)

Status returns a message describing deployment status, and a bool value indicating if the status is considered done.

func IsErrorUnrecoverable

func IsErrorUnrecoverable(err error) bool

IsErrorUnrecoverable reports if a given strategy error is one of the predefined unrecoverable types

Types

type CSVRuleChecker

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

CSVRuleChecker determines whether a PolicyRule is satisfied for a ServiceAccount by existing Roles and ClusterRoles

func NewCSVRuleChecker

func NewCSVRuleChecker(roleLister crbacv1.RoleLister, roleBindingLister crbacv1.RoleBindingLister, clusterRoleLister crbacv1.ClusterRoleLister, clusterRoleBindingLister crbacv1.ClusterRoleBindingLister, csv *v1alpha1.ClusterServiceVersion) *CSVRuleChecker

NewCSVRuleChecker returns a pointer to a new CSVRuleChecker

func (*CSVRuleChecker) GetClusterRole

func (c *CSVRuleChecker) GetClusterRole(name string) (*rbacv1.ClusterRole, error)

func (*CSVRuleChecker) GetRole

func (c *CSVRuleChecker) GetRole(namespace, name string) (*rbacv1.Role, error)

func (*CSVRuleChecker) ListClusterRoleBindings

func (c *CSVRuleChecker) ListClusterRoleBindings() ([]*rbacv1.ClusterRoleBinding, error)

func (*CSVRuleChecker) ListRoleBindings

func (c *CSVRuleChecker) ListRoleBindings(namespace string) ([]*rbacv1.RoleBinding, error)

func (*CSVRuleChecker) RuleSatisfied

func (c *CSVRuleChecker) RuleSatisfied(sa *corev1.ServiceAccount, namespace string, rule rbacv1.PolicyRule) (bool, error)

RuleSatisfied returns true if a ServiceAccount is authorized to perform all actions described by a PolicyRule in a namespace

type NullStrategyInstaller

type NullStrategyInstaller struct{}

func (*NullStrategyInstaller) CheckInstalled

func (i *NullStrategyInstaller) CheckInstalled(s Strategy) (bool, error)

func (*NullStrategyInstaller) Install

func (i *NullStrategyInstaller) Install(s Strategy) error

type RuleChecker

type RuleChecker interface {
	// RuleSatisfied determines whether a PolicyRule is satisfied for a ServiceAccount
	// by existing Roles and ClusterRoles
	RuleSatisfied(sa *corev1.ServiceAccount, namespace string, rule rbacv1.PolicyRule) (bool, error)
}

RuleChecker is used to verify whether PolicyRules are satisfied by existing Roles or ClusterRoles

type Strategy

type Strategy interface {
	GetStrategyName() string
}

type StrategyDeploymentInstaller

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

func (*StrategyDeploymentInstaller) CheckInstalled

func (i *StrategyDeploymentInstaller) CheckInstalled(s Strategy) (installed bool, err error)

CheckInstalled can return nil (installed), or errors Errors can indicate: some component missing (keep installing), unable to query (check again later), or unrecoverable (failed in a way we know we can't recover from)

func (*StrategyDeploymentInstaller) Install

type StrategyDeploymentPermissions

type StrategyDeploymentPermissions struct {
	ServiceAccountName string            `json:"serviceAccountName"`
	Rules              []rbac.PolicyRule `json:"rules"`
}

StrategyDeploymentPermissions describe the rbac rules and service account needed by the install strategy

type StrategyDeploymentSpec

type StrategyDeploymentSpec struct {
	Name string                `json:"name"`
	Spec appsv1.DeploymentSpec `json:"spec"`
}

StrategyDeploymentSpec contains the name and spec for the deployment ALM should create

type StrategyDetailsDeployment

type StrategyDetailsDeployment struct {
	DeploymentSpecs    []StrategyDeploymentSpec        `json:"deployments"`
	Permissions        []StrategyDeploymentPermissions `json:"permissions,omitempty"`
	ClusterPermissions []StrategyDeploymentPermissions `json:"clusterPermissions,omitempty"`
}

StrategyDetailsDeployment represents the parsed details of a Deployment InstallStrategy.

func (*StrategyDetailsDeployment) GetStrategyName

func (d *StrategyDetailsDeployment) GetStrategyName() string

type StrategyError

type StrategyError struct {
	Reason  string
	Message string
}

StrategyError is used to represent error types for install strategies

func (StrategyError) Error

func (e StrategyError) Error() string

Error implements the Error interface.

type StrategyInstaller

type StrategyInstaller interface {
	Install(strategy Strategy) error
	CheckInstalled(strategy Strategy) (bool, error)
}

func NewStrategyDeploymentInstaller

func NewStrategyDeploymentInstaller(strategyClient wrappers.InstallStrategyDeploymentInterface, templateAnnotations map[string]string, owner ownerutil.Owner, previousStrategy Strategy) StrategyInstaller

type StrategyResolver

type StrategyResolver struct{}

func (*StrategyResolver) InstallerForStrategy

func (r *StrategyResolver) InstallerForStrategy(strategyName string, opClient operatorclient.ClientInterface, opLister operatorlister.OperatorLister, owner ownerutil.Owner, annotations map[string]string, previousStrategy Strategy) StrategyInstaller

func (*StrategyResolver) UnmarshalStrategy

func (r *StrategyResolver) UnmarshalStrategy(s v1alpha1.NamedInstallStrategy) (strategy Strategy, err error)

type StrategyResolverInterface

type StrategyResolverInterface interface {
	UnmarshalStrategy(s v1alpha1.NamedInstallStrategy) (strategy Strategy, err error)
	InstallerForStrategy(strategyName string, opClient operatorclient.ClientInterface, opLister operatorlister.OperatorLister, owner ownerutil.Owner, annotations map[string]string, previousStrategy Strategy) StrategyInstaller
}

Jump to

Keyboard shortcuts

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