@Override
    public CompletableFuture<Boolean> checkAndUpdateConfigMap(
            String configMapName,
            Function<KubernetesConfigMap, Optional<KubernetesConfigMap>> updateFunction) {
        return FutureUtils.retry(
                () -> attemptCheckAndUpdateConfigMap(configMapName, updateFunction),
                maxRetryAttempts,
                // Only KubernetesClientException is retryable
                t -> ExceptionUtils.findThrowable(t, KubernetesClientException.class).isPresent(),
                kubeClientExecutorService);
    }
@Test
    void testCheckAndUpdateConfigMapWhenConfigMapNotExist() {
        final String errMsg =
                "Cannot retry checkAndUpdateConfigMap with configMap "
                        + TESTING_CONFIG_MAP_NAME
                        + " because it does not exist.";
        assertThatThrownBy(
                        () ->
                                this.flinkKubeClient
                                        .checkAndUpdateConfigMap(
                                                TESTING_CONFIG_MAP_NAME, c -> Optional.empty())
                                        .get(),
                        "CheckAndUpdateConfigMap should fail with an exception when the ConfigMap does not exist.")
                .satisfies(anyCauseMatches(errMsg))
                .satisfies(
                        // Should not retry when ConfigMap does not exist.
                        anyCauseMatches(
                                "Stopped retrying the operation because the error is not retryable."));
    }