trait K8sObjectOps[T] extends AnyRef
Extension methods for Kubernetes resources
This is a common implementation for all the implicit classes providing extension methods for the generated Kuberentes model types. The extension methods are just delegating the calls to the resource's K8sObject implementation.
- T
Resource type to be extended
- Alphabetic
- By Inheritance
- K8sObjectOps
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Concrete Value Members
-
def
attachOwner(ownerName: String, ownerUid: String, ownerType: K8sResourceType, kind: String): T
Attach another resource as the owner of this one
Attach another resource as the owner of this one
- ownerName
Owner's name
- ownerUid
Owner's UID
- ownerType
Owner's resource type metadata
- kind
Owner's resource kind
- returns
Object with the attached owner described in its metadata
-
def
generation: Long
Gets the geneation of the object or 0 if it is new
-
def
getMetadata: IO[K8sFailure, ObjectMeta]
Gets the metadata of the object and fail with com.coralogix.zio.k8s.client.UndefinedField if it is not present
-
def
getName: IO[K8sFailure, String]
Gets the name of the object and fail with com.coralogix.zio.k8s.client.UndefinedField if it is not present
-
def
getUid: IO[K8sFailure, String]
Gets the UID of the object and fail with com.coralogix.zio.k8s.client.UndefinedField if it is not present
-
def
isOwnedBy[OwnerT](owner: OwnerT)(implicit arg0: K8sObject[OwnerT], arg1: ResourceMetadata[OwnerT]): Boolean
Verifies ownership between the resources
Verifies ownership between the resources
- OwnerT
Type of the owner resource
- owner
Possible owner of this resource
- returns
True if owner owns this resource
-
def
mapMetadata(f: (ObjectMeta) ⇒ ObjectMeta): T
Creates a new object with its metadata modified by the given function f
Creates a new object with its metadata modified by the given function f
- f
Function to modify the object's metadata with
- returns
Object with modified metadata
-
def
metadata: Optional[ObjectMeta]
Gets the metadata of the object
-
def
tryAttachOwner[OwnerT](owner: OwnerT)(implicit arg0: K8sObject[OwnerT], arg1: ResourceMetadata[OwnerT]): IO[K8sFailure, T]
Tries to attach another resource as the owner of this one.
Tries to attach another resource as the owner of this one. Can fail with com.coralogix.zio.k8s.client.UndefinedField if the owner does not have all the required metadata.
- OwnerT
Type of the owner
- owner
Owner resource
- returns
Object with the attached owner described in its metadata