bundlec

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2019 License: Apache-2.0 Imports: 46 Imported by: 5 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	FinalizerDeleteResources = smith.Domain + "/deleteResources"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BundleStore

type BundleStore interface {
	// Get returns Bundle based on its namespace and name.
	Get(namespace, bundleName string) (*smith_v1.Bundle, error)
	// GetBundlesByCrd returns Bundles which have a resource defined by CRD.
	GetBundlesByCrd(*apiext_v1b1.CustomResourceDefinition) ([]*smith_v1.Bundle, error)
	// GetBundlesByObject returns Bundles which have a resource of a particular group/kind with a name in a namespace.
	GetBundlesByObject(gk schema.GroupKind, namespace, name string) ([]*smith_v1.Bundle, error)
}

type Controller

type Controller struct {
	Logger *zap.Logger

	ReadyForWork func()
	MainClient   kubernetes.Interface
	BundleClient smithClient_v1.BundlesGetter
	BundleStore  BundleStore
	SmartClient  SmartClient
	Rc           statuschecker.Interface
	Store        Store
	SpecChecker  SpecChecker
	WorkQueue    ctrl.WorkQueueProducer

	// CRD
	CrdResyncPeriod time.Duration
	Namespace       string

	PluginContainers map[smith_v1.PluginName]plugin.Container
	Scheme           *runtime.Scheme

	Catalog *store.Catalog

	// Metrics
	BundleTransitionCounter         *prometheus.CounterVec
	BundleResourceTransitionCounter *prometheus.CounterVec

	Broadcaster record.EventBroadcaster
	Recorder    record.EventRecorder
	// contains filtered or unexported fields
}

func (*Controller) Prepare

Prepare prepares the controller to be run.

func (*Controller) Process

func (c *Controller) Process(pctx *ctrl.ProcessContext) (bool, error)

func (*Controller) ProcessBundle

func (c *Controller) ProcessBundle(logger *zap.Logger, bundle *smith_v1.Bundle) (bool, error)

ProcessBundle is only visible for testing purposes. Should not be called directly.

func (*Controller) Run

func (c *Controller) Run(ctx context.Context)

Run begins watching and syncing. All informers must be synced before this method is invoked.

type ResourceStatusType

type ResourceStatusType string
const (
	ResourceStatusTypeReady                ResourceStatusType = "Ready"
	ResourceStatusTypeInProgress           ResourceStatusType = "InProgress"
	ResourceStatusTypeDependenciesNotReady ResourceStatusType = "DependenciesNotReady"
	ResourceStatusTypeError                ResourceStatusType = "Error"
)

type SmartClient

type SmartClient interface {
	ForGVK(gvk schema.GroupVersionKind, namespace string) (dynamic.ResourceInterface, error)
}

type SpecChecker

type SpecChecker interface {
	// BeforeCreate pre-processes object specification and returns an updated version.
	BeforeCreate(logger *zap.Logger, spec *unstructured.Unstructured) (*unstructured.Unstructured, error)
	CompareActualVsSpec(logger *zap.Logger, spec, actual runtime.Object) (updatedSpec *unstructured.Unstructured, match bool, diff string, err error)
}

type Store

type Store interface {
	Get(gvk schema.GroupVersionKind, namespace, name string) (obj runtime.Object, exists bool, err error)
	ObjectsControlledBy(namespace string, uid types.UID) ([]runtime.Object, error)
	AddInformer(schema.GroupVersionKind, cache.SharedIndexInformer) error
	RemoveInformer(schema.GroupVersionKind) bool
}

Jump to

Keyboard shortcuts

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