Skip to content

Commit

Permalink
fix: adapt to the major helm controller upgrade 0.37.2 (#46)
Browse files Browse the repository at this point in the history
Co-authored-by: Sangeetha Madamanchi <[email protected]>
  • Loading branch information
sangdammad and Sangeetha Madamanchi authored Feb 2, 2024
1 parent 239e1e6 commit b294cce
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [master]
types: [completed]
env:
VERSION: v0.0.10
VERSION: v0.0.11
jobs:
deploy:
runs-on: ubuntu-latest
Expand Down
9 changes: 7 additions & 2 deletions controllers/application_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,13 @@ func (r *ApplicationReconciler) reconcileHelmReleaseStatus(ctx context.Context,
}
helmReadyStatusNotReconciled := true
for _, condition := range hr.GetConditions() {
apimeta.SetStatusCondition(&application.Status.Conditions, condition)
if condition.Type == meta.ReadyCondition && condition.Reason == v2beta2.ReconciliationSucceededReason {
if condition.Reason == meta.ProgressingReason || condition.Status == metav1.ConditionUnknown {
v1.AppInProgressStatus(application)
break
} else {
apimeta.SetStatusCondition(&application.Status.Conditions, condition)
}
if condition.Type == meta.ReadyCondition && condition.Status == metav1.ConditionTrue {
apimeta.RemoveStatusCondition(&application.Status.Conditions, v1.PodReady)
helmReadyStatusNotReconciled = false
}
Expand Down
8 changes: 4 additions & 4 deletions controllers/application_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,15 +277,15 @@ var _ = Describe("Application controller", func() {
return k8sClient.Get(ctx, client.ObjectKey{Name: a.Name, Namespace: a.Namespace}, hr)
}
}(ctx, hr), 5*time.Second, 300*time.Millisecond).Should(BeNil())
hr.Status.ObservedGeneration = 1
hr.Generation = hr.Status.ObservedGeneration
hr.Status.LastAttemptedGeneration = 1
hr.Generation = hr.Status.LastAttemptedGeneration
conditions := []metav1.Condition{{
Type: meta.ReadyCondition,
Status: metav1.ConditionStatus(v1.ConditionTrue),
ObservedGeneration: 1,
LastTransitionTime: metav1.NewTime(time.Now()),
Message: "Helm Release Reconciled",
Reason: meta.SucceededReason,
Message: "Helm Release Reconciliation in Progress",
Reason: meta.ProgressingReason,
}}
hr.SetConditions(conditions)
Expect(k8sClient.Status().Update(ctx, hr)).Should(BeNil())
Expand Down

0 comments on commit b294cce

Please sign in to comment.