bundle

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: 30 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// TODO: This can be a spec field
	// BundleUnpackTimeoutAnnotationKey allows setting a bundle unpack timeout per OperatorGroup
	// and overrides the default specified by the --bundle-unpack-timeout flag
	// The time duration should be in the same format as accepted by time.ParseDuration()
	// e.g 1m30s
	BundleUnpackTimeoutAnnotationKey = "operatorframework.io/bundle-unpack-timeout"
	BundleUnpackPodLabel             = "job-name"

	// BundleUnpackRetryMinimumIntervalAnnotationKey sets a minimum interval to wait before
	// attempting to recreate a failed unpack job for a bundle.
	BundleUnpackRetryMinimumIntervalAnnotationKey = "operatorframework.io/bundle-unpack-min-retry-interval"
)
View Source
const (
	CatalogSourceMissingReason  = "CatalogSourceMissing"
	CatalogSourceMissingMessage = "referenced catalogsource not found"
	JobFailedReason             = "JobFailed"
	JobFailedMessage            = "unpack job has failed"
	JobIncompleteReason         = "JobIncomplete"
	JobIncompleteMessage        = "unpack job not completed"
	JobNotStartedReason         = "JobNotStarted"
	JobNotStartedMessage        = "unpack job not yet started"
	NotUnpackedReason           = "BundleNotUnpacked"
	NotUnpackedMessage          = "bundle contents have not yet been persisted to installplan status"
)

Variables

This section is empty.

Functions

func OperatorGroupBundleUnpackRetryInterval added in v0.26.0

func OperatorGroupBundleUnpackRetryInterval(ogLister v1listers.OperatorGroupNamespaceLister) (time.Duration, error)

OperatorGroupBundleUnpackRetryInterval returns bundle unpack retry interval from annotation if specified. If the retry annotation is not set, return retry = 0 which is subsequently ignored. This interval, if > 0, determines the minimum interval between recreating a failed unpack job.

func OperatorGroupBundleUnpackTimeout added in v0.25.0

func OperatorGroupBundleUnpackTimeout(ogLister v1listers.OperatorGroupNamespaceLister) (time.Duration, error)

OperatorGroupBundleUnpackTimeout returns bundle timeout from annotation if specified. If the timeout annotation is not set, return timeout < 0 which is subsequently ignored. This is to overrides the --bundle-unpack-timeout flag value on per-OperatorGroup basis.

Types

type BundleUnpackResult

type BundleUnpackResult struct {
	*operatorsv1alpha1.BundleLookup
	// contains filtered or unexported fields
}

func (*BundleUnpackResult) Bundle

func (b *BundleUnpackResult) Bundle() *api.Bundle

func (*BundleUnpackResult) Name

func (b *BundleUnpackResult) Name() string

func (*BundleUnpackResult) SetCondition

SetCondition replaces the existing BundleLookupCondition of the same type, or adds it if it was not found.

type ConfigMapUnpacker

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

func NewConfigmapUnpacker

func NewConfigmapUnpacker(options ...ConfigMapUnpackerOption) (*ConfigMapUnpacker, error)

func (*ConfigMapUnpacker) UnpackBundle

func (c *ConfigMapUnpacker) UnpackBundle(lookup *operatorsv1alpha1.BundleLookup, timeout, retryInterval time.Duration) (result *BundleUnpackResult, err error)

type ConfigMapUnpackerOption

type ConfigMapUnpackerOption func(*ConfigMapUnpacker)

func WithJobLister

func WithJobLister(jobLister listersbatchv1.JobLister) ConfigMapUnpackerOption

func WithLogger added in v0.19.0

func WithLogger(logger *logrus.Logger) ConfigMapUnpackerOption

func WithNow

func WithNow(now func() metav1.Time) ConfigMapUnpackerOption

func WithOPMImage

func WithOPMImage(opmImage string) ConfigMapUnpackerOption

func WithPodLister added in v0.18.2

func WithPodLister(podLister listerscorev1.PodLister) ConfigMapUnpackerOption

func WithRoleLister

func WithRoleLister(roleLister listersrbacv1.RoleLister) ConfigMapUnpackerOption

func WithUnpackTimeout added in v0.18.2

func WithUnpackTimeout(timeout time.Duration) ConfigMapUnpackerOption

func WithUserID added in v0.22.0

func WithUserID(id int64) ConfigMapUnpackerOption

func WithUtilImage

func WithUtilImage(utilImage string) ConfigMapUnpackerOption

type Unpacker

type Unpacker interface {
	UnpackBundle(lookup *operatorsv1alpha1.BundleLookup, timeout, retryInterval time.Duration) (result *BundleUnpackResult, err error)
}

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