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