controller

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RetryDuration = 30 * time.Second
	RetryDelay    = time.Second
)
View Source
const (
	WarningAnnotation = "goharbor.io/warning"
	WarningValueTmpl  = "⚠️ This Resource is managed by *%s* ⚠️"
)
View Source
const (
	OperatorNameLabel    = "goharbor.io/operator-controller"
	OperatorVersionLabel = "goharbor.io/operator-version"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	client.Client

	Name    string
	Version string

	ConfigStore *configstore.Store

	Log    logr.Logger
	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

func NewController

func NewController(ctx context.Context, name string, rm ResourceManager, config *configstore.Store) *Controller

func (*Controller) AddBasicResource

func (c *Controller) AddBasicResource(ctx context.Context, resource resources.Resource, dependencies ...graph.Resource) (graph.Resource, error)

func (*Controller) AddCertificateToManage

func (c *Controller) AddCertificateToManage(ctx context.Context, resource *certv1.Certificate, dependencies ...graph.Resource) (graph.Resource, error)

func (*Controller) AddConfigMapToManage

func (c *Controller) AddConfigMapToManage(ctx context.Context, resource *corev1.ConfigMap, dependencies ...graph.Resource) (graph.Resource, error)

func (*Controller) AddDeploymentToManage

func (c *Controller) AddDeploymentToManage(ctx context.Context, resource *appsv1.Deployment, dependencies ...graph.Resource) (graph.Resource, error)

func (*Controller) AddExternalResource

func (c *Controller) AddExternalResource(ctx context.Context, resource resources.Resource, dependencies ...graph.Resource) (graph.Resource, error)

func (*Controller) AddExternalTypedSecret

func (c *Controller) AddExternalTypedSecret(ctx context.Context, secret *corev1.Secret, secretType corev1.SecretType, dependencies ...graph.Resource) (graph.Resource, error)

func (*Controller) AddGVKToSpan

func (c *Controller) AddGVKToSpan(ctx context.Context, span opentracing.Span, resource runtime.Object) (gvk schema.GroupVersionKind)

func (*Controller) AddImmutableSecretToManage

func (c *Controller) AddImmutableSecretToManage(ctx context.Context, resource *corev1.Secret, dependencies ...graph.Resource) (graph.Resource, error)

func (*Controller) AddIngressToManage

func (c *Controller) AddIngressToManage(ctx context.Context, resource *netv1.Ingress, dependencies ...graph.Resource) (graph.Resource, error)

func (*Controller) AddIssuerToManage

func (c *Controller) AddIssuerToManage(ctx context.Context, resource *certv1.Issuer, dependencies ...graph.Resource) (graph.Resource, error)

func (*Controller) AddSecretToManage

func (c *Controller) AddSecretToManage(ctx context.Context, resource *corev1.Secret, dependencies ...graph.Resource) (graph.Resource, error)

func (*Controller) AddServiceToManage

func (c *Controller) AddServiceToManage(ctx context.Context, resource *corev1.Service, dependencies ...graph.Resource) (graph.Resource, error)

func (*Controller) AddUnsctructuredToManage

func (c *Controller) AddUnsctructuredToManage(ctx context.Context, resource *unstructured.Unstructured, dependencies ...graph.Resource) (graph.Resource, error)

func (*Controller) Apply

func (c *Controller) Apply(ctx context.Context, res *Resource) error

func (*Controller) Create added in v1.0.0

func (c *Controller) Create(ctx context.Context, node graph.Resource) error

func (*Controller) DeploymentMutateFn

func (c *Controller) DeploymentMutateFn(ctx context.Context, dependencies ...graph.Resource) resources.Mutable

func (*Controller) EnsureReady

func (c *Controller) EnsureReady(ctx context.Context, node graph.Resource) error

func (*Controller) EnsureSecretType

func (c *Controller) EnsureSecretType(ctx context.Context, node graph.Resource) error

func (*Controller) Funcs

func (*Controller) GetAndFilter

func (c *Controller) GetAndFilter(ctx context.Context, key client.ObjectKey, obj runtime.Object) (bool, error)

func (*Controller) GetFQDN

func (c *Controller) GetFQDN() string

func (*Controller) GetName

func (c *Controller) GetName() string

func (*Controller) GetTemplatedConfig

func (c *Controller) GetTemplatedConfig(ctx context.Context, templateConfig string, owner resources.Resource) ([]byte, error)

func (*Controller) GetVersion

func (c *Controller) GetVersion() string

func (*Controller) GlobalMutateFn

func (c *Controller) GlobalMutateFn(ctx context.Context) resources.Mutable

func (*Controller) HandleError

func (c *Controller) HandleError(ctx context.Context, resource runtime.Object, resultError error) (ctrl.Result, error)

func (*Controller) Label

func (c *Controller) Label(suffix ...string) string

func (*Controller) LabelWithPrefix

func (c *Controller) LabelWithPrefix(prefix string, suffix ...string) string

func (*Controller) NewContext

func (c *Controller) NewContext(req ctrl.Request) context.Context

func (*Controller) NormalizeName

func (c *Controller) NormalizeName(ctx context.Context, name string, suffixes ...string) string

func (*Controller) ProcessFunc

func (c *Controller) ProcessFunc(ctx context.Context, resource metav1.Object, dependencies ...graph.Resource) func(context.Context, graph.Resource) error

func (*Controller) Reconcile

func (c *Controller) Reconcile(req ctrl.Request) (ctrl.Result, error)

func (*Controller) Run

func (c *Controller) Run(ctx context.Context, owner resources.Resource) error

func (*Controller) SetControllerStatus

func (c *Controller) SetControllerStatus(ctx context.Context, data map[string]interface{}) error

func (*Controller) SetErrorConditions

func (c *Controller) SetErrorConditions(ctx context.Context, data map[string]interface{}, resultError error) error

func (*Controller) SetErrorStatus

func (c *Controller) SetErrorStatus(ctx context.Context, resource runtime.Object, resultError error) error

func (*Controller) SetSuccessConditions

func (c *Controller) SetSuccessConditions(ctx context.Context, data map[string]interface{}) error

func (*Controller) SetSuccessStatus

func (c *Controller) SetSuccessStatus(ctx context.Context, resource runtime.Object) error

func (*Controller) SetupWithManager

func (c *Controller) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error

type Reconciler

type Reconciler interface {
	reconcile.Reconciler
	SetupWithManager(context.Context, manager.Manager) error
}

type Resource

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

type ResourceManager

type ResourceManager interface {
	AddResources(context.Context, resources.Resource) error
	NewEmpty(context.Context) resources.Resource
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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