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 1fe20d479 Extract common const FLINK_NATIVE_KUBERNETES_LABEL (#2939)
1fe20d479 is described below

commit 1fe20d4790ffe52d34bb03b080a31bae58783111
Author: ChengJie1053 <[email protected]>
AuthorDate: Tue Aug 15 14:23:05 2023 +0800

    Extract common const FLINK_NATIVE_KUBERNETES_LABEL (#2939)
---
 .../main/scala/org/apache/streampark/common/conf/ConfigConst.scala    | 2 ++
 .../org/apache/streampark/flink/kubernetes/KubernetesRetriever.scala  | 3 ++-
 .../apache/streampark/flink/kubernetes/ingress/IngressStrategy.scala  | 4 +++-
 .../streampark/flink/kubernetes/watcher/FlinkK8sEventWatcher.scala    | 3 ++-
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git 
a/streampark-common/src/main/scala/org/apache/streampark/common/conf/ConfigConst.scala
 
b/streampark-common/src/main/scala/org/apache/streampark/common/conf/ConfigConst.scala
index 75c0b4e9c..2d6b74fba 100644
--- 
a/streampark-common/src/main/scala/org/apache/streampark/common/conf/ConfigConst.scala
+++ 
b/streampark-common/src/main/scala/org/apache/streampark/common/conf/ConfigConst.scala
@@ -113,6 +113,8 @@ object ConfigConst {
 
   val KEY_K8S_IMAGE_PULL_POLICY = "kubernetes.container.image.pull-policy"
 
+  val FLINK_NATIVE_KUBERNETES_LABEL = "flink-native-kubernetes"
+
   // ---table---
   val KEY_FLINK_TABLE_PLANNER = "flink.table.planner"
 
diff --git 
a/streampark-flink/streampark-flink-kubernetes/src/main/scala/org/apache/streampark/flink/kubernetes/KubernetesRetriever.scala
 
b/streampark-flink/streampark-flink-kubernetes/src/main/scala/org/apache/streampark/flink/kubernetes/KubernetesRetriever.scala
index 17a5df525..01b86f1ca 100644
--- 
a/streampark-flink/streampark-flink-kubernetes/src/main/scala/org/apache/streampark/flink/kubernetes/KubernetesRetriever.scala
+++ 
b/streampark-flink/streampark-flink-kubernetes/src/main/scala/org/apache/streampark/flink/kubernetes/KubernetesRetriever.scala
@@ -17,6 +17,7 @@
 
 package org.apache.streampark.flink.kubernetes
 
+import org.apache.streampark.common.conf.ConfigConst
 import org.apache.streampark.common.util.{Logger, Utils}
 import org.apache.streampark.common.util.Utils.using
 import org.apache.streampark.flink.kubernetes.enums.FlinkK8sExecuteMode
@@ -113,7 +114,7 @@ object KubernetesRetriever extends Logger {
           .apps()
           .deployments()
           .inNamespace(namespace)
-          .withLabel("type", "flink-native-kubernetes")
+          .withLabel("type", ConfigConst.FLINK_NATIVE_KUBERNETES_LABEL)
           .list()
           .getItems
           .asScala
diff --git 
a/streampark-flink/streampark-flink-kubernetes/src/main/scala/org/apache/streampark/flink/kubernetes/ingress/IngressStrategy.scala
 
b/streampark-flink/streampark-flink-kubernetes/src/main/scala/org/apache/streampark/flink/kubernetes/ingress/IngressStrategy.scala
index e03d3ae5a..e348bf4b8 100644
--- 
a/streampark-flink/streampark-flink-kubernetes/src/main/scala/org/apache/streampark/flink/kubernetes/ingress/IngressStrategy.scala
+++ 
b/streampark-flink/streampark-flink-kubernetes/src/main/scala/org/apache/streampark/flink/kubernetes/ingress/IngressStrategy.scala
@@ -17,6 +17,8 @@
 
 package org.apache.streampark.flink.kubernetes.ingress
 
+import org.apache.streampark.common.conf.ConfigConst
+
 import io.fabric8.kubernetes.api.model.{OwnerReference, OwnerReferenceBuilder}
 import io.fabric8.kubernetes.client.DefaultKubernetesClient
 import org.apache.commons.io.FileUtils
@@ -56,7 +58,7 @@ trait IngressStrategy {
   def buildIngressLabels(clusterId: String): Map[String, String] = {
     Map(
       "app" -> clusterId,
-      "type" -> "flink-native-kubernetes",
+      "type" -> ConfigConst.FLINK_NATIVE_KUBERNETES_LABEL,
       "component" -> "ingress"
     )
   }
diff --git 
a/streampark-flink/streampark-flink-kubernetes/src/main/scala/org/apache/streampark/flink/kubernetes/watcher/FlinkK8sEventWatcher.scala
 
b/streampark-flink/streampark-flink-kubernetes/src/main/scala/org/apache/streampark/flink/kubernetes/watcher/FlinkK8sEventWatcher.scala
index 8e9c348d1..07cb87f68 100644
--- 
a/streampark-flink/streampark-flink-kubernetes/src/main/scala/org/apache/streampark/flink/kubernetes/watcher/FlinkK8sEventWatcher.scala
+++ 
b/streampark-flink/streampark-flink-kubernetes/src/main/scala/org/apache/streampark/flink/kubernetes/watcher/FlinkK8sEventWatcher.scala
@@ -17,6 +17,7 @@
 
 package org.apache.streampark.flink.kubernetes.watcher
 
+import org.apache.streampark.common.conf.ConfigConst
 import org.apache.streampark.common.util.Logger
 import org.apache.streampark.flink.kubernetes.{FlinkK8sWatchController, 
KubernetesRetriever}
 import org.apache.streampark.flink.kubernetes.model.{K8sDeploymentEventCV, 
K8sEventKey}
@@ -66,7 +67,7 @@ class FlinkK8sEventWatcher(implicit watchController: 
FlinkK8sWatchController)
     k8sClient
       .apps()
       .deployments()
-      .withLabel("type", "flink-native-kubernetes")
+      .withLabel("type", ConfigConst.FLINK_NATIVE_KUBERNETES_LABEL)
       .watch(new CompatibleKubernetesWatcher[Deployment, 
CompKubernetesDeployment] {
         override def eventReceived(action: Watcher.Action, event: Deployment): 
Unit = {
           handleDeploymentEvent(action, event)

Reply via email to