Skip to content

Commit

Permalink
[Bug] fix some k8s bug (#3338)
Browse files Browse the repository at this point in the history
Co-authored-by: gaoyan1998 <[email protected]>
  • Loading branch information
gaoyan1998 and gaoyan1998 authored Mar 29, 2024
1 parent e61d2c5 commit 0bd8960
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
1 change: 1 addition & 0 deletions dinky-admin/src/main/resources/dinky-loader/FlinkConfClass
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ org.apache.flink.configuration.YarnConfigOptions
org.apache.flink.kubernetes.configuration.KubernetesConfigOptions
org.apache.flink.kubernetes.configuration.KubernetesHighAvailabilityOptions
org.apache.flink.configuration.KubernetesConfigOptions
org.apache.flink.configuration.DeploymentOptions
org.apache.flink.python.PythonOptions
org.apache.flink.table.api.config.TableConfigOptions
org.apache.flink.table.api.config.OptimizerConfigOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ protected void initConfig() {
}

public SavePointResult savepointCluster(String savePoint) {
if (Asserts.isNull(k8sClientHelper.getClient())) {
initConfig();
}
initConfig();

KubernetesClusterClientFactory clusterClientFactory = new KubernetesClusterClientFactory();
addConfigParas(
Expand All @@ -120,9 +118,7 @@ public SavePointResult savepointCluster(String savePoint) {
}

public SavePointResult savepointJob(String savePoint) {
if (Asserts.isNull(k8sClientHelper.getClient())) {
initConfig();
}
initConfig();
if (Asserts.isNull(config.getFlinkConfig().getJobId())) {
throw new GatewayException(
"No job id was specified. Please specify a job to which you would like to" + " savepont.");
Expand Down Expand Up @@ -168,11 +164,10 @@ public TestResult test() {

@Override
public void killCluster() {
if (Asserts.isNull(k8sClientHelper.getClient())) {
initConfig();
}
log.info("Start kill cluster: " + config.getFlinkConfig().getJobName());
initConfig();
addConfigParas(
KubernetesConfigOptions.CLUSTER_ID, config.getClusterConfig().getAppId());
KubernetesConfigOptions.CLUSTER_ID, config.getFlinkConfig().getJobName());
KubernetesClusterClientFactory clusterClientFactory = new KubernetesClusterClientFactory();
String clusterId = clusterClientFactory.getClusterId(configuration);
if (Asserts.isNull(clusterId)) {
Expand Down

0 comments on commit 0bd8960

Please sign in to comment.