Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added lastUpdate state update to ensure that synchronized commits display a succeeded status #429

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ CHANGELOG
image of the same version, fixing [issue
#411](https://github.com/pulumi/pulumi-kubernetes-operator/issues/411)
[#422](https://github.com/pulumi/pulumi-kubernetes-operator/pull/422)
- Added lastUpdate state update to ensure that synchronized commits display a succeeded status.
[#429](https://github.com/pulumi/pulumi-kubernetes-operator/pull/429)

## 1.11.1 (2023-02-08)

Expand Down
15 changes: 15 additions & 0 deletions pkg/controller/stack/stack_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,11 @@ func (r *ReconcileStack) Reconcile(ctx context.Context, request reconcile.Reques
reqLogger.Info("Commit hash unchanged. Will poll again.", "pollFrequencySeconds", resyncFreqSeconds)
// Reconcile every resyncFreqSeconds to check for new commits to the branch.
instance.Status.MarkReadyCondition() // FIXME: should this reflect the previous update state?
// Ensure lastUpdate state is updated if previous sync failure occurred
if instance.Status.LastUpdate.State != shared.SucceededStackStateMessage {
instance.Status.LastUpdate.State = shared.SucceededStackStateMessage
instance.Status.LastUpdate.LastResyncTime = metav1.Now()
}
return reconcile.Result{RequeueAfter: time.Duration(resyncFreqSeconds) * time.Second}, nil
}

Expand All @@ -644,6 +649,11 @@ func (r *ReconcileStack) Reconcile(ctx context.Context, request reconcile.Reques
reqLogger.Info("Commit hash unchanged. Will poll again.", "pollFrequencySeconds", resyncFreqSeconds)
// Reconcile every resyncFreqSeconds to check for new commits to the branch.
instance.Status.MarkReadyCondition() // FIXME: should this reflect the previous update state?
// Ensure lastUpdate state is updated if previous sync failure occurred
if instance.Status.LastUpdate.State != shared.SucceededStackStateMessage {
instance.Status.LastUpdate.State = shared.SucceededStackStateMessage
instance.Status.LastUpdate.LastResyncTime = metav1.Now()
}
return reconcile.Result{RequeueAfter: time.Duration(resyncFreqSeconds) * time.Second}, nil
}

Expand All @@ -659,6 +669,11 @@ func (r *ReconcileStack) Reconcile(ctx context.Context, request reconcile.Reques
reqLogger.Info("Commit hash unchanged. Will poll again.", "pollFrequencySeconds", resyncFreqSeconds)
// Reconcile every resyncFreqSeconds to check for new commits to the branch.
instance.Status.MarkReadyCondition() // FIXME: should this reflect the previous update state?
// Ensure lastUpdate state is updated if previous sync failure occurred
if instance.Status.LastUpdate.State != shared.SucceededStackStateMessage {
instance.Status.LastUpdate.State = shared.SucceededStackStateMessage
instance.Status.LastUpdate.LastResyncTime = metav1.Now()
}
return reconcile.Result{RequeueAfter: time.Duration(resyncFreqSeconds) * time.Second}, nil
}

Expand Down