From 29c061cb014785dd3a04360f441c1051a758209c Mon Sep 17 00:00:00 2001 From: Rakshit Parashar <34675136+ChillOrb@users.noreply.github.com> Date: Wed, 23 Aug 2023 22:50:09 -0700 Subject: [PATCH] fix: key error from detect for operatorsfromtca transformer (#1080) * fix: resolve key error in detect.py Signed-off-by: ChillOrb --- .../transformers/kubernetes/operatorsfromtca/detect.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/built-in/transformers/kubernetes/operatorsfromtca/detect.py b/assets/built-in/transformers/kubernetes/operatorsfromtca/detect.py index fbba68841..a54e86c18 100644 --- a/assets/built-in/transformers/kubernetes/operatorsfromtca/detect.py +++ b/assets/built-in/transformers/kubernetes/operatorsfromtca/detect.py @@ -33,10 +33,10 @@ def detect(input_dir): with open(fullFilePath) as f: collectFile = yaml.safe_load(f) # print("collectFile:", collectFile) - if ( - "apiVersion" not in collectFile - or collectFile["apiVersion"] != "move2kube.konveyor.io/v1alpha1" - ): + if "apiVersion" not in collectFile: + print(f"apiVersion key missing in the file:{fullFilePath}") + continue + if collectFile["apiVersion"] != "move2kube.konveyor.io/v1alpha1": print( f"apiVersion does not match. Expected: 'move2kube.konveyor.io/v1alpha1' Actual: {collectFile['apiVersion']}" )