v1alpha1

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the crossplane core v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/crossplaneio/crossplane/pkg/apis/core +k8s:defaulter-gen=TypeMeta +groupName=core.crossplane.io

Package v1alpha1 contains API Schema definitions for the crossplane core v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/crossplaneio/crossplane/pkg/apis/core +k8s:defaulter-gen=TypeMeta +groupName=core.crossplane.io

Index

Constants

View Source
const (
	Group             = "core.crossplane.io"
	Version           = "v1alpha1"
	ResourceClassKind = "resourceclass"
	APIVersion        = Group + "/" + Version
)

Kubernetes Group, Version, and Kind metadata.

View Source
const (
	// ResourceCredentialsSecretEndpointKey is the key inside a connection secret for the connection endpoint
	ResourceCredentialsSecretEndpointKey = "endpoint"
	// ResourceCredentialsSecretUserKey is the key inside a connection secret for the connection user
	ResourceCredentialsSecretUserKey = "username"
	// ResourceCredentialsSecretPasswordKey is the key inside a connection secret for the connection password
	ResourceCredentialsSecretPasswordKey = "password"
	// ResourceCredentialsSecretCAKey is the key inside a connection secret for the server CA certificate
	ResourceCredentialsSecretCAKey = "clusterCA"
	// ResourceCredentialsSecretClientCertKey is the key inside a connection secret for the client certificate
	ResourceCredentialsSecretClientCertKey = "clientCert"
	// ResourceCredentialsSecretClientKeyKey is the key inside a connection secret for the client key
	ResourceCredentialsSecretClientKeyKey = "clientKey"
	// ResourceCredentialsTokenKey is the key inside a connection secret for the bearer token value
	ResourceCredentialsTokenKey = "token"
)

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: Group, Version: Version}

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

Functions

func AssertConditions

func AssertConditions(g *gomega.GomegaWithT, expected []Condition, actual ConditionedStatus)

AssertConditions verifies the given expected conditions against the given actual conditions. This is helpful for unit tests since the Condition type has a timestamp that makes full object equal comparisons difficult. TODO: consider to use ConditionMatcher or ConditionedStatusMatcher instead

func MatchCondition

func MatchCondition(expected interface{}) types.GomegaMatcher

MatchCondition returns a new gomga matcher for Conditions.

func MatchConditionedStatus

func MatchConditionedStatus(expected interface{}) types.GomegaMatcher

MatchConditionedStatus returns a new gomega matcher for conditioned statuses.

Types

type BasicResource

type BasicResource struct {
	// TODO(negz): It's not obvious why we embed this Resource interface rather
	// than just fulfilling it. If someone knows why this is, please add a
	// comment.
	Resource
	// contains filtered or unexported fields
}

BasicResource base structure that implements Resource interface +k8s:deepcopy-gen=false

func NewBasicResource

func NewBasicResource(ref *corev1.ObjectReference, secretName, endpoint, state string) *BasicResource

NewBasicResource new instance of base resource

func (*BasicResource) ConnectionSecretName

func (br *BasicResource) ConnectionSecretName() string

ConnectionSecretName referenced by this resource

func (*BasicResource) IsAvailable

func (br *BasicResource) IsAvailable() bool

IsAvailable returns true if this resource is available.

func (*BasicResource) IsBound

func (br *BasicResource) IsBound() bool

IsBound returns true if this resource is currently bound to a resource claim.

func (*BasicResource) ObjectReference

func (br *BasicResource) ObjectReference() *corev1.ObjectReference

ObjectReference to this resource

func (*BasicResource) SetBound

func (br *BasicResource) SetBound(bound bool)

SetBound specifies whether this resource is currently bound to a resource claim.

type BindingState

type BindingState int

BindingState is to identify the current binding status of given resources

const (
	BindingStateUnbound BindingState = iota
	BindingStateBound
)

Binding states.

func (BindingState) MarshalJSON added in v0.2.0

func (s BindingState) MarshalJSON() ([]byte, error)

MarshalJSON returns a JSON representation of a BindingState.

func (BindingState) String added in v0.2.0

func (i BindingState) String() string

func (*BindingState) UnmarshalJSON added in v0.2.0

func (s *BindingState) UnmarshalJSON(b []byte) error

UnmarshalJSON returns a BindingState from its JSON representation.

type BindingStatus

type BindingStatus interface {
	SetBound(bound bool)
	IsBound() bool
}

BindingStatus defines set of supported operations

type BindingStatusPhase

