public interface HasMetadata extends KubernetesResource
KubernetesResource which possesses a ObjectMeta and is associated with a kind and API version.| Modifier and Type | Field and Description |
|---|---|
static String |
DNS_LABEL_END |
static String |
DNS_LABEL_REGEXP |
static String |
DNS_LABEL_START |
static Pattern |
FINALIZER_NAME_MATCHER
Pattern that checks the format of finalizer identifiers, which should be in
<domain name>/<finalizer name> format. |
| Modifier and Type | Method and Description |
|---|---|
default boolean |
addFinalizer(String finalizer)
Adds the specified finalizer to this
HasMetadata if it's valid. |
String |
getApiVersion() |
String |
getKind() |
ObjectMeta |
getMetadata() |
default boolean |
hasFinalizer(String finalizer)
Determines whether this
HasMetadata holds the specified finalizer. |
default boolean |
isFinalizerValid(String finalizer)
Determines whether the specified finalizer is valid according to the
finalizer specification.
|
default boolean |
isMarkedForDeletion()
Determines whether this
HasMetadata is marked for deletion or not. |
default boolean |
removeFinalizer(String finalizer)
Removes the specified finalizer if it's held by this
HasMetadata. |
void |
setApiVersion(String version) |
void |
setMetadata(ObjectMeta metadata) |
static final String DNS_LABEL_START
static final String DNS_LABEL_END
static final String DNS_LABEL_REGEXP
static final Pattern FINALIZER_NAME_MATCHER
<domain name>/<finalizer name> format.ObjectMeta getMetadata()
void setMetadata(ObjectMeta metadata)
String getKind()
String getApiVersion()
void setApiVersion(String version)
default boolean isMarkedForDeletion()
HasMetadata is marked for deletion or not.true if the cluster marked this HasMetadata for deletion, false otherwisedefault boolean hasFinalizer(String finalizer)
HasMetadata holds the specified finalizer.finalizer - the identifier of the finalizer we want to checktrue if this HasMetadata holds the specified finalizer, false otherwisedefault boolean addFinalizer(String finalizer)
HasMetadata if it's valid. See isFinalizerValid(String).finalizer - the identifier of the finalizer to add to this HasMetadata in <domain name>/<finalizer name> format.true if the finalizer was successfully added, false otherwise (in particular, if the object is marked for deletion)IllegalArgumentException - if the specified finalizer identifier is null or is invaliddefault boolean isFinalizerValid(String finalizer)
finalizer - the identifier of the finalizer which validity we want to checktrue if the identifier is valid, false otherwisedefault boolean removeFinalizer(String finalizer)
HasMetadata.finalizer - the identifier of the finalizer we want to removetrue if the finalizer was successfully removed, false otherwiseCopyright © 2015–2020 Red Hat. All rights reserved.