public class BaseOperation<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>,R extends Resource<T>> extends CreateOnlyResourceOperation<T,T> implements OperationInfo, MixedOperation<T,L,R>, Resource<T>, ListerWatcher<T,L>
Modifier and Type | Field and Description |
---|---|
protected String |
apiVersion |
protected Class<L> |
listType |
type
apiGroupName, apiGroupVersion, config, context, dryRun, httpClient, JSON, JSON_MAPPER, JSON_MERGE_PATCH, JSON_PATCH, name, namespace, resourceT, STRATEGIC_MERGE_JSON_PATCH, YAML_MAPPER
DEFAULT_BACKOFF_MULTIPLIER, DEFAULT_INITIAL_BACKOFF_MILLIS
Modifier | Constructor and Description |
---|---|
protected |
BaseOperation(OperationContext ctx) |
Modifier and Type | Method and Description |
---|---|
T |
accept(Consumer<T> consumer)
Issues a JSON patch against the item based upon the changes made by the function provided as argument
|
static URL |
appendListOptionParams(URL base,
io.fabric8.kubernetes.api.model.ListOptions listOptions) |
EditReplacePatchDeletable<T> |
cascading(boolean cascading)
deletes dependent resources.
|
T |
createOrReplace(T... items)
Creates a provided resource in a Kubernetes Cluster.
|
Boolean |
delete()
Deletes resource and all managed resources, returns null or false if not found.
|
Boolean |
delete(List<T> items) |
Boolean |
delete(T... items) |
WritableOperation<T> |
dryRun(boolean isDryRun)
Indicates whether modifications should not be persisted or not.
|
<V> T |
edit(Class<V> visitorType,
io.fabric8.kubernetes.api.builder.Visitor<V> visitor)
Issues a JSON patch against the item based upon the changes made to the object by the visitor.
|
T |
edit(UnaryOperator<T> function)
Issues a JSON patch against the item based upon the changes made to the object returned by the function.
|
T |
edit(io.fabric8.kubernetes.api.builder.Visitor... visitors)
Issues a JSON patch against the item based upon the changes made to the object by the visitors.
|
T |
editStatus(UnaryOperator<T> function) |
protected URL |
fetchListUrl(URL url,
io.fabric8.kubernetes.api.model.ListOptions listOptions) |
OperationInfo |
forOperationType(String type) |
Gettable<T> |
fromServer() |
T |
get() |
protected Class<? extends Config> |
getConfigType() |
String |
getFieldQueryParam() |
Long |
getGracePeriodSeconds() |
String |
getGroup() |
T |
getItem() |
String |
getKind() |
String |
getLabelQueryParam() |
Class<L> |
getListType() |
T |
getMandatory() |
String |
getOperationType() |
String |
getPlural() |
io.fabric8.kubernetes.api.model.DeletionPropagation |
getPropagationPolicy() |
Readiness |
getReadiness() |
String |
getResourceVersion() |
String |
getVersion() |
protected T |
handleCreate(T resource) |
protected io.fabric8.kubernetes.api.model.Status |
handleDeploymentRollback(io.fabric8.kubernetes.api.model.extensions.DeploymentRollback deploymentRollback) |
protected T |
handleGet(URL resourceUrl) |
protected T |
handlePatch(PatchContext context,
T current,
T updated,
boolean status) |
protected T |
handlePatch(T current,
Map<String,Object> patchedUpdate) |
protected T |
handleResponse(HttpRequest.Builder requestBuilder) |
protected io.fabric8.kubernetes.api.model.autoscaling.v1.Scale |
handleScale(io.fabric8.kubernetes.api.model.autoscaling.v1.Scale scaleParam) |
protected T |
handleUpdate(T updated,
boolean status) |
NonNamespaceOperation<T,L,R> |
inAnyNamespace() |
SharedIndexInformer<T> |
inform(ResourceEventHandler<? super T> handler,
long resync)
Similar to a
Watch , but will attempt to handle failures after successfully started. |
CompletableFuture<List<T>> |
informOnCondition(Predicate<List<T>> condition)
|
NonNamespaceOperation<T,L,R> |
inNamespace(String namespace) |
Boolean |
isCascading() |
boolean |
isReady()
Check if the resource is ready.
|
Boolean |
isReloadingFromServer() |
boolean |
isResourceNamespaced() |
L |
list() |
L |
list(Integer limitVal,
String continueVal)
List resources from APIServer.
|
L |
list(io.fabric8.kubernetes.api.model.ListOptions listOptions)
List resource from Kubernetes API server.
|
R |
load(File file)
Load from a
File . |
R |
load(InputStream is)
Load from an
InputStream . |
R |
load(String path)
Load from path.
|
R |
load(URL url)
Load from a
URL . |
ReplaceDeletable<T> |
lockResourceVersion(String resourceVersion) |
BaseOperation<T,L,R> |
newInstance(OperationContext context) |
T |
patch(PatchContext patchContext,
String patch)
Update field(s) of a resource using type specified in
PatchContext (defaults to strategic merge if not specified). |
T |
patch(PatchContext patchContext,
T item)
Update field(s) of a resource using type specified in
PatchContext (defaults to strategic merge if not specified). |
T |
patchStatus(T item)
Does a PATCH request to the /status subresource ignoring changes to anything except the status stanza.
|
T |
replace(T item)
Replace the server's state with the given item.
|
T |
replaceStatus(T item)
Similar to
Replaceable.replace(Object) , but only affects the status subresource |
T |
require() |
SharedIndexInformer<T> |
runnableInformer(long resync)
Similar to a
Watch , but will attempt to handle failures after successfully started. |
protected T |
sendPatchedObject(T oldObject,
T updatedObject) |
void |
setListType(Class<L> listType) |
void |
setNamespace(String namespace) |
void |
setType(Class<T> type) |
protected void |
updateApiVersion(io.fabric8.kubernetes.api.model.HasMetadata hasMetadata)
Updates the resource if it has missing or default apiGroupVersion values and the resource is currently
using API Groups with custom version strings
|
protected void |
updateApiVersion(io.fabric8.kubernetes.api.model.KubernetesResourceList<T> list)
Updates the list items if they have missing or default apiGroupVersion values and the resource is currently
using API Groups with custom version strings
|
T |
updateStatus(T item)
When the status subresource is enabled, the /status subresource for the custom resource is exposed.
|
T |
waitUntilCondition(Predicate<T> condition,
long amount,
TimeUnit timeUnit) |
T |
waitUntilReady(long amount,
TimeUnit timeUnit) |
Watch |
watch(io.fabric8.kubernetes.api.model.ListOptions options,
Watcher<T> watcher)
Watch returns
Watch interface that watches requested resource |
Watch |
watch(String resourceVersion,
Watcher<T> watcher)
Watch returns
Watch interface that watches requested resource from
specified resourceVersion |
Watch |
watch(Watcher<T> watcher)
Watch returns
Watch interface that watches requested resource |
FilterWatchListDeletable<T,L> |
withField(String key,
String value) |
FilterWatchListDeletable<T,L> |
withFields(Map<String,String> fields) |
FilterWatchListDeletable<T,L> |
withGracePeriod(long gracePeriodSeconds)
The duration in seconds before the object should be deleted.
|
Informable<T> |
withIndexers(Map<String,Function<T,List<String>>> indexers)
The indexers to add to
SharedInformer s created by subsequent inform calls; |
FilterWatchListDeletable<T,L> |
withInvolvedObject(io.fabric8.kubernetes.api.model.ObjectReference objectReference)
Filter with the object that this event is about.
|
BaseOperation<T,L,R> |
withItem(T item) |
FilterWatchListDeletable<T,L> |
withLabel(String key,
String value) |
FilterWatchListDeletable<T,L> |
withLabelIn(String key,
String... values) |
FilterWatchListDeletable<T,L> |
withLabelNotIn(String key,
String... values) |
FilterWatchListDeletable<T,L> |
withLabels(Map<String,String> labels) |
FilterWatchListDeletable<T,L> |
withLabelSelector(io.fabric8.kubernetes.api.model.LabelSelector selector) |
FilterWatchListDeletable<T,L> |
withLabelSelector(String selectorAsString) |
R |
withName(String name) |
FilterNested<FilterWatchListDeletable<T,L>> |
withNewFilter()
Accumulate a filter on the context, when done
FilterNested.endFilter() or and must be called |
FilterWatchListDeletable<T,L> |
withoutField(String key,
String value) |
FilterWatchListDeletable<T,L> |
withoutFields(Map<String,String> fields) |
FilterWatchListDeletable<T,L> |
withoutLabel(String key,
String value) |
FilterWatchListDeletable<T,L> |
withoutLabels(Map<String,String> labels) |
EditReplacePatchDeletable<T> |
withPropagationPolicy(io.fabric8.kubernetes.api.model.DeletionPropagation propagationPolicy)
Whether and how garbage collection will be performed.
|
BaseOperation<T,L,R> |
withResourceVersion(String resourceVersion) |
BaseOperation<T,L,R> |
withWaitRetryBackoff(long initialBackoff,
TimeUnit backoffUnit,
double backoffMultiplier)
Configure the backoff strategy to use when waiting for conditions, in case the watcher encounters a retryable error.
|
create, create, getType
assertResponseCode, checkName, checkNamespace, createStatus, createStatus, getAPIGroupName, getAPIGroupVersion, getConfig, getName, getNamespace, getNamespacedUrl, getNamespacedUrl, getNamespacedUrl, getObjectValueAsMap, getResourceT, getResourceUrl, getResourceUrl, getResourceUrl, getResourceURLForPatchOperation, getResourceURLForWriteOperation, getRootUrl, handleCreate, handleDelete, handleDelete, handleDeploymentRollback, handleGet, handleGet, handleMetric, handlePatch, handlePatch, handlePatch, handleRawGet, handleResponse, handleResponse, handleResponse, handleResponse, handleScale, handleUpdate, handleUpdate, requestException, requestException, requestFailure, requestFailure, restCall, retryWithExponentialBackoff, unmarshal, unmarshal, unmarshal
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFullResourceName, getName, getNamespace
withLabel, withoutLabel
inform, inform
create, create
dryRun
getNamespace
protected String apiVersion
protected BaseOperation(OperationContext ctx)
public BaseOperation<T,L,R> newInstance(OperationContext context)
protected URL fetchListUrl(URL url, io.fabric8.kubernetes.api.model.ListOptions listOptions)
public T get()
public T require()
require
in interface Requirable<T extends io.fabric8.kubernetes.api.model.HasMetadata>
public T getMandatory()
public T edit(UnaryOperator<T> function)
Editable
It is generally convenient to use a Builder constructed off of the item.
public T editStatus(UnaryOperator<T> function)
editStatus
in interface StatusEditable<T extends io.fabric8.kubernetes.api.model.HasMetadata>
public T edit(io.fabric8.kubernetes.api.builder.Visitor... visitors)
Editable
public <V> T edit(Class<V> visitorType, io.fabric8.kubernetes.api.builder.Visitor<V> visitor)
Editable
public T accept(Consumer<T> consumer)
Editable
public ReplaceDeletable<T> lockResourceVersion(String resourceVersion)
lockResourceVersion
in interface Lockable<ReplaceDeletable<T extends io.fabric8.kubernetes.api.model.HasMetadata>>
public NonNamespaceOperation<T,L,R> inNamespace(String namespace)
inNamespace
in interface Namespaceable<NonNamespaceOperation<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>,R extends Resource<T>>>
public NonNamespaceOperation<T,L,R> inAnyNamespace()
inAnyNamespace
in interface AnyNamespaceable<FilterWatchListMultiDeletable<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>>>
public EditReplacePatchDeletable<T> cascading(boolean cascading)
Cascading
cascading
in interface Cascading<EditReplacePatchDeletable<T extends io.fabric8.kubernetes.api.model.HasMetadata>>
cascading
- whether dependents should be orphaned or not.public R load(InputStream is)
Loadable
InputStream
.public Gettable<T> fromServer()
fromServer
in interface FromServerable<Gettable<T extends io.fabric8.kubernetes.api.model.HasMetadata>>
@SafeVarargs public final T createOrReplace(T... items)
CreateOrReplaceable
createOrReplace
in interface CreateOrReplaceable<T extends io.fabric8.kubernetes.api.model.HasMetadata>
items
- to create or replacepublic FilterWatchListDeletable<T,L> withLabels(Map<String,String> labels)
withLabels
in interface Filterable<FilterWatchListDeletable<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>>>
public FilterWatchListDeletable<T,L> withLabelSelector(io.fabric8.kubernetes.api.model.LabelSelector selector)
withLabelSelector
in interface Filterable<FilterWatchListDeletable<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>>>
public FilterWatchListDeletable<T,L> withoutLabels(Map<String,String> labels)
withoutLabels
in interface Filterable<FilterWatchListDeletable<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>>>
public FilterWatchListDeletable<T,L> withLabelIn(String key, String... values)
withLabelIn
in interface Filterable<FilterWatchListDeletable<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>>>
public FilterWatchListDeletable<T,L> withLabelNotIn(String key, String... values)
withLabelNotIn
in interface Filterable<FilterWatchListDeletable<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>>>
public FilterWatchListDeletable<T,L> withLabel(String key, String value)
withLabel
in interface Filterable<FilterWatchListDeletable<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>>>
public FilterWatchListDeletable<T,L> withoutLabel(String key, String value)
withoutLabel
in interface Filterable<FilterWatchListDeletable<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>>>
public FilterWatchListDeletable<T,L> withLabelSelector(String selectorAsString)
withLabelSelector
in interface Filterable<FilterWatchListDeletable<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>>>
public FilterWatchListDeletable<T,L> withFields(Map<String,String> fields)
withFields
in interface Filterable<FilterWatchListDeletable<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>>>
public FilterWatchListDeletable<T,L> withField(String key, String value)
withField
in interface Filterable<FilterWatchListDeletable<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>>>
public FilterWatchListDeletable<T,L> withInvolvedObject(io.fabric8.kubernetes.api.model.ObjectReference objectReference)
Filterable
withInvolvedObject
in interface Filterable<FilterWatchListDeletable<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>>>
objectReference
- ObjectReference
for providing information of referred objectpublic FilterNested<FilterWatchListDeletable<T,L>> withNewFilter()
FilterWatchListDeletable
FilterNested.endFilter()
or and must be calledwithNewFilter
in interface FilterWatchListDeletable<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>>
FilterNested
public FilterWatchListDeletable<T,L> withoutFields(Map<String,String> fields)
withoutFields
in interface Filterable<FilterWatchListDeletable<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>>>
public FilterWatchListDeletable<T,L> withoutField(String key, String value)
withoutField
in interface Filterable<FilterWatchListDeletable<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>>>
public String getFieldQueryParam()
public String getLabelQueryParam()
public L list()
public L list(Integer limitVal, String continueVal)
Listable
public L list(io.fabric8.kubernetes.api.model.ListOptions listOptions)
Listable
The passed in options may be modified as a side-effect of this call.
Values that already exist at this context, such as the labels and fields will be overridden
on the passed in options regardless of initial values.
public Boolean delete()
Deletable
@SafeVarargs public final Boolean delete(T... items)
delete
in interface MultiDeleteable<T extends io.fabric8.kubernetes.api.model.HasMetadata>
public Boolean delete(List<T> items)
delete
in interface MultiDeleteable<T extends io.fabric8.kubernetes.api.model.HasMetadata>
public T updateStatus(T item)
StatusUpdatable
updateStatus
in interface StatusUpdatable<T extends io.fabric8.kubernetes.api.model.HasMetadata>
item
- kubernetes objectpublic T patchStatus(T item)
StatusPatchable
This method has the same patching behavior as Patchable.patch(PatchContext, Object)
, with PatchType.JSON_MERGE
but against the status subresource.
Set the resourceVersion to null to prevent optimistic locking.
patchStatus
in interface StatusPatchable<T extends io.fabric8.kubernetes.api.model.HasMetadata>
item
- kubernetes objectpublic BaseOperation<T,L,R> withItem(T item)
public BaseOperation<T,L,R> withResourceVersion(String resourceVersion)
withResourceVersion
in interface Versionable<WatchAndWaitable<T extends io.fabric8.kubernetes.api.model.HasMetadata>>
public Watch watch(Watcher<T> watcher)
Watchable
Watch
interface that watches requested resourcepublic Watch watch(String resourceVersion, Watcher<T> watcher)
Watchable
Watch
interface that watches requested resource from
specified resourceVersionpublic Watch watch(io.fabric8.kubernetes.api.model.ListOptions options, Watcher<T> watcher)
Watchable
Watch
interface that watches requested resource
The passed in options may be modified as a side-effect of this call.
Values that already exist at this context, such as the labels, fields,
and resourceVersion will be overridden on the passed in options regardless of initial values.
watch
in interface Watchable<Watcher<T extends io.fabric8.kubernetes.api.model.HasMetadata>>
watch
in interface ListerWatcher<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>>
options
- options available for watch operationwatcher
- Watcher interface of Kubernetes resourceWatch
public T replace(T item)
Replaceable
If Lockable.lockResourceVersion(String)
has been used to lock the resourceVersion,
this operation is effectively a single update attempt against that version.
If Lockable.lockResourceVersion(String)
has not been called, this operation
will be retried a number of times in the event of a conflict. If a resourceVersion has been set
on the item, the first update attempt will be made against that version. Subsequent attempts will fetch
the latest resourceVersion from the server.
replace
in interface Replaceable<T extends io.fabric8.kubernetes.api.model.HasMetadata>
item
- with the replacement statepublic T replaceStatus(T item)
StatusReplaceable
Replaceable.replace(Object)
, but only affects the status subresourcereplaceStatus
in interface StatusReplaceable<T extends io.fabric8.kubernetes.api.model.HasMetadata>
item
- with the status subresourcepublic T patch(PatchContext patchContext, String patch)
Patchable
PatchContext
(defaults to strategic merge if not specified).patch
in interface Patchable<T extends io.fabric8.kubernetes.api.model.HasMetadata>
patchContext
- PatchContext
for patch requestpatch
- The patch to be applied to the resource JSON file.public T patch(PatchContext patchContext, T item)
Patchable
PatchContext
(defaults to strategic merge if not specified).
PatchType.JSON
- will create a JSON patch against the current item.
WARNING: This may overwrite concurrent changes (between when you obtained your item and the current state) in an unexpected way.
Consider using edit instead. The resourceVersion and other fields of the item may be modified by this call.
PatchType.JSON_MERGE
- will send the serialization of the item as a JSON MERGE patch.
Set the resourceVersion to null to prevent optimistic locking.
PatchType.STRATEGIC_MERGE
- will send the serialization of the item as a STRATEGIC MERGE patch.
Set the resourceVersion to null to prevent optimistic locking.
patch
in interface Patchable<T extends io.fabric8.kubernetes.api.model.HasMetadata>
patchContext
- PatchContext
for patch requestitem
- to be patched with patched valuespublic boolean isResourceNamespaced()
isResourceNamespaced
in class OperationSupport
protected T handleResponse(HttpRequest.Builder requestBuilder) throws InterruptedException, IOException
InterruptedException
IOException
protected T handleCreate(T resource) throws InterruptedException, IOException
handleCreate
in class CreateOnlyResourceOperation<T extends io.fabric8.kubernetes.api.model.HasMetadata,T extends io.fabric8.kubernetes.api.model.HasMetadata>
InterruptedException
IOException
protected T handleUpdate(T updated, boolean status) throws InterruptedException, IOException
InterruptedException
IOException
protected T handlePatch(PatchContext context, T current, T updated, boolean status) throws InterruptedException, IOException
InterruptedException
IOException
protected T handlePatch(T current, Map<String,Object> patchedUpdate) throws InterruptedException, IOException
InterruptedException
IOException
protected io.fabric8.kubernetes.api.model.autoscaling.v1.Scale handleScale(io.fabric8.kubernetes.api.model.autoscaling.v1.Scale scaleParam)
protected io.fabric8.kubernetes.api.model.Status handleDeploymentRollback(io.fabric8.kubernetes.api.model.extensions.DeploymentRollback deploymentRollback)
protected T handleGet(URL resourceUrl) throws InterruptedException, IOException
InterruptedException
IOException
public Boolean isCascading()
public T getItem()
getItem
in class CreateOnlyResourceOperation<T extends io.fabric8.kubernetes.api.model.HasMetadata,T extends io.fabric8.kubernetes.api.model.HasMetadata>
public String getResourceVersion()
public Boolean isReloadingFromServer()
public Long getGracePeriodSeconds()
public io.fabric8.kubernetes.api.model.DeletionPropagation getPropagationPolicy()
public String getKind()
getKind
in interface OperationInfo
public String getGroup()
getGroup
in interface OperationInfo
public String getPlural()
getPlural
in interface OperationInfo
public String getVersion()
getVersion
in interface OperationInfo
public String getOperationType()
getOperationType
in interface OperationInfo
public OperationInfo forOperationType(String type)
forOperationType
in interface OperationInfo
public FilterWatchListDeletable<T,L> withGracePeriod(long gracePeriodSeconds)
GracePeriodConfigurable
withGracePeriod
in interface GracePeriodConfigurable<Deletable>
gracePeriodSeconds
- grace period integer value in secondspublic EditReplacePatchDeletable<T> withPropagationPolicy(io.fabric8.kubernetes.api.model.DeletionPropagation propagationPolicy)
PropagationPolicyConfigurable
The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.
Acceptable values are:
'Orphan' - orphan the dependents;
'Background' - allow the garbage collector to delete the dependents in the background;
'Foreground' - a cascading policy that deletes all dependents in the foreground.
withPropagationPolicy
in interface PropagationPolicyConfigurable<EditReplacePatchDeletable<T extends io.fabric8.kubernetes.api.model.HasMetadata>>
propagationPolicy
- propagation policy in form of string DeletionPropagation
public BaseOperation<T,L,R> withWaitRetryBackoff(long initialBackoff, TimeUnit backoffUnit, double backoffMultiplier)
Waitable
withWaitRetryBackoff
in interface Waitable<T extends io.fabric8.kubernetes.api.model.HasMetadata,T extends io.fabric8.kubernetes.api.model.HasMetadata>
initialBackoff
- the value for the initial backoff on first errorbackoffUnit
- the TimeUnit for the initial backoff valuebackoffMultiplier
- what to multiply the backoff by on each subsequent errorprotected void updateApiVersion(io.fabric8.kubernetes.api.model.KubernetesResourceList<T> list)
list
- Kubernetes resource listprotected void updateApiVersion(io.fabric8.kubernetes.api.model.HasMetadata hasMetadata)
hasMetadata
- object whose api version needs to be updatedpublic Readiness getReadiness()
public final boolean isReady()
Readiable
public T waitUntilReady(long amount, TimeUnit timeUnit)
waitUntilReady
in interface Waitable<T extends io.fabric8.kubernetes.api.model.HasMetadata,T extends io.fabric8.kubernetes.api.model.HasMetadata>
public T waitUntilCondition(Predicate<T> condition, long amount, TimeUnit timeUnit)
waitUntilCondition
in interface Waitable<T extends io.fabric8.kubernetes.api.model.HasMetadata,T extends io.fabric8.kubernetes.api.model.HasMetadata>
public CompletableFuture<List<T>> informOnCondition(Predicate<List<T>> condition)
Informable
Future
when the list at this context satisfies the given Predicate
.
The predicate will be tested against the state of the underlying informer store on every event.
The returned future should be cancelled by the caller if not waiting for completion to close the underlying informerinformOnCondition
in interface Informable<T extends io.fabric8.kubernetes.api.model.HasMetadata>
condition
- the Predicate
to testCompletableFuture
of the list of items after the condition is metpublic void setNamespace(String namespace)
public WritableOperation<T> dryRun(boolean isDryRun)
DryRunable
dryRun
in interface DryRunable<WritableOperation<T extends io.fabric8.kubernetes.api.model.HasMetadata>>
isDryRun
- whether dry run is enabled or disabledpublic Informable<T> withIndexers(Map<String,Function<T,List<String>>> indexers)
Informable
SharedInformer
s created by subsequent inform calls;withIndexers
in interface Informable<T extends io.fabric8.kubernetes.api.model.HasMetadata>
indexers
- to customize the indexingInformable
public SharedIndexInformer<T> inform(ResourceEventHandler<? super T> handler, long resync)
Informable
Watch
, but will attempt to handle failures after successfully started.
and provides a store of all the current resources.
This call will be blocking for the initial list and watch.
You are expected to call stop to terminate the underlying Watch.
Additional handlers can be added, but processing of the events will be in the websocket thread, so consider non-blocking handler operations for more than one handler.
inform
in interface Informable<T extends io.fabric8.kubernetes.api.model.HasMetadata>
handler
- to notifyresync
- the resync period or 0 for no resyncSharedIndexInformer
public SharedIndexInformer<T> runnableInformer(long resync)
Informable
Watch
, but will attempt to handle failures after successfully started.
and provides a store of all the current resources.
You are expected to call stop to terminate the underlying Watch.
Additional handlers can be added, but processing of the events will be in the websocket thread, so consider non-blocking handler operations for more than one handler.
runnableInformer
in interface Informable<T extends io.fabric8.kubernetes.api.model.HasMetadata>
resync
- the resync period or 0 for no resyncSharedIndexInformer
Copyright © 2015–2020 Red Hat. All rights reserved.