@Test void podDoesNotHaveDeletionTimestamp() { V1Pod pod = new V1Pod() .metadata( new V1ObjectMeta() .name(POD_NAME) ) .spec(new V1PodSpec()) .status(new V1PodStatus().phase(PENDING)); Assertions.assertThat(podDeletionGcController.isPodInPendingPhaseWithDeletionTimestamp(pod)).isFalse(); }
@VisibleForTesting boolean isPodInPendingPhaseWithDeletionTimestamp(V1Pod pod) { if (pod == null || pod.getMetadata() == null || pod.getStatus() == null) { return false; } DateTime deletionTimestamp = pod.getMetadata().getDeletionTimestamp(); return deletionTimestamp != null && PENDING.equalsIgnoreCase(pod.getStatus().getPhase()); }
PodDeletionGcController extends BaseGcController<V1Pod> { @VisibleForTesting boolean isPodInPendingPhaseWithDeletionTimestamp(V1Pod pod) { if (pod == null || pod.getMetadata() == null || pod.getStatus() == null) { return false; } DateTime deletionTimestamp = pod.getMetadata().getDeletionTimestamp(); return deletionTimestamp != null && PENDING.equalsIgnoreCase(pod.getStatus().getPhase()); } }
PodDeletionGcController extends BaseGcController<V1Pod> { @VisibleForTesting boolean isPodInPendingPhaseWithDeletionTimestamp(V1Pod pod) { if (pod == null || pod.getMetadata() == null || pod.getStatus() == null) { return false; } DateTime deletionTimestamp = pod.getMetadata().getDeletionTimestamp(); return deletionTimestamp != null && PENDING.equalsIgnoreCase(pod.getStatus().getPhase()); } @Inject  PodDeletionGcController(
            TitusRuntime titusRuntime,
            LocalScheduler scheduler,
            @Named(POD_DELETION_GC_CONTROLLER) FixedIntervalTokenBucketConfiguration tokenBucketConfiguration,
            @Named(POD_DELETION_GC_CONTROLLER) ControllerConfiguration controllerConfiguration,
            KubeApiFacade kubeApiFacade,
            KubeControllerConfiguration kubeControllerConfiguration
    ); }
PodDeletionGcController extends BaseGcController<V1Pod> { @VisibleForTesting boolean isPodInPendingPhaseWithDeletionTimestamp(V1Pod pod) { if (pod == null || pod.getMetadata() == null || pod.getStatus() == null) { return false; } DateTime deletionTimestamp = pod.getMetadata().getDeletionTimestamp(); return deletionTimestamp != null && PENDING.equalsIgnoreCase(pod.getStatus().getPhase()); } @Inject  PodDeletionGcController(
            TitusRuntime titusRuntime,
            LocalScheduler scheduler,
            @Named(POD_DELETION_GC_CONTROLLER) FixedIntervalTokenBucketConfiguration tokenBucketConfiguration,
            @Named(POD_DELETION_GC_CONTROLLER) ControllerConfiguration controllerConfiguration,
            KubeApiFacade kubeApiFacade,
            KubeControllerConfiguration kubeControllerConfiguration
    ); @Override boolean shouldGc(); @Override List<V1Pod> getItemsToGc(); @Override boolean gcItem(V1Pod item); }
PodDeletionGcController extends BaseGcController<V1Pod> { @VisibleForTesting boolean isPodInPendingPhaseWithDeletionTimestamp(V1Pod pod) { if (pod == null || pod.getMetadata() == null || pod.getStatus() == null) { return false; } DateTime deletionTimestamp = pod.getMetadata().getDeletionTimestamp(); return deletionTimestamp != null && PENDING.equalsIgnoreCase(pod.getStatus().getPhase()); } @Inject  PodDeletionGcController(
            TitusRuntime titusRuntime,
            LocalScheduler scheduler,
            @Named(POD_DELETION_GC_CONTROLLER) FixedIntervalTokenBucketConfiguration tokenBucketConfiguration,
            @Named(POD_DELETION_GC_CONTROLLER) ControllerConfiguration controllerConfiguration,
            KubeApiFacade kubeApiFacade,
            KubeControllerConfiguration kubeControllerConfiguration
    ); @Override boolean shouldGc(); @Override List<V1Pod> getItemsToGc(); @Override boolean gcItem(V1Pod item); static final String POD_DELETION_GC_CONTROLLER; static final String POD_DELETION_GC_CONTROLLER_DESCRIPTION; }