use of com.bakdata.quick.manager.k8s.KubernetesResources in project quick by bakdata.
the class JobCleanerTest method shouldDeleteSucceededJobs.
@Test
void shouldDeleteSucceededJobs() {
final JobCleaner jobCleaner = new JobCleaner(this.client);
final KubernetesResources resources = new KubernetesResources();
final Job deletionJob = resources.createDeletionJob("test", "image", List.of("--key", "value"));
final Job finalJob = new JobBuilder(deletionJob).withNewStatus().withActive(0).withSucceeded(1).endStatus().build();
this.kubernetesServer.getClient().batch().v1().jobs().create(finalJob);
List<Job> jobList = this.kubernetesServer.getClient().batch().v1().jobs().list().getItems();
assertThat(jobList).hasSize(1);
assertThatNoException().isThrownBy(jobCleaner::deleteJobs);
jobList = this.kubernetesServer.getClient().batch().v1().jobs().list().getItems();
assertThat(jobList).isEmpty();
}
use of com.bakdata.quick.manager.k8s.KubernetesResources in project quick by bakdata.
the class JobCleanerTest method shouldRunWithoutErrorForJobsWithoutStatus.
@Test
void shouldRunWithoutErrorForJobsWithoutStatus() {
final JobCleaner jobCleaner = new JobCleaner(this.client);
final KubernetesResources resources = new KubernetesResources();
final Job deletionJob = resources.createDeletionJob("test", "image", List.of("--key", "value"));
this.kubernetesServer.getClient().batch().v1().jobs().create(deletionJob);
assertThatNoException().isThrownBy(jobCleaner::deleteJobs);
}
use of com.bakdata.quick.manager.k8s.KubernetesResources in project quick by bakdata.
the class KubernetesMirrorServiceTest method setUp.
@BeforeEach
void setUp() {
final MirrorResourceLoader loader = new MirrorResourceLoader(new KubernetesResources(), this.getDeploymentConfig(), this.getResourceConfig());
this.mirrorService = new KubernetesMirrorService(new KubernetesResources(), this.getManagerClient(), this.getDeploymentConfig(), loader);
}
use of com.bakdata.quick.manager.k8s.KubernetesResources in project quick by bakdata.
the class KubernetesApplicationServiceTest method setUp.
@BeforeEach
void setUp() {
final ApplicationResourceLoader loader = new ApplicationResourceLoader(new KubernetesResources(), this.kafkaConfig, this.getResourceConfig(), this.getDeploymentConfig());
this.service = new KubernetesApplicationService(new KubernetesResources(), this.getManagerClient(), loader);
}
use of com.bakdata.quick.manager.k8s.KubernetesResources in project quick by bakdata.
the class KubernetesGatewayServiceTest method setUp.
@BeforeEach
void setUp() {
final GatewayResourceLoader loader = new GatewayResourceLoader(new KubernetesResources(), this.getDeploymentConfig(), this.getResourceConfig(), NAMESPACE);
this.gatewayService = new KubernetesGatewayService(this.getManagerClient(), this.gatewayClient, this.graphQLToAvroConverter, loader);
}
Aggregations