Skip to content

Commit

Permalink
Use PAtch for status update
Browse files Browse the repository at this point in the history
  • Loading branch information
nolancon committed Dec 16, 2024
1 parent 7930848 commit a975ab4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/controller/bucket/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/linode/provider-ceph/internal/consts"
"github.com/linode/provider-ceph/internal/utils"
"go.opentelemetry.io/otel"
"sigs.k8s.io/controller-runtime/pkg/client"

kerrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/types"
Expand Down Expand Up @@ -249,7 +250,7 @@ func (c *external) updateBucketCR(ctx context.Context, bucket *v1alpha1.Bucket,
}
switch cb(bucket) {
case NeedsStatusUpdate:
return c.kubeClient.Status().Update(ctx, bucket)
return c.kubeClient.Status().Patch(ctx, bucket, client.MergeFrom(bucket.DeepCopy()))
case NeedsObjectUpdate:
return c.kubeClient.Update(ctx, bucket)
default:
Expand Down

0 comments on commit a975ab4

Please sign in to comment.