Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@

import java.lang.reflect.Method;
import java.util.Collections;
import java.util.Map;
import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -102,17 +103,6 @@ protected void initConfig() {
+ " is not Valid. In Kubernetes mode, task names must start and end with a lowercase letter or a digit, "
+ "and can contain lowercase letters, digits, dots, and hyphens in between.");
}
k8sConfig = config.getKubernetesConfig();

// Be compatible with kubernetes.container.image and kubernetes.container.image.ref
final String oldContainerImageKey = "kubernetes.container.image";
if (k8sConfig.getConfiguration().containsKey(oldContainerImageKey)) {
k8sConfig
.getConfiguration()
.put(
KubernetesConfigOptions.CONTAINER_IMAGE.key(),
k8sConfig.getConfiguration().get(oldContainerImageKey));
}

configuration.set(CoreOptions.CLASSLOADER_RESOLVE_ORDER, "parent-first");
try {
Expand All @@ -122,8 +112,17 @@ protected void initConfig() {
logger.warn("load locale config yaml failed:{},Skip config it", e.getMessage());
}

k8sConfig = config.getKubernetesConfig();
// 兼容kubernetes.container.image 和 kubernetes.container.image.ref
Map<String, String> k8sConfiguration = k8sConfig.getConfiguration();
final String oldContainerImageKey = "kubernetes.container.image";
if (k8sConfiguration.containsKey(oldContainerImageKey)) {
String containerImageValue = k8sConfiguration.get(oldContainerImageKey);
k8sConfiguration.remove(oldContainerImageKey);
k8sConfiguration.put(KubernetesConfigOptions.CONTAINER_IMAGE.key(), containerImageValue);
}
// -------------------Note: the sequence can not be changed, priority problem----------------
addConfigParas(k8sConfig.getConfiguration());
addConfigParas(k8sConfiguration);
addConfigParas(flinkConfig.getConfiguration());
// -------------------------------------------
addConfigParas(DeploymentOptions.TARGET, getType().getLongValue());
Expand Down
Loading