Class CustomResourceConditions
java.lang.Object
io.strimzi.api.kafka.model.common.CustomResourceConditions
CustomResourceConditions supplies convenience predicates that are intended to reduce boilerplate
code when using fabric8 clients to wait for a CRD to enter some anticipated state. This class provides
a generic implementation that can be used internally, public Predicates are exposed on the CRD
classes.
An example usage of one of the public predicates (Kafka::isReady):
Crds.kafkaOperation(client).inNamespace(NAMESPACE).resource(kafka).create(); Crds.kafkaOperation(client).inNamespace(NAMESPACE).withName(NAME).waitUntilCondition(Kafka.isReady(), 5, TimeUnit.MINUTES);and to wait on a specific KafkaRebalance state using
KafkaRebalance::isInState:
Crds.kafkaRebalanceOperation(client).inNamespace(NAMESPACE).withName(REBALANCE_NAME)
.waitUntilCondition(KafkaRebalance.isInState(KafkaRebalanceState.ProposalReady), 5, TimeUnit.MINUTES);
-
Method Summary
Modifier and TypeMethodDescriptionisLatestGenerationAndAnyConditionMatches(String type, String status) Checks if the observedGeneration of its status is equal to the generation of its metadata and any of the conditions of its status contains given type and status parameter.isReady()Returns a predicate that determines if CRD is ready.
-
Method Details
-
isReady
public static <Y extends Status,T extends io.fabric8.kubernetes.client.CustomResource<?, Predicate<T> isReady()Y>> Returns a predicate that determines if CRD is ready. A CRD is ready if the observedGeneration of its status is equal to the generation of its metadata and any of the conditions of its status has type:"Ready" and status:"True"- Returns:
- a predicate that checks if a CRD is ready
-
isLatestGenerationAndAnyConditionMatches
public static <Y extends Status,T extends io.fabric8.kubernetes.client.CustomResource<?, Predicate<T> isLatestGenerationAndAnyConditionMatchesY>> (String type, String status) Checks if the observedGeneration of its status is equal to the generation of its metadata and any of the conditions of its status contains given type and status parameter.- Type Parameters:
Y- Type of statusT- Type of Custom resource- Parameters:
type- State of the Custom resourcestatus- Status of the Custom resource- Returns:
- a predicate based on the check
-