shared

package
v0.0.0-...-cfb26ff Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package shared contains structs used by various API groups +k8s:deepcopy-gen=package,register +groupName=operators.coreos.com

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureFinalizer

func EnsureFinalizer(objectMeta *metav1.ObjectMeta, expectedFinalizer string)

EnsureFinalizer ensures that the object's finalizer is included in the ObjectMeta Finalizers slice. If it already exists, no state change occurs. If it doesn't, the finalizer is appended to the slice.

func GetWatchNamespace

func GetWatchNamespace() (string, error)

GetWatchNamespace returns the Namespace the operator should be watching for changes Note: the marketplace-operator YAML manifest deployed by the CVO specifies the $WATCH_NAMESPACE as an environment variable using the downward API. Source: https://sdk.operatorframework.io/docs/building-operators/golang/operator-scope/

func HasFinalizer

func HasFinalizer(objectMeta *metav1.ObjectMeta, expectedFinalizer string) bool

HasFinalizer checks to see if the finalizer exists in the object's ObjectMeta.

func IsObjectInOtherNamespace

func IsObjectInOtherNamespace(namespace string) (bool, error)

IsObjectInOtherNamespace returns true if the namespace is not the watched namespace of the operator. An false, error will be returned if there was an error getting the watched namespace.

func RemoveFinalizer

func RemoveFinalizer(objectMeta *metav1.ObjectMeta, deletingFinalizer string)

RemoveFinalizer removes the finalizer from the object's ObjectMeta.

Types

type ObjectPhase

type ObjectPhase struct {
	// Current phase of the object
	Phase `json:"phase,omitempty"`

	// Last time the object has transitioned from one phase to another
	LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`

	// Last time the status of the object was updated
	LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"`
}

ObjectPhase describes the phase of a Marketplace object is in along with the last time a phase transition occurred and when the object was last updated

func (*ObjectPhase) DeepCopy

func (in *ObjectPhase) DeepCopy() *ObjectPhase

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

func (*ObjectPhase) DeepCopyInto

func (in *ObjectPhase) DeepCopyInto(out *ObjectPhase)

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

type Phase

type Phase struct {
	// Name of the phase
	Name string `json:"name,omitempty"`

	// A human readable message indicating why the object is in this phase
	Message string `json:"message,omitempty"`
}

Phase describes the phase the object is in

func NewPhase

func NewPhase(name string, message string) *Phase

NewPhase returns a Phase object with the given name and message

func (*Phase) DeepCopy

func (in *Phase) DeepCopy() *Phase

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

func (*Phase) DeepCopyInto

func (in *Phase) DeepCopyInto(out *Phase)

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