type BindingStatusPhase struct {
	// Phase represents the binding status of a resource.
	Phase BindingState `json:"bindingPhase,omitempty"`
}

BindingStatusPhase defines field(s) representing resource status.

func (*BindingStatusPhase) DeepCopy

func (in *BindingStatusPhase) DeepCopy() *BindingStatusPhase

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

func (*BindingStatusPhase) DeepCopyInto

func (in *BindingStatusPhase) DeepCopyInto(out *BindingStatusPhase)

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

func (*BindingStatusPhase) IsBound

func (b *BindingStatusPhase) IsBound() bool

IsBound returns true if status is bound

func (*BindingStatusPhase) SetBound

func (b *BindingStatusPhase) SetBound(bound bool)

SetBound set binding status to Bound

type Condition

type Condition struct {
	Type               ConditionType
	Status             corev1.ConditionStatus
	LastTransitionTime metav1.Time
	Reason             string
	Message            string
}

Condition contains details for the current condition of this pod.

func FilterOutCondition

func FilterOutCondition(conditions []Condition, condType ConditionType) []Condition

FilterOutCondition returns a new slice of credentials controller conditions without conditions with the provided type.

func NewCondition

func NewCondition(condType ConditionType, reason, msg string) Condition

NewCondition creates a new resource condition.

func NewReadyCondition added in v0.2.0

func NewReadyCondition() Condition

NewReadyCondition sets and activates Ready status condition

func (*Condition) DeepCopy

func (in *Condition) DeepCopy() *Condition

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

func (*Condition) DeepCopyInto

func (in *Condition) DeepCopyInto(out *Condition)

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

func (Condition) Equal added in v0.2.0

func (c Condition) Equal(other Condition) bool

Equal returns true if the condition is identical to the supplied condition, ignoring the LastTransitionTime. github.com/go-test/deep uses this method to test equality.

type ConditionMatcher

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

ConditionMatcher is a gomega matcher for Conditions. +k8s:deepcopy-gen=false

func (*ConditionMatcher) FailureMessage

func (cm *ConditionMatcher) FailureMessage(actual interface{}) (message string)

FailureMessage is printed when conditions do not match.

func (*ConditionMatcher) Match

func (cm *ConditionMatcher) Match(actual interface{}) (success bool, err error)

Match returns true if the underlying condition matches the supplied one.

func (*ConditionMatcher) NegatedFailureMessage

func (cm *ConditionMatcher) NegatedFailureMessage(actual interface{}) (message string)

NegatedFailureMessage is printed when conditions match unexpectedly.

type ConditionType

type ConditionType string

ConditionType type for possible conditions the resource could be in.

const (
	// Pending means that the resource create request has been received and is waiting to be fulfilled.
	Pending ConditionType = "Pending"
	// Creating means that the resource create request has been accepted and the resource is in
	// the process of being created.
	Creating ConditionType = "Creating"
	// Deleting means that the resource is in the process of being deleted.
	Deleting ConditionType = "Deleting"
	// Failed means that the resource is in a failure state, for example it failed to be created.
	Failed ConditionType = "Failed"
	// Ready means that the resource creation has been successful and the resource is ready to
	// accept requests and perform operations.
	Ready ConditionType = "Ready"
)

Resource conditions.

type Conditionable

type Conditionable interface {
	Condition(ConditionType) *Condition
	SetCondition(Condition)
	RemoveCondition(ConditionType)
	UnsetCondition(ConditionType)
	UnsetAllConditions()
}

Conditionable defines set of functionality to operate on Conditions

type ConditionedStatus

type ConditionedStatus struct {
	// Conditions indicate state for particular aspects of a CustomResourceDefinition
	Conditions []Condition
}

ConditionedStatus defines the observed state of RDS resource

func (*ConditionedStatus) Condition

func (c *ConditionedStatus) Condition(conditionType ConditionType) *Condition

Condition returns a provider condition with the provided type if it exists.

func (*ConditionedStatus) DeepCopy

func (in *ConditionedStatus) DeepCopy() *ConditionedStatus

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

func (*ConditionedStatus) DeepCopyInto

func (in *ConditionedStatus) DeepCopyInto(out *ConditionedStatus)

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

func (*ConditionedStatus) IsCondition

func (c *ConditionedStatus) IsCondition(ctype ConditionType) bool

IsCondition of provided type is present and set to true

func (*ConditionedStatus) IsFailed

func (c *ConditionedStatus) IsFailed() bool

IsFailed returns true if the status is currently failed.

