You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@streampark.apache.org by GitBox <gi...@apache.org> on 2023/01/09 15:29:01 UTC

[GitHub] [incubator-streampark] monrg commented on a diff in pull request #2239: [Bug] Adapt to multiple versions of FlinkKubeClient

monrg commented on code in PR #2239:
URL: https://github.com/apache/incubator-streampark/pull/2239#discussion_r1064769056


##########
streampark-flink/streampark-flink-shims/streampark-flink-shims-base/src/main/scala/org/apache/streampark/flink/core/FlinkKubernetesClientTrait.scala:
##########
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.streampark.flink.core
+
+import org.apache.flink.kubernetes.kubeclient.FlinkKubeClient
+import org.apache.flink.kubernetes.kubeclient.resources.KubernetesService
+
+import java.util.Optional
+
+abstract class FlinkKubernetesClientTrait(kubeClient: FlinkKubeClient) {
+
+  /**
+   * Get the kubernetes service of the given flink clusterId.
+   *
+   * @param serviceName the name of the service
+   * @return Return the optional kubernetes service of the specified name.
+   */
+  def getService(serviceName: String): Optional[KubernetesService] = kubeClient.getRestService(serviceName)

Review Comment:
   @1996fanrui Thanks for your contribution,II tested Flink 1.2/1.3/1.4/1.5/1.6, and started Flink Kubernetes-Session function.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org