From d354bd40e0b5b54091028e74c496eb3a0ea9e59c Mon Sep 17 00:00:00 2001 From: dbarbosa Date: Thu, 4 Jan 2024 20:53:31 -0300 Subject: [PATCH] Correction to metrics-server failing to apply When adding the lifecycle_metrics_server.py file to the plugin and not calling the super class that inherits lifecycle's default behavior, this creates a side effect and means that the namespace is not created before the command "kubectl apply -k ". To solve the problem, the super class is added to the app_lifecycle_actions function and the application is able to apply correctly again. Test Plan: PASS: build-pkgs -c -p metrics-server-helm PASS: build-pkgs -c -p python3-k8sapp-metrics-server PASS: build-pkgs -c -p stx-metrics-server-helm PASS: upload/apply/remove/delete metrics-server Closes-Bug: 2047175 Change-Id: I52580894f5d5283a989fb03a573089916dfe7b8c Signed-off-by: David Bastos --- .../lifecycle/lifecycle_metrics_server.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python3-k8sapp-metrics-server/k8sapp_metrics_server/k8sapp_metrics_server/lifecycle/lifecycle_metrics_server.py b/python3-k8sapp-metrics-server/k8sapp_metrics_server/k8sapp_metrics_server/lifecycle/lifecycle_metrics_server.py index cec1ecc..87a2cef 100644 --- a/python3-k8sapp-metrics-server/k8sapp_metrics_server/k8sapp_metrics_server/lifecycle/lifecycle_metrics_server.py +++ b/python3-k8sapp-metrics-server/k8sapp_metrics_server/k8sapp_metrics_server/lifecycle/lifecycle_metrics_server.py @@ -25,3 +25,7 @@ class MetricsServerAppLifecycleOperator(base.AppLifecycleOperator): :param app: AppOperator.Application object :param hook_info: LifecycleHookInfo object """ + + # Use the default behaviour for other hooks + super(MetricsServerAppLifecycleOperator, self).app_lifecycle_actions( + context, conductor_obj, app_op, app, hook_info)