v1

package
v0.1.11 Latest Latest
Warning

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

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

Documentation

Overview

Package v1 is the package for the types used in Seed resources +k8s:deepcopy-gen=package +k8s:openapi-gen=true

Index

Constants

View Source
const (
	// ResourceStateCreated indicates a resource is in a created state
	ResourceStateCreated string = "Created"
	// ResourceStatePending indicates a resource is in a pending state
	ResourceStatePending string = "Pending"
	// ResourceStateStopped indicates a resource is in a running state
	ResourceStateStopped string = "Stopped"
	// ResourceStateFailed indicates a resource is in a failed state
	ResourceStateFailed string = "Failed"
	// ResourceStateUnknown indicates a resource is in a unknown state
	ResourceStateUnknown string = "Unknown"
	// ResourceStateDeleting indicates a resource is being deleted
	ResourceStateDeleting string = "Deleting"
	// ResourceStateOnline indicates a resource has been fully synchronized and online
	ResourceStateOnline string = "Online"
	// ResourceStateWaiting indicates a resource is in a waiting state, e.g. waiting for dependencies
	ResourceStateWaiting string = "Waiting"
	// ResourceStateRetrying indicates a resource failed to provision for external reasons. Retrying later on.
	ResourceStateRetrying string = "Retrying"
	// ResourceStateBinding indicates a resource such as a cloud service is being bound
	ResourceStateBinding string = "Binding"
)

Variables

This section is empty.

Functions

func EmitStatusEvent

func EmitStatusEvent(ctx rcontext.Context, obj runtime.Object) error

EmitStatusEvent creates an event representing the current object status

func EnsureFinalizer

func EnsureFinalizer(obj runtime.Object, name string) bool

EnsureFinalizer makes sure the given object has the given finalizer. Return true if finalizer has been added

func EnsureFinalizerAndPut

func EnsureFinalizerAndPut(ctx rcontext.Context, client client.Client, obj runtime.Object, finalizer string) error

EnsureFinalizerAndPut makes sure obj contains finalizer. If not update obj and server

func HasFinalizer

func HasFinalizer(obj runtime.Object, name string) bool

HasFinalizer returns true if the resource has the given finalizer name

func Kind

func Kind(obj runtime.Object) string

Kind gets the resource kind

func ObjectMeta

func ObjectMeta(obj runtime.Object) metav1.Object

ObjectMeta gets the resource ObjectMeta field

func PutAndEmit

func PutAndEmit(ctx rcontext.Context, obj runtime.Object) error

PutAndEmit updates the object stus on the server and emits an event (on the same server) recording current object state

func PutStatusAndEmit

func PutStatusAndEmit(ctx rcontext.Context, obj runtime.Object) error

PutStatusAndEmit updates the object status on the server and emits an event (on the same server) recording current object state

func RemoveCondition

func RemoveCondition(obj runtime.Object, condType string) runtime.Object

RemoveCondition removes the condition with the provided type.

func RemoveFinalizer

func RemoveFinalizer(obj runtime.Object, name string) bool

RemoveFinalizer clears the given finalizer from the list of the obj finalizers. Return true if finalizer has been removed

func RemoveFinalizerAndPut

func RemoveFinalizerAndPut(ctx rcontext.Context, obj runtime.Object, finalizer string) error

RemoveFinalizerAndPut removes finalizer from obj (if present). Update obj and server when needed

func SeedGeneration

func SeedGeneration(obj runtime.Object) int64

SeedGeneration gets the resource generation

func SetCondition

func SetCondition(obj runtime.Object, condition *Condition) runtime.Object

SetCondition updates the resource condition to include the provided condition. If the condition that we are about to add already exists and has the same status then we are not going to update.

func SetStatus

func SetStatus(obj runtime.Object, state string, format string, a ...interface{}) runtime.Object

SetStatus updates the object status. Returns the same object to enable call chaining

Types

type Condition

type Condition struct {
	// Type of condition, e.g Complete or Failed.
	Type string `json:"type"`
	// Status of the condition, one of True, False, Unknown.
	Status corev1.ConditionStatus `json:"status"`
	// The last time the condition transitioned from one status to another.
	// +optional
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"`
	// The reason for the condition's last transition.
	// +optional
	Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"`
	// A human readable message indicating details about the transition.
	// +optional
	Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"`
}

Condition is the base struct for representing resource conditions

func Conditions

func Conditions(obj runtime.Object) []Condition

Conditions returns resource list of conditions

func GetCondition

func GetCondition(obj runtime.Object, condType string) *Condition

GetCondition returns the condition with the provided type.

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.

type Resource

type Resource struct {
	metav1.TypeMeta `json:",inline"`
}

Resource is the base struct for custom resources +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +genclient

func (*Resource) DeepCopy

func (in *Resource) DeepCopy() *Resource

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

func (*Resource) DeepCopyInto

func (in *Resource) DeepCopyInto(out *Resource)

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

func (*Resource) DeepCopyObject

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

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

type ResourceList

type ResourceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`
}

ResourceList is the base struct for custom list types +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

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.

func (*ResourceList) DeepCopyObject

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

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

type ResourceStatus

type ResourceStatus struct {
	State   string `json:"state,omitempty"`
	Message string `json:"message,omitempty"`
}

ResourceStatus defines the status for each resource

func (*ResourceStatus) DeepCopy

func (in *ResourceStatus) DeepCopy() *ResourceStatus

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

func (*ResourceStatus) DeepCopyInto

func (in *ResourceStatus) DeepCopyInto(out *ResourceStatus)

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

func (*ResourceStatus) GetMessage

func (r *ResourceStatus) GetMessage() string

func (*ResourceStatus) GetState

func (r *ResourceStatus) GetState() string

func (*ResourceStatus) GetStatus

func (r *ResourceStatus) GetStatus() Status

func (*ResourceStatus) SetMessage

func (r *ResourceStatus) SetMessage(message string)

func (*ResourceStatus) SetState

func (r *ResourceStatus) SetState(state string)

type Spec

type Spec struct {
}

Spec provides embeddable Spec

func (*Spec) DeepCopy

func (in *Spec) DeepCopy() *Spec

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

func (*Spec) DeepCopyInto

func (in *Spec) DeepCopyInto(out *Spec)

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

type Status

type Status interface {
	GetState() string
	SetState(state string)
	GetMessage() string
	SetMessage(message string)
}

Status represent a minimal set of status state

func GetStatus

func GetStatus(obj runtime.Object) Status

GetStatus gets the resource status field (if any)

type StatusAccessor

type StatusAccessor interface {
	GetStatus() Status
}

StatusAccessor gets access to Status

Jump to

Keyboard shortcuts

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