Skip to content

Commit

Permalink
refactor extract new method for inDockerContainer()
Browse files Browse the repository at this point in the history
  • Loading branch information
baisui1981 committed Apr 21, 2024
1 parent 2b58da6 commit 5fb2c6a
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

package org.apache.flink.kubernetes.kubeclient;

import com.qlangtech.tis.config.BasicConfig;

import org.apache.flink.configuration.Configuration;
import org.apache.flink.kubernetes.configuration.KubernetesConfigOptions;
import org.apache.flink.kubernetes.configuration.KubernetesLeaderElectionConfiguration;
Expand Down Expand Up @@ -174,14 +176,16 @@ public CompletableFuture<Void> stopPod(String podName) {
kubeClientExecutorService);
}

public static final String TIS_K8S_ENV = "TIS_K8S_ENV";


@Override
public Optional<Endpoint> getRestEndpoint(String clusterId, boolean envAware) {
String externalServiceName = ExternalServiceDecorator.getExternalServiceName(
clusterId + ExternalServiceDecorator.TIS_EXTERNAL_SERVICE_SUFFIX);
if (envAware) {
if (Boolean.parseBoolean(System.getenv(TIS_K8S_ENV))) {

// if (Boolean.parseBoolean(System.getenv(BasicConfig.TIS_K8S_ENV))) {
if(BasicConfig.inDockerContainer()){
externalServiceName = ExternalServiceDecorator.getExternalServiceName(clusterId);
}
}
Expand Down

0 comments on commit 5fb2c6a

Please sign in to comment.