K8sObject

com.coralogix.zio.k8s.client.model.K8sObject
See theK8sObject companion object
trait K8sObject[T]

Common operations for every Kubernetes resource's object

Type parameters

T

Kubernetes resource type

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

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

Value parameters

f

Function returning the modified metadata

Attributes

def metadata(obj: T): Optional[ObjectMeta]

Gets the metadata of the object

Gets the metadata of the object

Attributes

Concrete methods

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

Value parameters

kind

Owner's resource kind

obj

Object to attach the owner to

ownerName

Owner's name

ownerType

Owner's resource type

ownerUid

Owner's UID

Attributes

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)

Gets the generation of the object stored in its metadata or 0 if it is not present (the resource was not uploaded yet)

Attributes

Gets the metadata of the object or fails with UndefinedField if it is not present.

Gets the metadata of the object or fails with UndefinedField if it is not present.

Attributes

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.

Gets the name stored in the metadata of the object or fails with UndefinedField if it is not present.

Attributes

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.

Gets the UID stored in the metadata of the object or fails with UndefinedField if it is not present.

Attributes

def isOwnedBy[OwnerT : ResourceMetadata](obj: T)(owner: OwnerT): Boolean

Check if a resource is owned by an other one

Check if a resource is owned by an other one

Type parameters

OwnerT

Owner resource type

Value parameters

obj

Owned resource object to check

owner

Owner

Attributes

Returns

True if owner owns obj

def tryAttachOwner[OwnerT : ResourceMetadata](obj: T)(owner: 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.

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.

Attributes