Skip to content

Commit

Permalink
Add Etag to patch call
Browse files Browse the repository at this point in the history
  • Loading branch information
ziyue-101 committed Aug 31, 2024
1 parent 404c035 commit d328ce6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/controller/direct/gkehub/featuremembership_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,12 @@ func (a *gkeHubAdapter) patchMembershipSpec(ctx context.Context) ([]byte, error)
// only change the feature configuration for the associated membership
mSpecs[a.membershipID] = *a.desired
feature.MembershipSpecs = mSpecs
op, err := a.hubClient.featureClient.Patch(a.featureID, feature).UpdateMask("membershipSpecs").Context(ctx).Do()
patchCall := a.hubClient.featureClient.Patch(a.featureID, feature)
if etag := feature.Header.Get("ETag"); etag != "" {
patchCall.Header().Set("If-Match", etag)

}
op, err := patchCall.UpdateMask("membershipSpecs").Context(ctx).Do()
if err != nil {
return nil, err
}
Expand Down

0 comments on commit d328ce6

Please sign in to comment.