platform

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package platform allows to retrieve information about the current installed platform

Index

Constants

View Source
const BuilderServiceAccount = "camel-k-builder"

BuilderServiceAccount --.

View Source
const (
	// DefaultPlatformName is the standard name used for the integration platform.
	DefaultPlatformName = "camel-k"
)
View Source
const OperatorLockName = "camel-k-lock"
View Source
const (
	OperatorWatchNamespaceEnvVariable = "WATCH_NAMESPACE"
)

Variables

View Source
var DefaultKits = []string{
	"platform-integration-kit-jvm.yaml",
	"platform-integration-kit-groovy.yaml",
	"platform-integration-kit-kotlin.yaml",
}

DefaultKits --.

View Source
var KnativeKits = []string{
	"platform-integration-kit-knative.yaml",
}

KnativeKits --.

View Source
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

func CreateBuilderServiceAccount(ctx context.Context, client client.Client, p *v1.IntegrationPlatform) error

func GetKits

func GetKits() []string

GetKits --.

func GetKitsNames

func GetKitsNames() []string

GetKitsNames --.

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

func GetOperatorWatchNamespace() string

GetOperatorWatchNamespace returns the namespace the operator watches.

func GetOrFindForResource

func GetOrFindForResource(ctx context.Context, c k8sclient.Reader, o k8sclient.Object, active bool) (*v1.IntegrationPlatform, error)

func GetOrFindLocalForResource

func GetOrFindLocalForResource(ctx context.Context, c k8sclient.Reader, o k8sclient.Object, active bool) (*v1.IntegrationPlatform, error)

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

func IsNamespaceLocked(ctx context.Context, c ctrl.Reader, namespace string) (bool, error)

IsNamespaceLocked tells if the namespace contains a lock indicating that an operator owns it.

func IsOperatorAllowedOnNamespace

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

func IsOperatorHandler(object ctrl.Object) bool

func IsSecondary

func IsSecondary(p *v1.IntegrationPlatform) bool

IsSecondary determines if the given platform is marked as secondary.

func ListAllPlatforms

func ListAllPlatforms(ctx context.Context, c k8sclient.Reader, namespace string) (*v1.IntegrationPlatformList, error)

ListAllPlatforms returns all platforms installed in a given namespace.

func ListPrimaryPlatforms

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).

Types

type FilteringFuncs

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

func (f FilteringFuncs) Create(e event.CreateEvent) bool

func (FilteringFuncs) Delete

func (f FilteringFuncs) Delete(e event.DeleteEvent) bool

func (FilteringFuncs) Generic

func (f FilteringFuncs) Generic(e event.GenericEvent) bool

func (FilteringFuncs) Update

func (f FilteringFuncs) Update(e event.UpdateEvent) bool

Jump to

Keyboard shortcuts

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