7
7
import io .fabric8 .kubernetes .api .model .LabelSelector ;
8
8
import io .fabric8 .kubernetes .api .model .LabelSelectorBuilder ;
9
9
import io .fabric8 .kubernetes .api .model .Pod ;
10
+ import io .skodjob .testframe .resources .KubeResourceManager ;
11
+ import io .skodjob .testframe .resources .ResourceItem ;
10
12
import io .strimzi .api .kafka .model .common .Constants ;
11
13
import io .strimzi .api .kafka .model .connect .KafkaConnect ;
12
14
import io .strimzi .api .kafka .model .connect .KafkaConnectBuilder ;
30
32
import io .strimzi .systemtest .resources .crd .KafkaConnectResource ;
31
33
import io .strimzi .systemtest .resources .crd .KafkaNodePoolResource ;
32
34
import io .strimzi .systemtest .resources .crd .KafkaResource ;
35
+ import io .strimzi .systemtest .resources .crd .KafkaTopicResource ;
33
36
import io .strimzi .systemtest .storage .TestStorage ;
34
37
import io .strimzi .systemtest .templates .crd .KafkaConnectTemplates ;
35
38
import io .strimzi .systemtest .templates .crd .KafkaConnectorTemplates ;
@@ -428,9 +431,12 @@ protected void deployKafkaConnectAndKafkaConnectorWithWaitForReadiness(
428
431
429
432
final String imageFullPath = Environment .getImageOutputRegistry (testStorage .getNamespaceName (), TestConstants .ST_CONNECT_BUILD_IMAGE_NAME , String .valueOf (new Random ().nextInt (Integer .MAX_VALUE )));
430
433
434
+ LOGGER .info ("Deploying KafkaConnect from: {}" , kafkaConnectYaml .getPath ());
435
+
431
436
KafkaConnect kafkaConnect = new KafkaConnectBuilder (ReadWriteUtils .readObjectFromYamlFilepath (kafkaConnectYaml , KafkaConnect .class ))
432
437
.editMetadata ()
433
438
.withName (CLUSTER_NAME )
439
+ .withNamespace (testStorage .getNamespaceName ())
434
440
.addToAnnotations (Annotations .STRIMZI_IO_USE_CONNECTOR_RESOURCES , "true" )
435
441
.endMetadata ()
436
442
.editSpec ()
@@ -446,10 +452,7 @@ protected void deployKafkaConnectAndKafkaConnectorWithWaitForReadiness(
446
452
.endSpec ()
447
453
.build ();
448
454
449
- LOGGER .info ("Deploying KafkaConnect from: {}" , kafkaConnectYaml .getPath ());
450
-
451
- cmdKubeClient (testStorage .getNamespaceName ()).applyContent (ReadWriteUtils .writeObjectToYamlString (kafkaConnect ));
452
- ResourceManager .waitForResourceReadiness (testStorage .getNamespaceName (), getResourceApiVersion (KafkaConnect .RESOURCE_PLURAL ), kafkaConnect .getMetadata ().getName ());
455
+ resourceManager .createResourceWithWait (kafkaConnect );
453
456
454
457
// in our examples is no sink connector and thus we are using the same as in HEAD verification
455
458
resourceManager .createResourceWithWait (KafkaConnectorTemplates .kafkaConnector (testStorage .getNamespaceName (), CLUSTER_NAME )
@@ -685,6 +688,7 @@ protected void applyCustomResourcesFromPath(String namespaceName, String example
685
688
kafkaTopicYaml = new File (examplesPath + "/examples/topic/kafka-topic.yaml" );
686
689
LOGGER .info ("Deploying KafkaTopic from: {}, in Namespace {}" , kafkaTopicYaml .getPath (), namespaceName );
687
690
cmdKubeClient (namespaceName ).applyContent (ReadWriteUtils .readFile (kafkaTopicYaml ));
691
+ KubeResourceManager .get ().pushToStack (new ResourceItem <>(() -> KafkaTopicResource .kafkaTopicClient ().inNamespace (namespaceName ).withName ("my-topic" ).delete ()));
688
692
}
689
693
690
694
private String getKafkaYamlWithName (String name ) {
0 commit comments