From 6189a2e2f3e8cfcdbe56d8d2b8914f4f09dc21e3 Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Tue, 21 Feb 2023 20:38:21 +0000 Subject: [PATCH] Bugfix - chicken or egg situation. --- charts/jobs-manager-operator/Chart.yaml | 4 ++-- charts/jobs-manager-operator/values.yaml | 2 +- controllers/managedjob_controller.go | 7 ++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/charts/jobs-manager-operator/Chart.yaml b/charts/jobs-manager-operator/Chart.yaml index 6fc0276..eb9339d 100644 --- a/charts/jobs-manager-operator/Chart.yaml +++ b/charts/jobs-manager-operator/Chart.yaml @@ -13,12 +13,12 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.0.17 +version: 0.0.19 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.0.17" +appVersion: "0.0.19" keywords: - operator - jobs diff --git a/charts/jobs-manager-operator/values.yaml b/charts/jobs-manager-operator/values.yaml index 8623c04..9bab8a1 100644 --- a/charts/jobs-manager-operator/values.yaml +++ b/charts/jobs-manager-operator/values.yaml @@ -13,7 +13,7 @@ controllerManager: manager: image: repository: ghcr.io/lukaszraczylo/jobs-manager-operator - tag: 0.0.17 + tag: 0.0.19 resources: limits: cpu: 500m diff --git a/controllers/managedjob_controller.go b/controllers/managedjob_controller.go index 621c948..14b626d 100644 --- a/controllers/managedjob_controller.go +++ b/controllers/managedjob_controller.go @@ -60,12 +60,17 @@ func (r *ManagedJobReconciler) Reconcile(ctx context.Context, req ctrl.Request) originalMainJobDefinition := cp.mj.DeepCopy() cp.generateDependencyTree() + _, theSame, _ := pandati.CompareStructsReplaced(originalMainJobDefinition, cp.mj) + if !theSame { + cp.updateCRDStatusDirectly() + } + originalMainJobDefinition = cp.mj.DeepCopy() // TODO: Re-enable after testing cp.checkRunningJobsStatus() cp.runPendingJobs() - _, theSame, _ := pandati.CompareStructsReplaced(originalMainJobDefinition, cp.mj) + _, theSame, _ = pandati.CompareStructsReplaced(originalMainJobDefinition, cp.mj) if !theSame { cp.updateCRDStatusDirectly() }