Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Commit a5eb655

Browse files
Add script to ensure correct env variables (#19)
Signed-off-by: michal.gubricky <[email protected]> Co-authored-by: Matej Feder <[email protected]>
1 parent c31dd39 commit a5eb655

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,5 +563,5 @@ builder-image-push: ## Build $(CONTROLLER_SHORT)-builder to a new version. For m
563563
# test: test-unit test-integration ## Runs all unit and integration tests.
564564

565565
.PHONY: tilt-up
566-
tilt-up: $(ENVSUBST) $(KUBECTL) $(KUSTOMIZE) $(TILT) cluster ## Start a mgt-cluster & Tilt. Installs the CRDs and deploys the controllers
566+
tilt-up: env-vars-for-wl-cluster $(ENVSUBST) $(KUBECTL) $(KUSTOMIZE) $(TILT) cluster ## Start a mgt-cluster & Tilt. Installs the CRDs and deploys the controllers
567567
EXP_CLUSTER_RESOURCE_SET=true $(TILT) up --port=10351

hack/ensure-env-variables.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
# Copyright 2023 The Kubernetes Authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
if [ "$#" -lt 1 ]; then
17+
echo "Usage: $0 VAR1 VAR2 ..."
18+
exit 1
19+
fi
20+
21+
missing_vars=()
22+
for varname in "$@"; do
23+
eval varvalue="\$$varname"
24+
if [ -z "$varvalue" ]; then
25+
missing_vars+=("$varname")
26+
fi
27+
done
28+
29+
if [ ${#missing_vars[@]} -gt 0 ]; then
30+
echo "Missing or empty environment variables: ${missing_vars[*]}"
31+
exit 1
32+
fi

0 commit comments

Comments
 (0)