func (*ConditionedStatus) IsReady

func (c *ConditionedStatus) IsReady() bool

IsReady returns true if the status is currently ready.

func (*ConditionedStatus) RemoveAllConditions

func (c *ConditionedStatus) RemoveAllConditions()

RemoveAllConditions removes all condition entries

func (*ConditionedStatus) RemoveCondition

func (c *ConditionedStatus) RemoveCondition(condType ConditionType)

RemoveCondition removes the condition with the provided type from the credentials controller status.

func (*ConditionedStatus) SetCondition

func (c *ConditionedStatus) SetCondition(condition Condition)

SetCondition adds/replaces the given condition in the credentials controller status.

func (*ConditionedStatus) SetCreating

func (c *ConditionedStatus) SetCreating()

SetCreating set creating as an active condition

func (*ConditionedStatus) SetDeleting

func (c *ConditionedStatus) SetDeleting()

SetDeleting set creating as an active condition

func (*ConditionedStatus) SetFailed

func (c *ConditionedStatus) SetFailed(reason, msg string)

SetFailed set failed as an active condition

func (*ConditionedStatus) SetPending added in v0.2.0

func (c *ConditionedStatus) SetPending()

SetPending set pending as an active condition

func (*ConditionedStatus) SetReady

func (c *ConditionedStatus) SetReady()

SetReady set ready as an active condition

func (*ConditionedStatus) UnsetAllConditions

func (c *ConditionedStatus) UnsetAllConditions()

UnsetAllConditions set conditions status to false on all conditions

func (*ConditionedStatus) UnsetCondition

func (c *ConditionedStatus) UnsetCondition(conditionType ConditionType)

UnsetCondition set condition status to false with the given type - if found.

type ConditionedStatusMatcher

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

ConditionedStatusMatcher is a gomega matcher for ConditionedStatuses. +k8s:deepcopy-gen=false

func (*ConditionedStatusMatcher) FailureMessage

func (csm *ConditionedStatusMatcher) FailureMessage(actual interface{}) (message string)

FailureMessage is printed when conditioned statuses do not match.

func (*ConditionedStatusMatcher) Match

func (csm *ConditionedStatusMatcher) Match(actual interface{}) (success bool, err error)

Match returns true if the underlying conditioned status matches the supplied one.

func (*ConditionedStatusMatcher) NegatedFailureMessage

func (csm *ConditionedStatusMatcher) NegatedFailureMessage(actual interface{}) (message string)

NegatedFailureMessage is printed when conditioned statuses match unexpectedly.

type ReclaimPolicy

type ReclaimPolicy string

ReclaimPolicy describes a policy for end-of-life maintenance of storage resources

const (
	// ReclaimDelete means the cloud provider resource backing this custom resource (CR) will be deleted upon CR deletion
	ReclaimDelete ReclaimPolicy = "Delete"
	// ReclaimRetain means the cloud provider resource backing this custom resource (CR) will be will be left in its current phase upon CR deletion for manual reclamation by the administrator.
	// The default policy is Retain.
	ReclaimRetain ReclaimPolicy = "Retain"
)

type Resource

type Resource interface {
	runtime.Object
	// Resource connection secret name
	ConnectionSecretName() string
	// Kubernetes object reference to this resource
	ObjectReference() *corev1.ObjectReference
	// Is resource available for finding
	IsAvailable() bool
	// IsBound() bool
	IsBound() bool
	// Update bound status of the resource
	SetBound(bool)
}

Resource defines a concrete resource that can be provisioned and bound to a resource claim.

type ResourceClaim added in v0.2.0

type ResourceClaim interface {
	runtime.Object
	metav1.Object
	// The status of this resource claim
	ClaimStatus() *ResourceClaimStatus
	// Gets an owner reference that points to this claim
	OwnerReference() metav1.OwnerReference
	// Kubernetes object reference to this resource
	ObjectReference() *corev1.ObjectReference
	// Gets the reference to the resource class this claim uses
	ClassRef() *corev1.ObjectReference
	// Gets the reference to the resource that this claim is bound to
	ResourceRef() *corev1.ObjectReference
	// Sets the reference to the resource that this claim is bound to
	SetResourceRef(*corev1.ObjectReference)
}

ResourceClaim defines a resource claim that can be provisioned and bound to a concrete resource.

type ResourceClaimStatus added in v0.2.0

