From 07f1fc121480284af72da4f8e7df6df7894b1190 Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Tue, 24 Oct 2023 11:38:31 -0600 Subject: [PATCH 1/5] using pyyaml library, ruamel is deprecated --- build/fix_namespace.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/build/fix_namespace.py b/build/fix_namespace.py index aa04df2b0..7777f85c7 100755 --- a/build/fix_namespace.py +++ b/build/fix_namespace.py @@ -1,17 +1,15 @@ #!/usr/bin/env python import sys -import ruamel.yaml +import yaml filename = sys.argv[1] namespace = sys.argv[2] -yaml = ruamel.yaml.YAML() - print(f"Replacing: {filename} - {namespace}") with open(filename, "r") as f: - yaml_data = ruamel.yaml.round_trip_load(f) + yaml_data = yaml.safe_load(f) for i, env in enumerate(yaml_data['spec']['template']['spec']['containers'][0]['env']): if env['name'] == "STRIMZI_NAMESPACE": try: @@ -21,4 +19,4 @@ yaml_data['spec']['template']['spec']['containers'][0]['env'][i]['value'] = namespace with open(filename, "w") as f: - ruamel.yaml.round_trip_dump(yaml_data, f, indent=2) + yaml.dump(yaml_data, f, indent=2) From 98021d17048ecc35075dba7deba9a1339e64e83b Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Tue, 24 Oct 2023 12:34:16 -0600 Subject: [PATCH 2/5] testing that pyyaml is installed --- build/delete_this.py | 3 +++ pr_check.sh | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 build/delete_this.py diff --git a/build/delete_this.py b/build/delete_this.py new file mode 100644 index 000000000..c8babd869 --- /dev/null +++ b/build/delete_this.py @@ -0,0 +1,3 @@ +import yaml + +print('delete this') \ No newline at end of file diff --git a/pr_check.sh b/pr_check.sh index 0b74b22fa..f476269d2 100755 --- a/pr_check.sh +++ b/pr_check.sh @@ -42,6 +42,11 @@ done <<< "$(git log --pretty=format:%s $(git merge-base master HEAD)..HEAD)" set -exv +# ------------ DELETE THIS ------------------- +ROOT_DIR=$(pwd) +$ROOT_DIR/build/${FIX_NAMESPACE_SCRIPT} +# ------------ DELETE THIS ------------------- + BASE_TAG=`cat go.mod go.sum Dockerfile.base | sha256sum | head -c 8` BASE_IMG=quay.io/cloudservices/clowder-base:$BASE_TAG From a0fcad11bb23322420254d5c41b580886bfbd0f6 Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Tue, 24 Oct 2023 12:35:31 -0600 Subject: [PATCH 3/5] fix file to run --- pr_check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pr_check.sh b/pr_check.sh index f476269d2..3f0abed0b 100755 --- a/pr_check.sh +++ b/pr_check.sh @@ -44,7 +44,7 @@ set -exv # ------------ DELETE THIS ------------------- ROOT_DIR=$(pwd) -$ROOT_DIR/build/${FIX_NAMESPACE_SCRIPT} +$ROOT_DIR/build/delete_this.py # ------------ DELETE THIS ------------------- BASE_TAG=`cat go.mod go.sum Dockerfile.base | sha256sum | head -c 8` From 8812a450c0a2c57a01d837e7c89c8423655f68e8 Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Tue, 24 Oct 2023 12:38:29 -0600 Subject: [PATCH 4/5] fixing run script --- pr_check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pr_check.sh b/pr_check.sh index 3f0abed0b..d2286afa4 100755 --- a/pr_check.sh +++ b/pr_check.sh @@ -44,7 +44,7 @@ set -exv # ------------ DELETE THIS ------------------- ROOT_DIR=$(pwd) -$ROOT_DIR/build/delete_this.py +python3 $ROOT_DIR/build/delete_this.py # ------------ DELETE THIS ------------------- BASE_TAG=`cat go.mod go.sum Dockerfile.base | sha256sum | head -c 8` From 6410524bd85c22b53875027ef20a40eec9f30b39 Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Tue, 24 Oct 2023 12:45:12 -0600 Subject: [PATCH 5/5] removing test code --- build/delete_this.py | 3 --- pr_check.sh | 5 ----- 2 files changed, 8 deletions(-) delete mode 100644 build/delete_this.py diff --git a/build/delete_this.py b/build/delete_this.py deleted file mode 100644 index c8babd869..000000000 --- a/build/delete_this.py +++ /dev/null @@ -1,3 +0,0 @@ -import yaml - -print('delete this') \ No newline at end of file diff --git a/pr_check.sh b/pr_check.sh index d2286afa4..0b74b22fa 100755 --- a/pr_check.sh +++ b/pr_check.sh @@ -42,11 +42,6 @@ done <<< "$(git log --pretty=format:%s $(git merge-base master HEAD)..HEAD)" set -exv -# ------------ DELETE THIS ------------------- -ROOT_DIR=$(pwd) -python3 $ROOT_DIR/build/delete_this.py -# ------------ DELETE THIS ------------------- - BASE_TAG=`cat go.mod go.sum Dockerfile.base | sha256sum | head -c 8` BASE_IMG=quay.io/cloudservices/clowder-base:$BASE_TAG