types

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equals

func Equals(obj1, obj2 client.Object) bool

Equals is *NOT* a deep-equals. It will compare the name, namespace and GVK of the two objects. If both objects are nil, it will return true.

Types

type NamedObject

type NamedObject interface {
	GetName() string
	GetNamespace() string
}

type Object

type Object interface {
	client.Object
	GetConditions() []metav1.Condition
	SetCondition(metav1.Condition) bool
}

**Note:** Please have a look at [api-conventions](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) for the conventions around the `spec` and `status` fields.

Espectially regarding conditions, see [here](https://github.com/kubernetes/apimachinery/blob/release-1.23/pkg/apis/meta/v1/types.go#L1448)

type ObjectList

type ObjectList interface {
	client.ObjectList
	GetItems() []Object
}

type ObjectRef

type ObjectRef struct {
	Name      string    `json:"name"`
	Namespace string    `json:"namespace"`
	UID       types.UID `json:"uid,omitempty"`
}

ObjectRef is a reference to a Kubernetes object It is similar to types.NamespacedName but has the required json tags for serialization

func ObjectRefFromObject

func ObjectRefFromObject(obj client.Object) *ObjectRef

func (*ObjectRef) DeepCopy

func (o *ObjectRef) DeepCopy() *ObjectRef

func (*ObjectRef) DeepCopyInto

func (o *ObjectRef) DeepCopyInto(out *ObjectRef)

func (*ObjectRef) Equals

func (o *ObjectRef) Equals(other NamedObject) bool

func (*ObjectRef) GetName

func (o *ObjectRef) GetName() string

func (*ObjectRef) GetNamespace

func (o *ObjectRef) GetNamespace() string

func (*ObjectRef) IsEmpty

func (o *ObjectRef) IsEmpty() bool

IsEmpty returns true if both Name and Namespace are empty

func (*ObjectRef) K8s

func (o *ObjectRef) K8s() client.ObjectKey

func (ObjectRef) String

func (o ObjectRef) String() string

type TypedNamedObject

type TypedNamedObject interface {
	NamedObject
	GetKind() string
	GetAPIVersion() string
}

type TypedObjectRef

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

TypedObjectRef is a reference to a Kubernetes object with type information It is similar to ObjectRef but includes the Kind and APIVersion

func TypedObjectRefFromObject

func TypedObjectRefFromObject(obj client.Object, scheme *runtime.Scheme) *TypedObjectRef

func (*TypedObjectRef) DeepCopy

func (o *TypedObjectRef) DeepCopy() *TypedObjectRef

func (*TypedObjectRef) DeepCopyInto

func (o *TypedObjectRef) DeepCopyInto(out *TypedObjectRef)

func (*TypedObjectRef) Equals

func (o *TypedObjectRef) Equals(other TypedNamedObject) bool

func (*TypedObjectRef) GetAPIVersion

func (o *TypedObjectRef) GetAPIVersion() string

func (*TypedObjectRef) GetKind

func (o *TypedObjectRef) GetKind() string

func (*TypedObjectRef) String

func (o *TypedObjectRef) String() string

Jump to

Keyboard shortcuts

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