Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
smittal22 committed Jun 5, 2023
1 parent 7c803ec commit cfc2795
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
1 change: 1 addition & 0 deletions cns/restserver/homeazmonitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ func (h *HomeAzMonitor) Populate(ctx context.Context) {

case http.StatusNotFound:
returnMessage := fmt.Sprintf("[HomeAzMonitor] region does not support AZs, NMAgent returned StatusCode: %d, error: %v", apiError.StatusCode(), err)
// Marking this as success since we don't want to enter the retry loop on DNC side.
returnCode := types.Success
h.update(returnCode, returnMessage, cns.HomeAzResponse{IsSupported: false})
return
Expand Down
6 changes: 0 additions & 6 deletions nmagent/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -691,10 +691,8 @@ func TestGetHomeAz(t *testing.T) {
t.Run(test.name, func(t *testing.T) {
t.Parallel()

var gotPath string
client := nmagent.NewTestClient(&TestTripper{
RoundTripF: func(req *http.Request) (*http.Response, error) {
gotPath = req.URL.RequestURI()
rr := httptest.NewRecorder()
err := json.NewEncoder(rr).Encode(test.resp)
if err != nil {
Expand All @@ -714,10 +712,6 @@ func TestGetHomeAz(t *testing.T) {
t.Fatal("expected error but received none")
}

if gotPath != test.expPath {
t.Error("paths differ: got:", gotPath, "exp:", test.expPath)
}

if !cmp.Equal(got, test.exp) {
t.Error("response differs from expectation: diff:", cmp.Diff(got, test.exp))
}
Expand Down

0 comments on commit cfc2795

Please sign in to comment.