Class OperatorController
- java.lang.Object
-
- io.debezium.testing.openshift.tools.OperatorController
-
- Direct Known Subclasses:
StrimziOperatorController
public class OperatorController extends Object
This class provides control over Strimzi Cluster Operator deployed in OpenShift- Author:
- Jakub Cechacek
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.LoggerLOGGERprotected Stringnameprotected io.fabric8.openshift.client.OpenShiftClientocpprotected OpenShiftUtilsocpUtilsprotected io.fabric8.kubernetes.api.model.apps.Deploymentoperatorprotected Map<String,String>podLabelsprotected Stringproject
-
Constructor Summary
Constructors Constructor Description OperatorController(io.fabric8.kubernetes.api.model.apps.Deployment operator, Map<String,String> podLabels, io.fabric8.openshift.client.OpenShiftClient ocp)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisable()Disables Strimzi cluster operator by scaling it to ZEROvoidenable()Enables Strimzi cluster operator by scaling it to ONEvoidsetAlwaysPullPolicy()Sets pull policy of the operator to 'Always'voidsetEnvVar(String name, String val)Set environment variable on all containers of operator's deploymentvoidsetImagePullSecret(String secret)Sets image pull secret for operator'sDeploymentresourcevoidsetNumberOfReplicas(int replicas)Sets number of replicasvoidsetSingleReplica()Semantic shortcut for callingsetNumberOfReplicas(int)with1as valueio.fabric8.kubernetes.api.model.apps.DeploymentupdateOperator()Updates Operator'sDeploymentresourceprivate io.fabric8.kubernetes.api.model.apps.DeploymentwaitForAvailable()
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
ocp
protected final io.fabric8.openshift.client.OpenShiftClient ocp
-
ocpUtils
protected final OpenShiftUtils ocpUtils
-
project
protected String project
-
operator
protected io.fabric8.kubernetes.api.model.apps.Deployment operator
-
name
protected String name
-
-
Method Detail
-
disable
public void disable()
Disables Strimzi cluster operator by scaling it to ZERO
-
enable
public void enable() throws InterruptedExceptionEnables Strimzi cluster operator by scaling it to ONE- Throws:
InterruptedException
-
setNumberOfReplicas
public void setNumberOfReplicas(int replicas)
Sets number of replicas- Parameters:
replicas- number of replicas
-
setSingleReplica
public void setSingleReplica()
Semantic shortcut for callingsetNumberOfReplicas(int)with1as value
-
setImagePullSecret
public void setImagePullSecret(String secret)
Sets image pull secret for operator'sDeploymentresource- Parameters:
secret- name of the secret
-
setAlwaysPullPolicy
public void setAlwaysPullPolicy()
Sets pull policy of the operator to 'Always'
-
setEnvVar
public void setEnvVar(String name, String val)
Set environment variable on all containers of operator's deployment- Parameters:
name- variable's nameval- variable's value
-
updateOperator
public io.fabric8.kubernetes.api.model.apps.Deployment updateOperator() throws InterruptedExceptionUpdates Operator'sDeploymentresource- Returns:
Deploymentresource of the operator- Throws:
InterruptedException
-
waitForAvailable
private io.fabric8.kubernetes.api.model.apps.Deployment waitForAvailable() throws InterruptedException- Throws:
InterruptedException
-
-