You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampark.apache.org by be...@apache.org on 2023/05/31 15:36:59 UTC
[incubator-streampark] branch dev updated: [Bug] pass flinkClusterId & clusterId parameters for app running in k8s session mode (#2751)
This is an automated email from the ASF dual-hosted git repository.
benjobs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git
The following commit(s) were added to refs/heads/dev by this push:
new 229f41db2 [Bug] pass flinkClusterId & clusterId parameters for app running in k8s session mode (#2751)
229f41db2 is described below
commit 229f41db2e676f7aeb721d76c212084c550467be
Author: zhoulii <zh...@foxmail.com>
AuthorDate: Wed May 31 23:36:54 2023 +0800
[Bug] pass flinkClusterId & clusterId parameters for app running in k8s session mode (#2751)
Co-authored-by: zhoulii <zh...@hikvision.com.cn>
---
.../streampark-console-webapp/src/views/flink/app/Add.vue | 3 +++
.../src/views/flink/app/EditStreamPark.vue | 13 ++++++++++++-
.../src/views/flink/app/hooks/useCreateAndEditSchema.ts | 4 ++--
3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/app/Add.vue b/streampark-console/streampark-console-webapp/src/views/flink/app/Add.vue
index 44dc27967..7df480ec1 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/app/Add.vue
+++ b/streampark-console/streampark-console-webapp/src/views/flink/app/Add.vue
@@ -169,6 +169,9 @@
})[0] || null;
if (cluster) {
Object.assign(values, { flinkClusterId: cluster.id });
+ if (values.executionMode == ExecModeEnum.KUBERNETES_SESSION) {
+ Object.assign(values, { clusterId: cluster.clusterId });
+ }
}
}
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/app/EditStreamPark.vue b/streampark-console/streampark-console-webapp/src/views/flink/app/EditStreamPark.vue
index c7e8c1824..fe9b18e4a 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/app/EditStreamPark.vue
+++ b/streampark-console/streampark-console-webapp/src/views/flink/app/EditStreamPark.vue
@@ -52,7 +52,7 @@
import { useGo } from '/@/hooks/web/usePage';
import ProgramArgs from './components/ProgramArgs.vue';
import VariableReview from './components/VariableReview.vue';
- import { ExecModeEnum, JobTypeEnum, UseStrategyEnum } from '/@/enums/flinkEnum';
+ import { ClusterStateEnum, ExecModeEnum, JobTypeEnum, UseStrategyEnum } from '/@/enums/flinkEnum';
const route = useRoute();
const go = useGo();
@@ -80,6 +80,7 @@
const {
alerts,
flinkEnvs,
+ flinkClusters,
flinkSql,
getEditStreamParkFormSchema,
registerDifferentDrawer,
@@ -254,6 +255,16 @@
/* Send submission interface */
async function handleUpdateApp(params: Recordable) {
+ if (params.executionMode == ExecModeEnum.KUBERNETES_SESSION) {
+ const cluster =
+ unref(flinkClusters).filter((c) => {
+ return c.id == params.flinkClusterId && c.clusterState === ClusterStateEnum.STARTED;
+ })[0] || null;
+ if (cluster) {
+ Object.assign(params, { clusterId: cluster.clusterId });
+ }
+ }
+
try {
const updated = await fetchUpdate(params);
if (updated) {
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/app/hooks/useCreateAndEditSchema.ts b/streampark-console/streampark-console-webapp/src/views/flink/app/hooks/useCreateAndEditSchema.ts
index 19d8c57d5..9281adbcc 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/app/hooks/useCreateAndEditSchema.ts
+++ b/streampark-console/streampark-console-webapp/src/views/flink/app/hooks/useCreateAndEditSchema.ts
@@ -285,13 +285,13 @@ export const useCreateAndEditSchema = (
],
},
{
- field: 'clusterId',
+ field: 'flinkClusterId',
label: t('flink.app.kubernetesClusterId'),
component: 'Select',
ifShow: ({ values }) => values.executionMode == ExecModeEnum.KUBERNETES_SESSION,
componentProps: {
placeholder: t('flink.app.addAppTips.kubernetesClusterIdPlaceholder'),
- options: getExecutionCluster(ExecModeEnum.KUBERNETES_SESSION, 'clusterId'),
+ options: getExecutionCluster(ExecModeEnum.KUBERNETES_SESSION, 'id'),
},
rules: [
{