Skip to content

Commit 1d3eed0

Browse files
authored
Merge branch 'apache:main' into fix-missing-JM-status
2 parents 1c7cacf + 45192f5 commit 1d3eed0

File tree

12 files changed

+347
-8
lines changed

12 files changed

+347
-8
lines changed

docs/content.zh/docs/operations/rbac.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ For each additional namespace that runs the Flink jobs, users need to do the fol
8585
- apps
8686
resources:
8787
- deployments
88+
- deployments/finalizers
8889
verbs:
8990
- '*'
9091
---

docs/content/docs/operations/rbac.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ For each additional namespace that runs the Flink jobs, users need to do the fol
8585
- apps
8686
resources:
8787
- deployments
88+
- deployments/finalizers
8889
verbs:
8990
- '*'
9091
---

docs/layouts/shortcodes/generated/dynamic_section.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,12 @@
194194
<td>Duration</td>
195195
<td>The interval before a savepoint trigger attempt is marked as unsuccessful.</td>
196196
</tr>
197+
<tr>
198+
<td><h5>kubernetes.operator.session.block-on-unmanaged-jobs</h5></td>
199+
<td style="word-wrap: break-word;">true</td>
200+
<td>Boolean</td>
201+
<td>Block FlinkDeployment deletion if unmanaged jobs (jobs not managed by FlinkSessionJob resources) are running in the session cluster. Example: Jobs submitted via CLI.</td>
202+
</tr>
197203
<tr>
198204
<td><h5>kubernetes.operator.snapshot.resource.enabled</h5></td>
199205
<td style="word-wrap: break-word;">true</td>

docs/layouts/shortcodes/generated/kubernetes_operator_config_configuration.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,12 @@
416416
<td>Duration</td>
417417
<td>The interval before a savepoint trigger attempt is marked as unsuccessful.</td>
418418
</tr>
419+
<tr>
420+
<td><h5>kubernetes.operator.session.block-on-unmanaged-jobs</h5></td>
421+
<td style="word-wrap: break-word;">true</td>
422+
<td>Boolean</td>
423+
<td>Block FlinkDeployment deletion if unmanaged jobs (jobs not managed by FlinkSessionJob resources) are running in the session cluster. Example: Jobs submitted via CLI.</td>
424+
</tr>
419425
<tr>
420426
<td><h5>kubernetes.operator.snapshot.resource.enabled</h5></td>
421427
<td style="word-wrap: break-word;">true</td>

examples/autoscaling/src/main/java/autoscaling/LoadSimulationPipeline.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
*
5656
* A concrete example: "1;2;4\n4;2;1"
5757
* Two branches are created with three tasks each. On the first branch, the tasks have
58-
* a load of 1, 2, and 3 respectively. On the second branch, the tasks have the load reversed.
58+
* a load of 1, 2, and 4 respectively. On the second branch, the tasks have the load reversed.
5959
* This means, that at peak Flink Autoscaling at target utilization of 0.5, the parallelisms of
6060
* the tasks will be 2, 4, 8 for branch one and vise-versa for branch two.
6161
* </pre>

flink-kubernetes-operator-api/pom.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,23 @@ under the License.
257257
</target>
258258
</configuration>
259259
</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>
260277
</executions>
261278
</plugin>
262279
<plugin>

flink-kubernetes-operator-api/src/test/java/org/apache/flink/kubernetes/operator/api/validation/CrdCompatibilityCheckerTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import org.apache.flink.kubernetes.operator.api.FlinkDeployment;
2121
import org.apache.flink.kubernetes.operator.api.FlinkSessionJob;
22+
import org.apache.flink.kubernetes.operator.api.FlinkStateSnapshot;
2223

2324
import com.fasterxml.jackson.core.JsonProcessingException;
2425
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -271,6 +272,19 @@ public void testCreateFlinkDeploymentIgnoreUnknownFields() throws IOException {
271272
assertEquals(flinkDeploymentWithUnknownFields.toString(), flinkDeployment.toString());
272273
}
273274

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+
274288
@Test
275289
public void testGetSchemaFromUrl() throws IOException {
276290
var fileUrl =
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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: {}

flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/config/KubernetesOperatorConfigOptions.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,14 @@ public static String operatorConfigKey(String key) {
647647
.withDescription(
648648
"Indicate whether the job should be drained when stopping with savepoint.");
649649

650+
@Documentation.Section(SECTION_DYNAMIC)
651+
public static final ConfigOption<Boolean> BLOCK_ON_UNMANAGED_JOBS =
652+
operatorConfig("session.block-on-unmanaged-jobs")
653+
.booleanType()
654+
.defaultValue(true)
655+
.withDescription(
656+
"Block FlinkDeployment deletion if unmanaged jobs (jobs not managed by FlinkSessionJob resources) are running in the session cluster. Example: Jobs submitted via CLI.");
657+
650658
@Documentation.Section(SECTION_ADVANCED)
651659
public static final ConfigOption<Duration> REFRESH_CLUSTER_RESOURCE_VIEW =
652660
operatorConfig("cluster.resource-view.refresh-interval")

0 commit comments

Comments
 (0)