Skip to content

Commit

Permalink
Merge pull request #3377 from jasonvigil/fix-controller-status
Browse files Browse the repository at this point in the history
fix: Update resource status even if no GCP fields are updated
  • Loading branch information
google-oss-prow[bot] authored Dec 13, 2024
2 parents c3a37f7 + 2c1f836 commit 9daca6b
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,12 @@ func (a *{{.ProtoResource}}Adapter) Update(ctx context.Context, updateOp *direct
if len(paths) == 0 {
log.V(2).Info("no field needs update", "name", a.id.External)
return nil
status := &krm.{{.Kind}}Status{}
status.ObservedState = {{.Kind}}ObservedState_FromProto(mapCtx, a.actual)
if mapCtx.Err() != nil {
return mapCtx.Err()
}
return updateOp.UpdateStatus(ctx, status, nil)
}
updateMask := &fieldmaskpb.FieldMask{
Paths: sets.List(paths)}
Expand Down

0 comments on commit 9daca6b

Please sign in to comment.