Documentation ¶
Overview ¶
Package platform allows to retrieve information about the current installed platform
Index ¶
- Constants
- Variables
- func ConfigureDefaults(ctx context.Context, c client.Client, p *v1.IntegrationPlatform, verbose bool) error
- func CreateBuilderServiceAccount(ctx context.Context, client client.Client, p *v1.IntegrationPlatform) error
- func GetForResource(ctx context.Context, c k8sclient.Reader, o k8sclient.Object) (*v1.IntegrationPlatform, error)
- func GetKits() []string
- func GetKitsNames() []string
- func GetOperatorLockName(operatorID string) string
- func GetOperatorNamespace() string
- func GetOperatorPodName() string
- func GetOperatorWatchNamespace() string
- func GetOrFindForResource(ctx context.Context, c k8sclient.Reader, o k8sclient.Object, active bool) (*v1.IntegrationPlatform, error)
- func GetOrFindLocal(ctx context.Context, c k8sclient.Reader, namespace string) (*v1.IntegrationPlatform, error)
- func GetOrFindLocalForResource(ctx context.Context, c k8sclient.Reader, o k8sclient.Object, active bool) (*v1.IntegrationPlatform, error)
- func GetProfile(p *v1.IntegrationPlatform) v1.TraitProfile
- func IsActive(p *v1.IntegrationPlatform) bool
- func IsCurrentOperatorGlobal() bool
- func IsNamespaceLocked(ctx context.Context, c ctrl.Reader, namespace string) (bool, error)
- func IsOperatorAllowedOnNamespace(ctx context.Context, c ctrl.Reader, namespace string) (bool, error)
- func IsOperatorHandler(object ctrl.Object) bool
- func IsOperatorHandlerConsideringLock(ctx context.Context, c ctrl.Reader, namespace string, object ctrl.Object) bool
- func IsSecondary(p *v1.IntegrationPlatform) bool
- func ListAllPlatforms(ctx context.Context, c k8sclient.Reader, namespace string) (*v1.IntegrationPlatformList, error)
- func ListPrimaryPlatforms(ctx context.Context, c k8sclient.Reader, namespace string) (*v1.IntegrationPlatformList, error)
- func LookupForPlatformName(ctx context.Context, c k8sclient.Reader, name string) (*v1.IntegrationPlatform, error)
- type FilteringFuncs
Constants ¶
const BuilderServiceAccount = "camel-k-builder"
BuilderServiceAccount --.
const (
// DefaultPlatformName is the standard name used for the integration platform.
DefaultPlatformName = "camel-k"
)
const OperatorLockName = "camel-k-lock"
const (
OperatorWatchNamespaceEnvVariable = "WATCH_NAMESPACE"
)
Variables ¶
var DefaultKits = []string{
"platform-integration-kit-jvm.yaml",
"platform-integration-kit-groovy.yaml",
"platform-integration-kit-kotlin.yaml",
}
DefaultKits --.
var KnativeKits = []string{
"platform-integration-kit-knative.yaml",
}
KnativeKits --.
var OperatorImage string
Functions ¶
func ConfigureDefaults ¶
func ConfigureDefaults(ctx context.Context, c client.Client, p *v1.IntegrationPlatform, verbose bool) error
ConfigureDefaults fills with default values all missing details about the integration platform. Defaults are set in the status fields, not in the spec.
func CreateBuilderServiceAccount ¶ added in v1.9.0
func GetForResource ¶ added in v1.7.0
func GetOperatorLockName ¶ added in v1.10.0
GetOperatorLockName returns the name of the lock lease that is electing a leader on the particular namepsace.
func GetOperatorNamespace ¶
func GetOperatorNamespace() string
GetOperatorNamespace returns the namespace where the current operator is located (if set).
func GetOperatorPodName ¶
func GetOperatorPodName() string
GetOperatorPodName returns the pod that is running the current operator (if any).
func GetOperatorWatchNamespace ¶ added in v1.4.0
func GetOperatorWatchNamespace() string
GetOperatorWatchNamespace returns the namespace the operator watches.
func GetOrFindForResource ¶ added in v1.7.0
func GetOrFindLocal ¶ added in v1.4.0
func GetOrFindLocalForResource ¶ added in v1.7.0
func GetProfile ¶
func GetProfile(p *v1.IntegrationPlatform) v1.TraitProfile
GetProfile returns the current profile of the platform (if present) or returns the default one for the cluster.
func IsActive ¶
func IsActive(p *v1.IntegrationPlatform) bool
IsActive determines if the given platform is being used.
func IsCurrentOperatorGlobal ¶
func IsCurrentOperatorGlobal() bool
IsCurrentOperatorGlobal returns true if the operator is configured to watch all namespaces.
func IsNamespaceLocked ¶ added in v1.3.0
IsNamespaceLocked tells if the namespace contains a lock indicating that an operator owns it.
func IsOperatorAllowedOnNamespace ¶ added in v1.3.0
func IsOperatorAllowedOnNamespace(ctx context.Context, c ctrl.Reader, namespace string) (bool, error)
IsOperatorAllowedOnNamespace returns true if the current operator is allowed to react on changes in the given namespace.
func IsOperatorHandler ¶ added in v1.7.0
IsOperatorHandler checks on resource operator id annotation and this operator instance id. Operators matching the annotation operator id are allowed to reconcile. For legacy resources that are missing a proper operator id annotation the default global operator or the local operator in this namespace are candidates for reconciliation.
func IsOperatorHandlerConsideringLock ¶ added in v1.10.0
func IsOperatorHandlerConsideringLock(ctx context.Context, c ctrl.Reader, namespace string, object ctrl.Object) bool
IsOperatorHandlerConsideringLock uses normal IsOperatorHandler checks and adds additional check for legacy resources that are missing a proper operator id annotation. In general two kind of operators race for reconcile these legacy resources. The local operator for this namespace and the default global operator instance. Based on the existence of a namespace lock the current local operator has precedence. When no lock exists the default global operator should reconcile.
func IsSecondary ¶ added in v1.7.0
func IsSecondary(p *v1.IntegrationPlatform) bool
IsSecondary determines if the given platform is marked as secondary.
func ListAllPlatforms ¶ added in v1.7.0
func ListAllPlatforms(ctx context.Context, c k8sclient.Reader, namespace string) (*v1.IntegrationPlatformList, error)
ListAllPlatforms returns all platforms installed in a given namespace.
func ListPrimaryPlatforms ¶ added in v1.7.0
func ListPrimaryPlatforms(ctx context.Context, c k8sclient.Reader, namespace string) (*v1.IntegrationPlatformList, error)
ListPrimaryPlatforms returns all non-secondary platforms installed in a given namespace (only one will be active).
func LookupForPlatformName ¶ added in v1.10.0
func LookupForPlatformName(ctx context.Context, c k8sclient.Reader, name string) (*v1.IntegrationPlatform, error)
LookupForPlatformName finds integration platform with given operator id as name in any namespace.
Types ¶
type FilteringFuncs ¶ added in v1.7.0
type FilteringFuncs struct { // Create returns true if the Create event should be processed CreateFunc func(event.CreateEvent) bool // Delete returns true if the Delete event should be processed DeleteFunc func(event.DeleteEvent) bool // Update returns true if the Update event should be processed UpdateFunc func(event.UpdateEvent) bool // Generic returns true if the Generic event should be processed GenericFunc func(event.GenericEvent) bool }
FilteringFuncs do preliminary checks to determine if certain events should be handled by the controller based on labels on the resources (e.g. camel.apache.org/operator.id) and the operator configuration, before handing the computation over to the user code.
func (FilteringFuncs) Create ¶ added in v1.7.0
func (f FilteringFuncs) Create(e event.CreateEvent) bool
func (FilteringFuncs) Delete ¶ added in v1.7.0
func (f FilteringFuncs) Delete(e event.DeleteEvent) bool
func (FilteringFuncs) Generic ¶ added in v1.7.0
func (f FilteringFuncs) Generic(e event.GenericEvent) bool
func (FilteringFuncs) Update ¶ added in v1.7.0
func (f FilteringFuncs) Update(e event.UpdateEvent) bool