This is an automated email from the ASF dual-hosted git repository.

gyfora pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/flink-kubernetes-operator.git


The following commit(s) were added to refs/heads/main by this push:
     new f41025da [FLINK-28966] Check backward compatibility against both 1.1.0 
and 1.0.0 (all released versions)
f41025da is described below

commit f41025da98d21c4e8404b6554e9c3d6a6ce0a4fb
Author: Matyas Orhidi <[email protected]>
AuthorDate: Mon Sep 19 18:16:40 2022 +0200

    [FLINK-28966] Check backward compatibility against both 1.1.0 and 1.0.0 
(all released versions)
---
 flink-kubernetes-operator/pom.xml                           |  8 ++++++--
 .../operator/validation/CrdCompatibilityChecker.java        | 13 ++++++++++---
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/flink-kubernetes-operator/pom.xml 
b/flink-kubernetes-operator/pom.xml
index 92574057..72c8429a 100644
--- a/flink-kubernetes-operator/pom.xml
+++ b/flink-kubernetes-operator/pom.xml
@@ -364,8 +364,10 @@ under the License.
                                 <java 
classname="org.apache.flink.kubernetes.operator.validation.CrdCompatibilityChecker"
                                       fork="true" failonerror="true">
                                     <classpath 
refid="maven.compile.classpath"/>
-                                    <arg 
value="https://raw.githubusercontent.com/apache/flink-kubernetes-operator/release-1.0.0/helm/flink-kubernetes-operator/crds/flinkdeployments.flink.apache.org-v1.yml"/>
                                     <arg 
value="file://${rootDir}/helm/flink-kubernetes-operator/crds/flinkdeployments.flink.apache.org-v1.yml"/>
+                                    <arg 
value="https://raw.githubusercontent.com/apache/flink-kubernetes-operator/release-1.0.0/helm/flink-kubernetes-operator/crds/flinkdeployments.flink.apache.org-v1.yml"/>
+                                    <arg 
value="https://raw.githubusercontent.com/apache/flink-kubernetes-operator/release-1.0.1/helm/flink-kubernetes-operator/crds/flinkdeployments.flink.apache.org-v1.yml"/>
+                                    <arg 
value="https://raw.githubusercontent.com/apache/flink-kubernetes-operator/release-1.1.0/helm/flink-kubernetes-operator/crds/flinkdeployments.flink.apache.org-v1.yml"/>
                                 </java>
                             </target>
                         </configuration>
@@ -381,8 +383,10 @@ under the License.
                                 <java 
classname="org.apache.flink.kubernetes.operator.validation.CrdCompatibilityChecker"
                                       fork="true" failonerror="true">
                                     <classpath 
refid="maven.compile.classpath"/>
-                                    <arg 
value="https://raw.githubusercontent.com/apache/flink-kubernetes-operator/release-1.0.0/helm/flink-kubernetes-operator/crds/flinksessionjobs.flink.apache.org-v1.yml"/>
                                     <arg 
value="file://${rootDir}/helm/flink-kubernetes-operator/crds/flinksessionjobs.flink.apache.org-v1.yml"/>
+                                    <arg 
value="https://raw.githubusercontent.com/apache/flink-kubernetes-operator/release-1.0.0/helm/flink-kubernetes-operator/crds/flinksessionjobs.flink.apache.org-v1.yml"/>
+                                    <arg 
value="https://raw.githubusercontent.com/apache/flink-kubernetes-operator/release-1.0.1/helm/flink-kubernetes-operator/crds/flinksessionjobs.flink.apache.org-v1.yml"/>
+                                    <arg 
value="https://raw.githubusercontent.com/apache/flink-kubernetes-operator/release-1.1.0/helm/flink-kubernetes-operator/crds/flinksessionjobs.flink.apache.org-v1.yml"/>
                                 </java>
                             </target>
                         </configuration>
diff --git 
a/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/validation/CrdCompatibilityChecker.java
 
b/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/validation/CrdCompatibilityChecker.java
index a10a2e18..e19638f9 100644
--- 
a/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/validation/CrdCompatibilityChecker.java
+++ 
b/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/validation/CrdCompatibilityChecker.java
@@ -51,7 +51,14 @@ public class CrdCompatibilityChecker {
     private static final ObjectMapper objectMapper = new ObjectMapper(new 
YAMLFactory());
 
     public static void main(String[] args) throws IOException {
-        checkObjectCompatibility("", getSchema(args[0]), getSchema(args[1]));
+
+        for (int i = 1; i < args.length; i++) {
+            String actualSchema = args[0];
+            String oldSchema = args[i];
+            logger.info("New schema: {}", actualSchema);
+            logger.info("Old schema: {}", oldSchema);
+            checkObjectCompatibility("", getSchema(oldSchema), 
getSchema(actualSchema));
+        }
         System.out.println("Successful validation!");
     }
 
@@ -80,9 +87,9 @@ public class CrdCompatibilityChecker {
                     checkObjectCompatibility(fieldPath, oldProps.get(field), 
newProps.get(field));
                 }
             }
-            logger.info("Successfully validated property names for {}", path);
+            logger.debug("Successfully validated property names for {}", path);
         } else {
-            logger.info("Successfully validated type for {}", path);
+            logger.debug("Successfully validated type for {}", path);
         }
     }
 

Reply via email to