Documentation ¶
Index ¶
- Constants
- Variables
- func IsOptimisticLockError(err error) bool
- type Controller
- func (c *Controller) AddBasicResource(ctx context.Context, resource resources.Resource, ...) (*Resource, error)
- func (c *Controller) AddCertificateToManage(ctx context.Context, resource *certv1.Certificate, ...) (graph.Resource, error)
- func (c *Controller) AddConfigMapToManage(ctx context.Context, resource *corev1.ConfigMap, ...) (graph.Resource, error)
- func (c *Controller) AddDeploymentToManage(ctx context.Context, resource *appsv1.Deployment, ...) (graph.Resource, error)
- func (c *Controller) AddExternalConfigMap(ctx context.Context, configMap *corev1.ConfigMap, ...) (graph.Resource, error)
- func (c *Controller) AddExternalResource(ctx context.Context, resource resources.Resource, ...) (graph.Resource, error)
- func (c *Controller) AddExternalTypedSecret(ctx context.Context, secret *corev1.Secret, secretType corev1.SecretType, ...) (graph.Resource, error)
- func (c *Controller) AddGVKToSpan(ctx context.Context, span opentracing.Span, resource runtime.Object) (gvk schema.GroupVersionKind)
- func (c *Controller) AddIngressToManage(ctx context.Context, resource *netv1.Ingress, dependencies ...graph.Resource) (graph.Resource, error)
- func (c *Controller) AddIssuerToManage(ctx context.Context, resource *certv1.Issuer, dependencies ...graph.Resource) (graph.Resource, error)
- func (c *Controller) AddNetworkPolicyToManage(ctx context.Context, resource *netv1.NetworkPolicy, ...) (graph.Resource, error)
- func (c *Controller) AddSecretToManage(ctx context.Context, resource *corev1.Secret, dependencies ...graph.Resource) (graph.Resource, error)
- func (c *Controller) AddServiceToManage(ctx context.Context, resource *corev1.Service, dependencies ...graph.Resource) (graph.Resource, error)
- func (c *Controller) AddUnsctructuredToManage(ctx context.Context, resource *unstructured.Unstructured, ...) (graph.Resource, error)
- func (c *Controller) Apply(ctx context.Context, res *Resource) error
- func (c *Controller) AreNetworkPoliciesEnabled(ctx context.Context, resource resources.Resource) (bool, error)
- func (c *Controller) BoolConfig(ctx context.Context, key string, defaultValue bool) (bool, error)
- func (c *Controller) Changed(ctx context.Context, depManager *checksum.Dependencies, ...) (bool, error)
- func (c *Controller) DeploymentMutateFn(ctx context.Context, dependencies ...graph.Resource) (resources.Mutable, error)
- func (c *Controller) EnsureReady(ctx context.Context, node graph.Resource) error
- func (c *Controller) EnsureSecretType(ctx context.Context, node graph.Resource) error
- func (c *Controller) Funcs(ctx context.Context, owner resources.Resource) template.FuncMap
- func (c *Controller) GetAndFilter(ctx context.Context, key client.ObjectKey, obj client.Object) (bool, error)
- func (c *Controller) GetClassName(ctx context.Context) (string, error)
- func (c *Controller) GetFQDN() string
- func (c *Controller) GetGitCommit() string
- func (c *Controller) GetName() string
- func (c *Controller) GetTemplatedConfig(ctx context.Context, templateConfig string, owner resources.Resource) ([]byte, error)
- func (c *Controller) GetVersion() string
- func (c *Controller) GlobalMutateFn(ctx context.Context) (resources.Mutable, error)
- func (c *Controller) HandleError(ctx context.Context, resource client.Object, resultError error) (ctrl.Result, error)
- func (c *Controller) IntConfig(ctx context.Context, key string, defaultValue int) (int, error)
- func (c *Controller) Label(suffix ...string) string
- func (c *Controller) LabelWithPrefix(prefix string, suffix ...string) string
- func (c *Controller) NormalizeName(ctx context.Context, name string, suffixes ...string) string
- func (c *Controller) PopulateContext(ctx context.Context, req ctrl.Request) context.Context
- func (c *Controller) PrepareStatus(ctx context.Context, owner resources.Resource) error
- func (c *Controller) ProcessFunc(ctx context.Context, resource runtime.Object, dependencies ...graph.Resource) func(context.Context, graph.Resource) error
- func (c *Controller) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (c *Controller) Run(ctx context.Context, owner resources.Resource) error
- func (c *Controller) SecretMutateFn(ctx context.Context, immutable *bool) (resources.Mutable, error)
- func (c *Controller) SetControllerStatus(ctx context.Context, data map[string]interface{}) error
- func (c *Controller) SetErrorConditions(ctx context.Context, data map[string]interface{}, resultError error) error
- func (c *Controller) SetErrorStatus(ctx context.Context, resource runtime.Object, resultError error) error
- func (c *Controller) SetSuccessConditions(ctx context.Context, data map[string]interface{}) error
- func (c *Controller) SetSuccessStatus(ctx context.Context, resource runtime.Object) error
- func (c *Controller) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error
- func (c *Controller) StringConfig(ctx context.Context, key string, defaultValue string) (string, error)
- type Reconciler
- type Resource
- type ResourceManager
Constants ¶
View Source
const ( ImmutableAnnotation = "goharbor.io/immutable" WarningAnnotation = "goharbor.io/warning" WarningValueTmpl = "⚠️ This Resource is managed by *%s* ⚠️" )
View Source
const ( OperatorNameLabel = "goharbor.io/operator-controller" OperatorVersionLabel = "goharbor.io/operator-version" )
View Source
const DefaultClassName = ""
Variables ¶
View Source
var ErrorOwnerNotFound = errors.New("owner not found")
Functions ¶
func IsOptimisticLockError ¶ added in v1.0.1
Types ¶
type Controller ¶
type Controller struct { client.Client BaseController controllers.Controller Version string GitCommit string ConfigStore *configstore.Store Log logr.Logger Scheme *runtime.Scheme // contains filtered or unexported fields }
func NewController ¶
func NewController(ctx context.Context, base controllers.Controller, rm ResourceManager, config *configstore.Store) *Controller
func (*Controller) AddBasicResource ¶
func (*Controller) AddCertificateToManage ¶
func (c *Controller) AddCertificateToManage(ctx context.Context, resource *certv1.Certificate, dependencies ...graph.Resource) (graph.Resource, error)
func (*Controller) AddConfigMapToManage ¶
func (*Controller) AddDeploymentToManage ¶
func (c *Controller) AddDeploymentToManage(ctx context.Context, resource *appsv1.Deployment, dependencies ...graph.Resource) (graph.Resource, error)
func (*Controller) AddExternalConfigMap ¶ added in v1.0.1
func (*Controller) AddExternalResource ¶
func (*Controller) AddExternalTypedSecret ¶
func (*Controller) AddGVKToSpan ¶
func (c *Controller) AddGVKToSpan(ctx context.Context, span opentracing.Span, resource runtime.Object) (gvk schema.GroupVersionKind)
func (*Controller) AddIngressToManage ¶
func (*Controller) AddIssuerToManage ¶
func (*Controller) AddNetworkPolicyToManage ¶ added in v1.0.1
func (c *Controller) AddNetworkPolicyToManage(ctx context.Context, resource *netv1.NetworkPolicy, dependencies ...graph.Resource) (graph.Resource, error)
func (*Controller) AddSecretToManage ¶
func (*Controller) AddServiceToManage ¶
func (*Controller) AddUnsctructuredToManage ¶
func (c *Controller) AddUnsctructuredToManage(ctx context.Context, resource *unstructured.Unstructured, dependencies ...graph.Resource) (graph.Resource, error)
func (*Controller) AreNetworkPoliciesEnabled ¶ added in v1.0.1
func (*Controller) BoolConfig ¶ added in v1.0.1
func (*Controller) Changed ¶
func (c *Controller) Changed(ctx context.Context, depManager *checksum.Dependencies, resource resources.Resource) (bool, error)
func (*Controller) DeploymentMutateFn ¶
func (*Controller) EnsureReady ¶
func (*Controller) EnsureSecretType ¶
func (*Controller) GetAndFilter ¶
func (*Controller) GetClassName ¶ added in v1.0.1
func (c *Controller) GetClassName(ctx context.Context) (string, error)
func (*Controller) GetFQDN ¶
func (c *Controller) GetFQDN() string
func (*Controller) GetGitCommit ¶ added in v1.0.1
func (c *Controller) GetGitCommit() string
func (*Controller) GetName ¶
func (c *Controller) GetName() string
func (*Controller) GetTemplatedConfig ¶
func (*Controller) GetVersion ¶
func (c *Controller) GetVersion() string
func (*Controller) GlobalMutateFn ¶
func (*Controller) HandleError ¶
func (*Controller) Label ¶
func (c *Controller) Label(suffix ...string) string
func (*Controller) LabelWithPrefix ¶
func (c *Controller) LabelWithPrefix(prefix string, suffix ...string) string
func (*Controller) NormalizeName ¶
func (*Controller) PopulateContext ¶ added in v1.1.0
func (*Controller) PrepareStatus ¶ added in v1.0.1
func (*Controller) ProcessFunc ¶
func (*Controller) SecretMutateFn ¶ added in v1.0.1
func (*Controller) SetControllerStatus ¶
func (c *Controller) SetControllerStatus(ctx context.Context, data map[string]interface{}) error
func (*Controller) SetErrorConditions ¶
func (*Controller) SetErrorStatus ¶
func (*Controller) SetSuccessConditions ¶
func (c *Controller) SetSuccessConditions(ctx context.Context, data map[string]interface{}) error
func (*Controller) SetSuccessStatus ¶
func (*Controller) SetupWithManager ¶
func (*Controller) StringConfig ¶ added in v1.0.1
type Reconciler ¶
type Resource ¶
type Resource struct {
// contains filtered or unexported fields
}
func (*Resource) GetResource ¶ added in v1.0.1
Source Files ¶
Click to show internal directories.
Click to hide internal directories.