v1alpha1

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the operators v1alpha1 API group +kubebuilder:object:generate=true +groupName=binding.operators.coreos.com

Index

Constants

View Source
const (
	// BindingReady indicates that the overall sbr succeeded
	BindingReady string = "Ready"
	// CollectionReady indicates readiness for collection and persistance of intermediate manifests
	CollectionReady string = "CollectionReady"
	// InjectionReady indicates readiness to change application manifests to use those intermediate manifests
	// If status is true, it indicates that the binding succeeded
	InjectionReady string = "InjectionReady"
	// EmptyServiceSelectorsReason is used when the ServiceBinding has empty
	// services.
	EmptyServiceSelectorsReason = "EmptyServiceSelectors"
	// EmptyApplicationReason is used when the ServiceBinding has empty
	// application.
	EmptyApplicationReason = "EmptyApplication"
	// ApplicationNotFoundReason is used when the application is not found.
	ApplicationNotFoundReason = "ApplicationNotFound"
	// ServiceNotFoundReason is used when the service is not found.
	ServiceNotFoundReason = "ServiceNotFound"

	BindingInjectedReason = "BindingInjected"

	DataCollectedReason = "DataCollected"

	// NamingStrategyError is used when naming strategy/template used is incorrect
	NamingStrategyError = "NamingStrategyError"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "binding.operators.coreos.com", Version: "v1alpha1"}

	GroupVersionResource = GroupVersion.WithResource("servicebindings")

	GroupVersionKind = GroupVersion.WithKind("ServiceBinding")

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func Conditions added in v0.7.0

func Conditions() *conditionsBuilder

Types

type Application