type ResourceClaimStatus struct {
	ConditionedStatus
	BindingStatusPhase

	// Provisioner is the driver that was used to provision the concrete resource
	// This is an optionally-prefixed name, like a label key.
	// For example: "RDSInstance.database.aws.crossplane.io/v1alpha1" or "CloudSQLInstance.database.gcp.crossplane.io/v1alpha1".
	Provisioner string `json:"provisioner,omitempty"`

	// CredentialsSecretRef is a local reference to the generated secret containing the credentials
	// for this resource claim.
	CredentialsSecretRef corev1.LocalObjectReference `json:"credentialsSecret,omitempty"`
}

ResourceClaimStatus represents the status of a resource claim

func (*ResourceClaimStatus) DeepCopy added in v0.2.0

func (in *ResourceClaimStatus) DeepCopy() *ResourceClaimStatus

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

func (*ResourceClaimStatus) DeepCopyInto added in v0.2.0

func (in *ResourceClaimStatus) DeepCopyInto(out *ResourceClaimStatus)

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

type ResourceClass

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

	// Parameters holds parameters for the provisioner.
	// These values are opaque to the  system and are passed directly
	// to the provisioner.  The only validation done on keys is that they are
	// not empty.  The maximum number of parameters is
	// 512, with a cumulative max size of 256K
	// +optional
	Parameters map[string]string `json:"parameters,omitempty"`

	// Provisioner is the driver expected to handle this ResourceClass.
	// This is an optionally-prefixed name, like a label key.
	// For example: "RDSInstance.database.aws.crossplane.io/v1alpha1" or "CloudSQLInstance.database.gcp.crossplane.io/v1alpha1".
	// This value may not be empty.
	Provisioner string `json:"provisioner"`

	// ProvierRef is the reference to cloud provider that will be used
	// to provision the concrete cloud resource
	ProviderRef corev1.LocalObjectReference `json:"providerRef"`

	// reclaimPolicy is the reclaim policy that dynamically provisioned
	// ResourceInstances of this resource class are created with
	// +optional
	ReclaimPolicy ReclaimPolicy `json:"reclaimPolicy,omitempty"`
}

ResourceClass is the Schema for the instances API +k8s:openapi-gen=true +kubebuilder:printcolumn:name="PROVISIONER",type="string",JSONPath=".provisioner" +kubebuilder:printcolumn:name="PROVIDER-REF",type="string",JSONPath=".providerRef.name" +kubebuilder:printcolumn:name="RECLAIM-POLICY",type="string",JSONPath=".reclaimPolicy" +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp"

func (*ResourceClass) DeepCopy

func (in *ResourceClass) DeepCopy() *ResourceClass

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

func (*ResourceClass) DeepCopyInto

func (in *ResourceClass) DeepCopyInto(out *ResourceClass)

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

func (*ResourceClass) DeepCopyObject

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

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

func (*ResourceClass) ObjectReference

func (r *ResourceClass) ObjectReference() *corev1.ObjectReference

ObjectReference to this mysql instance

type ResourceClassList

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

ResourceClassList contains a list of RDSInstance

func (*ResourceClassList) DeepCopy

func (in *ResourceClassList) DeepCopy() *ResourceClassList

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

func (*ResourceClassList) DeepCopyInto

func (in *ResourceClassList) DeepCopyInto(out *ResourceClassList)

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

func (*ResourceClassList) DeepCopyObject

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

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

type ResourceList

type ResourceList map[ResourceName]resource.Quantity

ResourceList is a set of (resource name, quantity) pairs.

func (ResourceList) DeepCopy

func (in ResourceList) DeepCopy() ResourceList

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

func (ResourceList) DeepCopyInto

func (in ResourceList) DeepCopyInto(out *ResourceList)

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

type ResourceName

type ResourceName string

ResourceName is the name identifying various resources in a ResourceList.

const (
	// CPU, in cores. (500m = .5 cores)
	ResourceCPU ResourceName = "cpu"
	// Memory, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)
	ResourceMemory ResourceName = "memory"
	// Volume size, in bytes (e,g. 5Gi = 5GiB = 5 * 1024 * 1024 * 1024)
	ResourceStorage ResourceName = "storage"
)

Resource names must be not more than 63 characters, consisting of upper- or lower-case alphanumeric characters, with the -, _, and . characters allowed anywhere, except the first or last character. The default convention, matching that for annotations, is to use lower-case names, with dashes, rather than camel case, separating compound words. Fully-qualified resource typenames are constructed from a DNS-style subdomain, followed by a slash `/` and a name.

Jump to

Keyboard shortcuts

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