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/07 12:52:53 UTC

[GitHub] [incubator-streampark] 1996fanrui opened a new pull request, #2239: [Bug] Adapt to multiple versions of FlinkKubeClient

1996fanrui opened a new pull request, #2239:
URL: https://github.com/apache/incubator-streampark/pull/2239

   ## What changes were proposed in this pull request
   
   Issue Number: close #2188 
   
   Adapt to multiple versions of FlinkKubeClient.
   
   ## Brief change log
   
   Adapt to multiple versions of FlinkKubeClient
   
   ## Verifying this change
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   
   ## Does this pull request potentially affect one of the following parts
    - Dependencies (does it add or upgrade a dependency): no
   


-- 
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


[GitHub] [incubator-streampark] wolfboys merged pull request #2239: [Bug] Adapt to multiple versions of FlinkKubeClient

Posted by GitBox <gi...@apache.org>.
wolfboys merged PR #2239:
URL: https://github.com/apache/incubator-streampark/pull/2239


-- 
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


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

Posted by GitBox <gi...@apache.org>.
wolfboys commented on code in PR #2239:
URL: https://github.com/apache/incubator-streampark/pull/2239#discussion_r1064123035


##########
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:
   A little suggestion, you can add a comment. e.g:
   // getRestService method changed after flink 1.15+, refer: https://issues.apache.org/jira/browse/FLINK-24947
   



-- 
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


[GitHub] [incubator-streampark] 1996fanrui commented on pull request #2239: [Bug] Adapt to multiple versions of FlinkKubeClient

Posted by GitBox <gi...@apache.org>.
1996fanrui commented on PR #2239:
URL: https://github.com/apache/incubator-streampark/pull/2239#issuecomment-1374472442

   Hi @wolfboys @monrg , I have updated the PR, please help take a look in your free time, thanks~
   
   It just addressed the multiple flink versions, didn't address other issues in #2229 .


-- 
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


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

Posted by GitBox <gi...@apache.org>.
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


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

Posted by GitBox <gi...@apache.org>.
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,I tested Flink 1.2/1.3/1.4/1.5/1.6, and started Kubernetes-Session function,everything is ok.



-- 
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


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

Posted by GitBox <gi...@apache.org>.
wolfboys commented on PR #2239:
URL: https://github.com/apache/incubator-streampark/pull/2239#issuecomment-1374522755

   Thanks for your contribution, LGTM, but I don't have the k8s environment,  @monrg @daixiaoyu please help to test it. thanks.


-- 
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