@Test public void testImagePullSecretsBoth() { LocalObjectReference secret1 = new LocalObjectReference("some-pull-secret"); LocalObjectReference secret2 = new LocalObjectReference("some-other-pull-secret"); KafkaConnectS2I resource = new KafkaConnectS2IBuilder(this.resource) .editSpec() .withNewTemplate() .withNewPod() .withImagePullSecrets(secret2) .endPod() .endTemplate() .endSpec() .build(); KafkaConnectS2ICluster kc = KafkaConnectS2ICluster.fromCrd(resource, VERSIONS); Deployment dep = kc.generateDeployment(emptyMap(), true, null, singletonList(secret1)); assertThat(dep.getSpec().getTemplate().getSpec().getImagePullSecrets().size(), is(1)); assertThat(dep.getSpec().getTemplate().getSpec().getImagePullSecrets().contains(secret1), is(false)); assertThat(dep.getSpec().getTemplate().getSpec().getImagePullSecrets().contains(secret2), 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);  }