Documentation ¶
Overview ¶
Package v1 is the package for the types used in Seed resources +k8s:deepcopy-gen=package +k8s:openapi-gen=true
Index ¶
- Constants
- func EmitStatusEvent(ctx rcontext.Context, obj runtime.Object) error
- func EnsureFinalizer(obj runtime.Object, name string) bool
- func EnsureFinalizerAndPut(ctx rcontext.Context, client client.Client, obj runtime.Object, ...) error
- func HasFinalizer(obj runtime.Object, name string) bool
- func Kind(obj runtime.Object) string
- func ObjectMeta(obj runtime.Object) metav1.Object
- func PutAndEmit(ctx rcontext.Context, obj runtime.Object) error
- func PutStatusAndEmit(ctx rcontext.Context, obj runtime.Object) error
- func RemoveCondition(obj runtime.Object, condType string) runtime.Object
- func RemoveFinalizer(obj runtime.Object, name string) bool
- func RemoveFinalizerAndPut(ctx rcontext.Context, obj runtime.Object, finalizer string) error
- func SeedGeneration(obj runtime.Object) int64
- func SetCondition(obj runtime.Object, condition *Condition) runtime.Object
- func SetStatus(obj runtime.Object, state string, format string, a ...interface{}) runtime.Object
- type Condition
- type Resource
- type ResourceList
- type ResourceStatus
- func (in *ResourceStatus) DeepCopy() *ResourceStatus
- func (in *ResourceStatus) DeepCopyInto(out *ResourceStatus)
- func (r *ResourceStatus) GetMessage() string
- func (r *ResourceStatus) GetState() string
- func (r *ResourceStatus) GetStatus() Status
- func (r *ResourceStatus) SetMessage(message string)
- func (r *ResourceStatus) SetState(state string)
- type Spec
- type Status
- type StatusAccessor
Constants ¶
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 ¶
EmitStatusEvent creates an event representing the current object status
func EnsureFinalizer ¶
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 ¶
HasFinalizer returns true if the resource has the given finalizer name
func ObjectMeta ¶
ObjectMeta gets the resource ObjectMeta field
func PutAndEmit ¶
PutAndEmit updates the object stus on the server and emits an event (on the same server) recording current object state
func PutStatusAndEmit ¶
PutStatusAndEmit updates the object status on the server and emits an event (on the same server) recording current object state
func RemoveCondition ¶
RemoveCondition removes the condition with the provided type.
func RemoveFinalizer ¶
RemoveFinalizer clears the given finalizer from the list of the obj finalizers. Return true if finalizer has been removed
func RemoveFinalizerAndPut ¶
RemoveFinalizerAndPut removes finalizer from obj (if present). Update obj and server when needed
func SeedGeneration ¶
SeedGeneration gets the resource generation
func SetCondition ¶
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.
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 ¶
Conditions returns resource list of conditions
func GetCondition ¶
GetCondition returns the condition with the provided type.
func (*Condition) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.
func (*Condition) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Resource ¶
Resource is the base struct for custom resources +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +genclient
func (*Resource) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Resource.
func (*Resource) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Resource) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ResourceList ¶
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Spec.
func (*Spec) DeepCopyInto ¶
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
type StatusAccessor ¶
type StatusAccessor interface {
GetStatus() Status
}
StatusAccessor gets access to Status