@Test public void withOldAffinityAndTolerations() throws IOException { ResourceTester<Kafka, EntityOperator> helper = new ResourceTester<>(Kafka.class, VERSIONS, EntityOperator::fromCrd, this.getClass().getSimpleName() + ".withOldAffinityAndTolerations"); helper.assertDesiredResource("-DeploymentAffinity.yaml", zc -> zc.generateDeployment(true, Collections.EMPTY_MAP, null, null).getSpec().getTemplate().getSpec().getAffinity()); helper.assertDesiredResource("-DeploymentTolerations.yaml", zc -> zc.generateDeployment(true, Collections.EMPTY_MAP, null, null).getSpec().getTemplate().getSpec().getTolerations()); }
public Deployment generateDeployment(boolean isOpenShift, Map<String, String> annotations, ImagePullPolicy imagePullPolicy, List<LocalObjectReference> imagePullSecrets) { if (!isDeployed()) { log.warn("Topic and/or User Operators not declared: Entity Operator will not be deployed"); return null; } DeploymentStrategy updateStrategy = new DeploymentStrategyBuilder() .withType("Recreate") .build(); return createDeployment( updateStrategy, Collections.emptyMap(), annotations, getMergedAffinity(), getInitContainers(imagePullPolicy), getContainers(imagePullPolicy), getVolumes(isOpenShift), imagePullSecrets ); }
EntityOperator extends AbstractModel { public Deployment generateDeployment(boolean isOpenShift, Map<String, String> annotations, ImagePullPolicy imagePullPolicy, List<LocalObjectReference> imagePullSecrets) { if (!isDeployed()) { log.warn("Topic and/or User Operators not declared: Entity Operator will not be deployed"); return null; } DeploymentStrategy updateStrategy = new DeploymentStrategyBuilder() .withType("Recreate") .build(); return createDeployment( updateStrategy, Collections.emptyMap(), annotations, getMergedAffinity(), getInitContainers(imagePullPolicy), getContainers(imagePullPolicy), getVolumes(isOpenShift), imagePullSecrets ); } }
EntityOperator extends AbstractModel { public Deployment generateDeployment(boolean isOpenShift, Map<String, String> annotations, ImagePullPolicy imagePullPolicy, List<LocalObjectReference> imagePullSecrets) { if (!isDeployed()) { log.warn("Topic and/or User Operators not declared: Entity Operator will not be deployed"); return null; } DeploymentStrategy updateStrategy = new DeploymentStrategyBuilder() .withType("Recreate") .build(); return createDeployment( updateStrategy, Collections.emptyMap(), annotations, getMergedAffinity(), getInitContainers(imagePullPolicy), getContainers(imagePullPolicy), getVolumes(isOpenShift), imagePullSecrets ); } protected  EntityOperator(HasMetadata resource); }
EntityOperator extends AbstractModel { public Deployment generateDeployment(boolean isOpenShift, Map<String, String> annotations, ImagePullPolicy imagePullPolicy, List<LocalObjectReference> imagePullSecrets) { if (!isDeployed()) { log.warn("Topic and/or User Operators not declared: Entity Operator will not be deployed"); return null; } DeploymentStrategy updateStrategy = new DeploymentStrategyBuilder() .withType("Recreate") .build(); return createDeployment( updateStrategy, Collections.emptyMap(), annotations, getMergedAffinity(), getInitContainers(imagePullPolicy), getContainers(imagePullPolicy), getVolumes(isOpenShift), imagePullSecrets ); } protected  EntityOperator(HasMetadata resource); void setTopicOperator(EntityTopicOperator topicOperator); EntityTopicOperator getTopicOperator(); void setUserOperator(EntityUserOperator userOperator); EntityUserOperator getUserOperator(); static String entityOperatorName(String cluster); void setZookeeperConnect(String zookeeperConnect); String getZookeeperConnect(); static String secretName(String cluster); void setDeployed(boolean isDeployed); boolean isDeployed(); static EntityOperator fromCrd(Kafka kafkaAssembly, KafkaVersion.Lookup versions); Deployment generateDeployment(boolean isOpenShift, Map<String, String> annotations, ImagePullPolicy imagePullPolicy, List<LocalObjectReference> imagePullSecrets); Secret generateSecret(ClusterCa clusterCa, boolean isMaintenanceTimeWindowsSatisfied); static String entityOperatorServiceAccountName(String cluster); @Override ServiceAccount generateServiceAccount(); }
EntityOperator extends AbstractModel { public Deployment generateDeployment(boolean isOpenShift, Map<String, String> annotations, ImagePullPolicy imagePullPolicy, List<LocalObjectReference> imagePullSecrets) { if (!isDeployed()) { log.warn("Topic and/or User Operators not declared: Entity Operator will not be deployed"); return null; } DeploymentStrategy updateStrategy = new DeploymentStrategyBuilder() .withType("Recreate") .build(); return createDeployment( updateStrategy, Collections.emptyMap(), annotations, getMergedAffinity(), getInitContainers(imagePullPolicy), getContainers(imagePullPolicy), getVolumes(isOpenShift), imagePullSecrets ); } protected  EntityOperator(HasMetadata resource); void setTopicOperator(EntityTopicOperator topicOperator); EntityTopicOperator getTopicOperator(); void setUserOperator(EntityUserOperator userOperator); EntityUserOperator getUserOperator(); static String entityOperatorName(String cluster); void setZookeeperConnect(String zookeeperConnect); String getZookeeperConnect(); static String secretName(String cluster); void setDeployed(boolean isDeployed); boolean isDeployed(); static EntityOperator fromCrd(Kafka kafkaAssembly, KafkaVersion.Lookup versions); Deployment generateDeployment(boolean isOpenShift, Map<String, String> annotations, ImagePullPolicy imagePullPolicy, List<LocalObjectReference> imagePullSecrets); Secret generateSecret(ClusterCa clusterCa, boolean isMaintenanceTimeWindowsSatisfied); static String entityOperatorServiceAccountName(String cluster); @Override ServiceAccount generateServiceAccount(); static final String ENV_VAR_ZOOKEEPER_CONNECT; static final String EO_CLUSTER_ROLE_NAME; }