Skip to content

Commit

Permalink
address edoardo's feedback pt.2
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoShaka committed Nov 13, 2024
1 parent 330e7b5 commit bf79776
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/autoupdate/rolloutcontroller/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,19 @@ func (r *Reconciler) Reconcile(ctx context.Context) error {
// The caller must handle those error and retry the reconciliation.
func (r *Reconciler) tryReconcile(ctx context.Context) error {
// get autoupdate_config
config, err := r.clt.GetAutoUpdateConfig(ctx)
if err != nil && !trace.IsNotFound(err) {
var config *autoupdate.AutoUpdateConfig
if c, err := r.clt.GetAutoUpdateConfig(ctx); err == nil {
config = c
} else if !trace.IsNotFound(err) {
return trace.Wrap(err, "getting autoupdate_config")
}

// get autoupdate_version
version, err := r.clt.GetAutoUpdateVersion(ctx)
if err != nil && !trace.IsNotFound(err) {
return trace.Wrap(err, "getting autoupdate_version")
var version *autoupdate.AutoUpdateVersion
if v, err := r.clt.GetAutoUpdateVersion(ctx); err == nil {
version = v
} else if !trace.IsNotFound(err) {
return trace.Wrap(err, "getting autoupdate version")
}

// get autoupdate_agent_rollout
Expand Down

0 comments on commit bf79776

Please sign in to comment.