@Test public void testKafkaConnectContainerEnvVars() { ContainerEnvVar envVar1 = new ContainerEnvVar(); String testEnvOneKey = "TEST_ENV_1"; String testEnvOneValue = "test.env.one"; envVar1.setName(testEnvOneKey); envVar1.setValue(testEnvOneValue); ContainerEnvVar envVar2 = new ContainerEnvVar(); String testEnvTwoKey = "TEST_ENV_2"; String testEnvTwoValue = "test.env.two"; envVar2.setName(testEnvTwoKey); envVar2.setValue(testEnvTwoValue); List<ContainerEnvVar> testEnvs = new ArrayList<>(); testEnvs.add(envVar1); testEnvs.add(envVar2); ContainerTemplate kafkaConnectContainer = new ContainerTemplate(); kafkaConnectContainer.setEnv(testEnvs); KafkaConnectS2I resource = new KafkaConnectS2IBuilder(this.resource) .editSpec() .withNewTemplate() .withConnectContainer(kafkaConnectContainer) .endTemplate() .endSpec() .build(); List<EnvVar> kafkaEnvVars = KafkaConnectS2ICluster.fromCrd(resource, VERSIONS).getEnvVars(); assertThat("Failed to correctly set container environment variable: " + testEnvOneKey, kafkaEnvVars.stream().filter(env -> testEnvOneKey.equals(env.getName())) .map(EnvVar::getValue).findFirst().orElse("").equals(testEnvOneValue), is(true)); assertThat("Failed to correctly set container environment variable: " + testEnvTwoKey, kafkaEnvVars.stream().filter(env -> testEnvTwoKey.equals(env.getName())) .map(EnvVar::getValue).findFirst().orElse("").equals(testEnvTwoValue), is(true)); }
public static KafkaConnectS2ICluster fromCrd(KafkaConnectS2I kafkaConnectS2I, KafkaVersion.Lookup versions) { KafkaConnectS2ISpec spec = kafkaConnectS2I.getSpec(); KafkaConnectS2ICluster cluster = fromSpec(spec, versions, new KafkaConnectS2ICluster(kafkaConnectS2I)); cluster.setOwnerReference(kafkaConnectS2I); cluster.setInsecureSourceRepository(spec.isInsecureSourceRepository()); cluster.setBuildResourceRequirements(spec.getBuildResources()); return cluster; }
KafkaConnectS2ICluster extends KafkaConnectCluster { public static KafkaConnectS2ICluster fromCrd(KafkaConnectS2I kafkaConnectS2I, KafkaVersion.Lookup versions) { KafkaConnectS2ISpec spec = kafkaConnectS2I.getSpec(); KafkaConnectS2ICluster cluster = fromSpec(spec, versions, new KafkaConnectS2ICluster(kafkaConnectS2I)); cluster.setOwnerReference(kafkaConnectS2I); cluster.setInsecureSourceRepository(spec.isInsecureSourceRepository()); cluster.setBuildResourceRequirements(spec.getBuildResources()); return cluster; } }
KafkaConnectS2ICluster extends KafkaConnectCluster { public static KafkaConnectS2ICluster fromCrd(KafkaConnectS2I kafkaConnectS2I, KafkaVersion.Lookup versions) { KafkaConnectS2ISpec spec = kafkaConnectS2I.getSpec(); KafkaConnectS2ICluster cluster = fromSpec(spec, versions, new KafkaConnectS2ICluster(kafkaConnectS2I)); cluster.setOwnerReference(kafkaConnectS2I); cluster.setInsecureSourceRepository(spec.isInsecureSourceRepository()); cluster.setBuildResourceRequirements(spec.getBuildResources()); return cluster; } private  KafkaConnectS2ICluster(HasMetadata resource); }
KafkaConnectS2ICluster extends KafkaConnectCluster { public static KafkaConnectS2ICluster fromCrd(KafkaConnectS2I kafkaConnectS2I, KafkaVersion.Lookup versions) { KafkaConnectS2ISpec spec = kafkaConnectS2I.getSpec(); KafkaConnectS2ICluster cluster = fromSpec(spec, versions, new KafkaConnectS2ICluster(kafkaConnectS2I)); cluster.setOwnerReference(kafkaConnectS2I); cluster.setInsecureSourceRepository(spec.isInsecureSourceRepository()); cluster.setBuildResourceRequirements(spec.getBuildResources()); return cluster; } private  KafkaConnectS2ICluster(HasMetadata resource); static KafkaConnectS2ICluster fromCrd(KafkaConnectS2I kafkaConnectS2I, KafkaVersion.Lookup versions); DeploymentConfig generateDeploymentConfig(Map<String, String> annotations, boolean isOpenShift, ImagePullPolicy imagePullPolicy,
                                                     List<LocalObjectReference> imagePullSecrets); ImageStream generateSourceImageStream(); ImageStream generateTargetImageStream(); BuildConfig generateBuildConfig(); boolean isInsecureSourceRepository(); void setInsecureSourceRepository(boolean insecureSourceRepository); void setBuildResourceRequirements(ResourceRequirements buildRequirements); }
KafkaConnectS2ICluster extends KafkaConnectCluster { public static KafkaConnectS2ICluster fromCrd(KafkaConnectS2I kafkaConnectS2I, KafkaVersion.Lookup versions) { KafkaConnectS2ISpec spec = kafkaConnectS2I.getSpec(); KafkaConnectS2ICluster cluster = fromSpec(spec, versions, new KafkaConnectS2ICluster(kafkaConnectS2I)); cluster.setOwnerReference(kafkaConnectS2I); cluster.setInsecureSourceRepository(spec.isInsecureSourceRepository()); cluster.setBuildResourceRequirements(spec.getBuildResources()); return cluster; } private  KafkaConnectS2ICluster(HasMetadata resource); static KafkaConnectS2ICluster fromCrd(KafkaConnectS2I kafkaConnectS2I, KafkaVersion.Lookup versions); DeploymentConfig generateDeploymentConfig(Map<String, String> annotations, boolean isOpenShift, ImagePullPolicy imagePullPolicy,
                                                     List<LocalObjectReference> imagePullSecrets); ImageStream generateSourceImageStream(); ImageStream generateTargetImageStream(); BuildConfig generateBuildConfig(); boolean isInsecureSourceRepository(); void setInsecureSourceRepository(boolean insecureSourceRepository); void setBuildResourceRequirements(ResourceRequirements buildRequirements);  }