Skip to content

Commit 22db0a9

Browse files
committed
test
1 parent ff489f2 commit 22db0a9

File tree

4 files changed

+56
-1
lines changed

4 files changed

+56
-1
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,20 @@ jobs:
121121
- test_multi_sessionjob.sh
122122
- test_autoscaler.sh
123123
- test_dynamic_config.sh
124+
- test_dynamic_flink_conf.sh
124125
exclude:
125126
- mode: standalone
126127
test: test_autoscaler.sh
127128
- mode: standalone
128129
test: test_dynamic_config.sh
130+
- mode: standalone
131+
test: test_dynamic_flink_conf.sh
129132
- flink-version: v1_16
130133
test: test_autoscaler.sh
131134
- flink-version: v1_16
132135
test: test_dynamic_config.sh
136+
- flink-version: v1_16
137+
test: test_dynamic_flink_conf.sh
133138

134139
uses: ./.github/workflows/e2e.yaml
135140
with:
@@ -156,6 +161,7 @@ jobs:
156161
- test_application_kubernetes_ha.sh
157162
- test_application_operations.sh
158163
- test_dynamic_config.sh
164+
- test_dynamic_flink_conf.sh
159165
- test_sessionjob_kubernetes_ha.sh
160166
- test_sessionjob_operations.sh
161167
- test_autoscaler.sh
@@ -169,6 +175,8 @@ jobs:
169175
test: test_autoscaler.sh
170176
- flink-version: v1_16
171177
test: test_dynamic_config.sh
178+
- flink-version: v1_16
179+
test: test_dynamic_flink_conf.sh
172180
- flink-version: v1_16
173181
test: test_flink_operator_ha.sh
174182
- flink-version: v1_16
@@ -177,6 +185,8 @@ jobs:
177185
test: test_batch_job.sh
178186
- flink-version: v1_17
179187
test: test_dynamic_config.sh
188+
- flink-version: v1_17
189+
test: test_dynamic_flink_conf.sh
180190
- flink-version: v1_17
181191
test: test_flink_operator_ha.sh
182192
- flink-version: v1_17
@@ -185,6 +195,8 @@ jobs:
185195
test: test_batch_job.sh
186196
- flink-version: v1_18
187197
test: test_dynamic_config.sh
198+
- flink-version: v1_18
199+
test: test_dynamic_flink_conf.sh
188200
- flink-version: v1_18
189201
test: test_flink_operator_ha.sh
190202
- flink-version: v1_18

.github/workflows/e2e.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ jobs:
7575
sed -i "s/# kubernetes.operator.leader-election.lease-name: flink-operator-lease/kubernetes.operator.leader-election.lease-name: flink-operator-lease/" helm/flink-kubernetes-operator/conf/flink-conf.yaml
7676
sed -i "s/replicas: 1/replicas: 2/" helm/flink-kubernetes-operator/values.yaml
7777
fi
78+
if [[ "${{ inputs.test }}" == "test_dynamic_config.sh" ]]; then
79+
sed -i "s/flink-conf.yaml: |+/config.yaml: |+/" helm/flink-kubernetes-operator/values.yaml
80+
fi
7881
helm --debug install flink-kubernetes-operator -n ${{ inputs.namespace }} helm/flink-kubernetes-operator --set image.repository=flink-kubernetes-operator --set image.tag=ci-latest ${{ steps.namespace-creator.outputs.EXTRA_HELM_INSTALL_ARGS }}
7982
kubectl wait --for=condition=Available --timeout=120s -n ${{ inputs.namespace }} deploy/flink-kubernetes-operator
8083
kubectl get pods -n ${{ inputs.namespace }}

e2e-tests/test_dynamic_config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ echo "Current operator pod is ${operator_pod}"
3434
create_namespace dynamic
3535

3636
kubectl config set-context --current --namespace="${operator_namespace}"
37-
patch_flink_config '{"data": {"flink-conf.yaml": "kubernetes.operator.watched.namespaces: default,flink,dynamic"}}'
37+
patch_flink_config '{"data": {"config.yaml": "kubernetes.operator.watched.namespaces: default,flink,dynamic"}}'
3838
wait_for_operator_logs "${operator_pod}" "Setting default configuration to {kubernetes.operator.watched.namespaces=default,flink,dynamic}" ${TIMEOUT} || exit 1
3939

4040
echo "Successfully run the dynamic property test"
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env bash
2+
################################################################################
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
################################################################################
19+
20+
# This script tests the operator dynamic config on watched namespace:
21+
# 1. Create a new namespace
22+
# 2. Change the watched namespaces by patching on the flink-config-override
23+
# 3. Monitor the operator log to find the watched namespace changed info
24+
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
25+
source "${SCRIPT_DIR}/utils.sh"
26+
27+
on_exit operator_cleanup_and_exit
28+
29+
TIMEOUT=360
30+
31+
operator_namespace=$(get_operator_pod_namespace)
32+
operator_pod=$(get_operator_pod_name)
33+
echo "Current operator pod is ${operator_pod}"
34+
create_namespace dynamic
35+
36+
kubectl config set-context --current --namespace="${operator_namespace}"
37+
patch_flink_config '{"data": {"flink-conf.yaml": "kubernetes.operator.watched.namespaces: default,flink,dynamic"}}'
38+
wait_for_operator_logs "${operator_pod}" "Setting default configuration to {kubernetes.operator.watched.namespaces=default,flink,dynamic}" ${TIMEOUT} || exit 1
39+
40+
echo "Successfully run the dynamic property test"

0 commit comments

Comments
 (0)