File tree Expand file tree Collapse file tree 4 files changed +88
-0
lines changed
flink-kubernetes-operator-api
java/org/apache/flink/kubernetes/operator/api/validation Expand file tree Collapse file tree 4 files changed +88
-0
lines changed Original file line number Diff line number Diff line change @@ -257,6 +257,23 @@ under the License.
257
257
</target >
258
258
</configuration >
259
259
</execution >
260
+ <execution >
261
+ <id >statesnapshot-crd-compatibility-check</id >
262
+ <phase >package</phase >
263
+ <goals >
264
+ <goal >run</goal >
265
+ </goals >
266
+ <configuration >
267
+ <target >
268
+ <java classname =" org.apache.flink.kubernetes.operator.api.validation.CrdCompatibilityChecker"
269
+ fork =" true" failonerror =" true" >
270
+ <classpath refid =" maven.compile.classpath" />
271
+ <arg value =" file://${rootDir}/helm/flink-kubernetes-operator/crds/flinkstatesnapshots.flink.apache.org-v1.yml" />
272
+ <arg value =" https://raw.githubusercontent.com/apache/flink-kubernetes-operator/release-1.10.0/helm/flink-kubernetes-operator/crds/flinkstatesnapshots.flink.apache.org-v1.yml" />
273
+ </java >
274
+ </target >
275
+ </configuration >
276
+ </execution >
260
277
</executions >
261
278
</plugin >
262
279
<plugin >
Original file line number Diff line number Diff line change 19
19
20
20
import org .apache .flink .kubernetes .operator .api .FlinkDeployment ;
21
21
import org .apache .flink .kubernetes .operator .api .FlinkSessionJob ;
22
+ import org .apache .flink .kubernetes .operator .api .FlinkStateSnapshot ;
22
23
23
24
import com .fasterxml .jackson .core .JsonProcessingException ;
24
25
import com .fasterxml .jackson .databind .ObjectMapper ;
@@ -271,6 +272,19 @@ public void testCreateFlinkDeploymentIgnoreUnknownFields() throws IOException {
271
272
assertEquals (flinkDeploymentWithUnknownFields .toString (), flinkDeployment .toString ());
272
273
}
273
274
275
+ @ Test
276
+ public void testCreateFlinkStateSnapshotIgnoreUnknownFields () throws IOException {
277
+ FlinkStateSnapshot flinkSnapshotWithUnknownFields =
278
+ objectMapper .readValue (
279
+ new File ("src/test/resources/test-snapshot-with-unknown-fields.yaml" ),
280
+ FlinkStateSnapshot .class );
281
+ FlinkStateSnapshot flinkSnapshot =
282
+ objectMapper .readValue (
283
+ new File ("src/test/resources/test-snapshot.yaml" ),
284
+ FlinkStateSnapshot .class );
285
+ assertEquals (flinkSnapshotWithUnknownFields .toString (), flinkSnapshot .toString ());
286
+ }
287
+
274
288
@ Test
275
289
public void testGetSchemaFromUrl () throws IOException {
276
290
var fileUrl =
Original file line number Diff line number Diff line change
1
+ # ###############################################################################
2
+ # Licensed to the Apache Software Foundation (ASF) under one
3
+ # or more contributor license agreements. See the NOTICE file
4
+ # distributed with this work for additional information
5
+ # regarding copyright ownership. The ASF licenses this file
6
+ # to you under the Apache License, Version 2.0 (the
7
+ # "License"); you may not use this file except in compliance
8
+ # with the License. You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ # ###############################################################################
18
+ apiVersion : flink.apache.org/v1beta1
19
+ kind : FlinkStateSnapshot
20
+ metadata :
21
+ name : example-savepoint
22
+ spec :
23
+ backoffLimit : 0
24
+ jobReference :
25
+ kind : FlinkDeployment
26
+ name : example-deployment
27
+ unknownField : testUnknownField
28
+ savepoint :
29
+ unknownField : testUnknownField
30
+ unknownField : testUnknownField
Original file line number Diff line number Diff line change
1
+ # ###############################################################################
2
+ # Licensed to the Apache Software Foundation (ASF) under one
3
+ # or more contributor license agreements. See the NOTICE file
4
+ # distributed with this work for additional information
5
+ # regarding copyright ownership. The ASF licenses this file
6
+ # to you under the Apache License, Version 2.0 (the
7
+ # "License"); you may not use this file except in compliance
8
+ # with the License. You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ # ###############################################################################
18
+ apiVersion : flink.apache.org/v1beta1
19
+ kind : FlinkStateSnapshot
20
+ metadata :
21
+ name : example-savepoint
22
+ spec :
23
+ backoffLimit : 0
24
+ jobReference :
25
+ kind : FlinkDeployment
26
+ name : example-deployment
27
+ savepoint : {}
You can’t perform that action at this time.
0 commit comments