Skip to content

Commit 72036a2

Browse files
authored
Merge pull request #985 from Azure/tags-patch-response
frontend: Refetch resource document after updating
2 parents 44f1d35 + 8716a16 commit 72036a2

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

frontend/pkg/frontend/frontend.go

+7
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,13 @@ func (f *Frontend) ArmResourceCreateOrUpdate(writer http.ResponseWriter, request
556556
if updated {
557557
f.logger.Info(fmt.Sprintf("document updated for %s", resourceID))
558558
}
559+
// Get the updated resource document for the response.
560+
doc, err = f.dbClient.GetResourceDoc(ctx, resourceID)
561+
if err != nil {
562+
f.logger.Error(err.Error())
563+
arm.WriteInternalServerError(writer)
564+
return
565+
}
559566
}
560567

561568
responseBody, err := marshalCSCluster(csCluster, doc, versionedInterface)

frontend/pkg/frontend/node_pool.go

+7
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,13 @@ func (f *Frontend) CreateOrUpdateNodePool(writer http.ResponseWriter, request *h
242242
if updated {
243243
f.logger.Info(fmt.Sprintf("document updated for %s", resourceID))
244244
}
245+
// Get the updated resource document for the response.
246+
doc, err = f.dbClient.GetResourceDoc(ctx, resourceID)
247+
if err != nil {
248+
f.logger.Error(err.Error())
249+
arm.WriteInternalServerError(writer)
250+
return
251+
}
245252
}
246253

247254
responseBody, err := marshalCSNodePool(csNodePool, doc, versionedInterface)

0 commit comments

Comments
 (0)