type Application struct {
	Ref `json:",inline"`
	// +optional
	LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`

	// BindingPath refers to the paths in the application workload's schema
	// where the binding workload would be referenced.
	// If BindingPath is not specified the default path locations is going to
	// be used.  The default location for ContainersPath is
	// going to be: "spec.template.spec.containers" and if SecretPath
	// is not specified, the name of the secret object is not going
	// to be specified.
	// +optional
	BindingPath *BindingPath `json:"bindingPath,omitempty"`
}

Application defines the selector based on labels and GVR

func (*Application) DeepCopy

func (in *Application) DeepCopy() *Application

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Application.

func (*Application) DeepCopyInto

func (in *Application) DeepCopyInto(out *Application)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BindingPath

type BindingPath struct {
	// ContainersPath defines the path to the corev1.Containers reference
	// If BindingPath is not specified, the default location is
	// going to be: "spec.template.spec.containers"
	// +optional
	ContainersPath string `json:"containersPath"`

	// SecretPath defines the path to a string field where
	// the name of the secret object is going to be assigned.
	// Note: The name of the secret object is same as that of the name of SBR CR (metadata.name)
	// +optional
	SecretPath string `json:"secretPath"`
}

BindingPath defines the path to the field where the binding would be embedded in the workload

func (*BindingPath) DeepCopy

func (in *BindingPath) DeepCopy() *BindingPath

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BindingPath.

func (*BindingPath) DeepCopyInto

func (in *BindingPath) DeepCopyInto(out *BindingPath)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Mapping

type Mapping struct {
	// Name is the name of new binding
	Name string `json:"name"`
	// Value is a template which will be rendered and ibjected into the application
	Value string `json:"value"`
}

ServiceBindingMapping defines a new binding from set of existing bindings

func (*Mapping) DeepCopy

func (in *Mapping) DeepCopy() *Mapping

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Mapping.

func (*Mapping) DeepCopyInto

func (in *Mapping) DeepCopyInto(out *Mapping)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NamespacedRef

type NamespacedRef struct {
	Ref `json:",inline"`

	// Namespace of the referent.
	// if empty assumes the same namespace as ServiceBinding
	// +optional
	Namespace *string `json:"namespace,omitempty"`
}

Object reference in some namespace

func (*NamespacedRef) DeepCopy

func (in *NamespacedRef) DeepCopy() *NamespacedRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacedRef.

func (*NamespacedRef) DeepCopyInto

func (in *NamespacedRef) DeepCopyInto(out *NamespacedRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Ref

type Ref struct {

	// Group of the referent.
	Group string `json:"group"`

	// Version of the referent.
	Version string `json:"version"`

	// Kind of the referent.
	// +optional
	Kind string `json:"kind,omitempty"`

	// Resource of the referent.
	// +optional
	Resource string `json:"resource,omitempty"`

	// Name of the referent.
	Name string `json:"name,omitempty"`
}

Object reference in the same namespace +mapType=atomic

func (*Ref) DeepCopy

func (in *Ref) DeepCopy() *Ref

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Ref.

func (*Ref) DeepCopyInto

func (in *Ref) DeepCopyInto(out *Ref)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Ref) GroupVersionKind

func (ref *Ref) GroupVersionKind() (*schema.GroupVersionKind, error)

Returns GVK of reference if available, otherwise error

func (*Ref) GroupVersionResource

func (ref *Ref) GroupVersionResource() (*schema.GroupVersionResource, error)

Returns GVR of reference if available, otherwise error

type Service

type Service struct {
	NamespacedRef `json:",inline"`

	Id *string `json:"id,omitempty"`
}

Service defines the selector based on resource name, version, and resource kind

func (*Service) DeepCopy

func (in *Service) DeepCopy() *Service

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Service.

func (*Service) DeepCopyInto

func (in *Service) DeepCopyInto(out *Service)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ServiceBinding

type ServiceBinding struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ServiceBindingSpec   `json:"spec"`
	Status ServiceBindingStatus `json:"status,omitempty"`
}

ServiceBinding expresses intent to bind an operator-backed service with an application workload. +kubebuilder:subresource:status +operator-sdk:gen-csv:customresourcedefinitions.displayName="Service Binding" +kubebuilder:resource:path=servicebindings,shortName=sbr;sbrs +kubebuilder:object:root=true

func (*ServiceBinding) AsOwnerReference

func (sbr *ServiceBinding) AsOwnerReference() metav1.OwnerReference

func (*ServiceBinding) DeepCopy

func (in *ServiceBinding) DeepCopy() *ServiceBinding

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceBinding.

func (*ServiceBinding) DeepCopyInto

func (in *ServiceBinding) DeepCopyInto(out *ServiceBinding)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ServiceBinding) DeepCopyObject

func (in *ServiceBinding) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*ServiceBinding) MaybeAddFinalizer added in v0.7.0

func (sb *ServiceBinding) MaybeAddFinalizer() bool

func (*ServiceBinding) MaybeRemoveFinalizer added in v0.7.0

func (sb *ServiceBinding) MaybeRemoveFinalizer() bool

type ServiceBindingList

type ServiceBindingList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ServiceBinding `json:"items"`
}

ServiceBindingList contains a list of ServiceBinding

func (*ServiceBindingList) DeepCopy

func (in *ServiceBindingList) DeepCopy() *ServiceBindingList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceBindingList.

func (*ServiceBindingList) DeepCopyInto

func (in *ServiceBindingList) DeepCopyInto(out *ServiceBindingList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ServiceBindingList) DeepCopyObject

func (in *ServiceBindingList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ServiceBindingSpec

type ServiceBindingSpec struct {
	// MountPath is the path inside app container where bindings will be mounted
	// If `SERVICE_BINDING_ROOT` env var is present, mountPath is ignored.
	// If `SERVICE_BINDING_ROOT` is absent and mountPath is present, set `SERVICE_BINDING_ROOT` as mountPath value
	// If `SERVICE_BINDING_ROOT` is absent but mounthPath is absent, set   SERVICE_BINDING_ROOT as `/bindings`
	// When mountPath is used, the file will be mounted directly under that directory
	// Otherwise it will be under `SERVICE_BINDING_ROOT`/<SERVICE-BINDING-NAME>
	// +optional
	MountPath string `json:"mountPath,omitempty"`

	// NamingStrategy defines custom string template for preparing binding names.
	// It can be pre-defined strategies(i.e none,uppercase), in case strategy provided in this field isn't defined
	// we are going to treat the value as a custom template and prepare binding names accordingly.
	// +optional
	NamingStrategy string `json:"namingStrategy,omitempty"`

	// Custom mappings
	// +optional
	Mappings []Mapping `json:"mappings,omitempty"`

	// Services is used to identify multiple backing services.
	// +kubebuilder:validation:MinItems:=1
	Services []Service `json:"services"`

	// Application is used to identify the application connecting to the
	// backing service operator.
	// +optional
	Application *Application `json:"application,omitempty"`

	// DetectBindingResources is flag used to bind all non-bindable variables from
	// different subresources owned by backing operator CR.
	// +optional
	DetectBindingResources bool `json:"detectBindingResources,omitempty"`

	// BindAsFiles makes available the binding values as files in the application's container
	// See MountPath attribute description for more details.
	// +optional
	// +kubebuilder:default:=true
	BindAsFiles bool `json:"bindAsFiles"`
}

ServiceBindingSpec defines the desired state of ServiceBinding

func (*ServiceBindingSpec) DeepCopy

func (in *ServiceBindingSpec) DeepCopy() *ServiceBindingSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceBindingSpec.

func (*ServiceBindingSpec) DeepCopyInto

func (in *ServiceBindingSpec) DeepCopyInto(out *ServiceBindingSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ServiceBindingSpec) NamingTemplate

func (spec *ServiceBindingSpec) NamingTemplate() string

type ServiceBindingStatus

type ServiceBindingStatus struct {
	// Conditions describes the state of the operator's reconciliation functionality.
	// +patchMergeKey=type
	// +patchStrategy=merge
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
	// Secret is the name of the intermediate secret
	Secret string `json:"secret"`

	// Application defines the application workloads to which the binding secret has
	// injected
	Applications []Ref `json:"applications,omitempty"`
}

ServiceBindingStatus defines the observed state of ServiceBinding +k8s:openapi-gen=true

func (*ServiceBindingStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceBindingStatus.

func (*ServiceBindingStatus) DeepCopyInto

func (in *ServiceBindingStatus) DeepCopyInto(out *ServiceBindingStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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