trait K8sObject[T] extends AnyRef
Common operations for every Kubernetes resource's object
- T
Kubernetes resource type
- Alphabetic
- By Inheritance
- K8sObject
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
mapMetadata(f: (ObjectMeta) ⇒ ObjectMeta)(r: T): T
Maps the metadata of the object, constructing a new object with the modified metadata
Maps the metadata of the object, constructing a new object with the modified metadata
- f
Function returning the modified metadata
-
abstract
def
metadata(obj: T): Optional[ObjectMeta]
Gets the metadata of the object
Concrete Value Members
-
def
attachOwner(obj: T)(ownerName: String, ownerUid: String, ownerType: K8sResourceType, kind: String): T
Attach another Kubernetes resource as the owner of the given one
Attach another Kubernetes resource as the owner of the given one
- obj
Object to attach the owner to
- ownerName
Owner's name
- ownerUid
Owner's UID
- ownerType
Owner's resource type
- kind
Owner's resource kind
- returns
The modified object with the attached owner
-
def
generation(obj: T): Long
Gets the generation of the object stored in its metadata or 0 if it is not present (the resource was not uploaded yet)
-
def
getMetadata(obj: T): IO[K8sFailure, ObjectMeta]
Gets the metadata of the object or fails with UndefinedField if it is not present.
-
def
getName(obj: T): IO[K8sFailure, String]
Gets the name stored in the metadata of the object or fails with UndefinedField if it is not present.
-
def
getUid(obj: T): IO[K8sFailure, String]
Gets the UID stored in the metadata of the object or fails with UndefinedField if it is not present.
-
def
isOwnedBy[OwnerT](obj: T)(owner: OwnerT)(implicit arg0: K8sObject[OwnerT], arg1: ResourceMetadata[OwnerT]): Boolean
Check if a resource is owned by an other one
Check if a resource is owned by an other one
- OwnerT
Owner resource type
- obj
Owned resource object to check
- owner
Owner
- returns
True if owner owns obj
-
def
tryAttachOwner[OwnerT](obj: T)(owner: OwnerT)(implicit arg0: K8sObject[OwnerT], arg1: ResourceMetadata[OwnerT]): IO[K8sFailure, T]
Try to attachOwner another Kubernetes resource as the owner of the given one, can fail with UndefinedField if some of the metadata fields are not present.