Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add logs for home az monitor #1899

Merged
merged 5 commits into from
Apr 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cns/restserver/homeazmonitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"time"

"github.com/Azure/azure-container-networking/cns"
"github.com/Azure/azure-container-networking/cns/logger"
"github.com/Azure/azure-container-networking/cns/types"
"github.com/Azure/azure-container-networking/log"
"github.com/Azure/azure-container-networking/nmagent"
"github.com/patrickmn/go-cache"
"github.com/pkg/errors"
Expand Down Expand Up @@ -53,7 +53,7 @@ func (h *HomeAzMonitor) readCacheValue() cns.GetHomeAzResponse {
cachedResp, found := h.values.Get(homeAzCacheKey)
if !found {
return cns.GetHomeAzResponse{Response: cns.Response{
ReturnCode: types.UnexpectedError,
ReturnCode: types.NotFound,
Message: "HomeAz Cache is unavailable",
}, HomeAzResponse: cns.HomeAzResponse{IsSupported: false}}
}
Expand Down Expand Up @@ -151,14 +151,14 @@ func (h *HomeAzMonitor) Populate(ctx context.Context) {

// update constructs a GetHomeAzResponse entity and update its cache
func (h *HomeAzMonitor) update(code types.ResponseCode, msg string, homeAzResponse cns.HomeAzResponse) {
log.Debugf(msg)
resp := cns.GetHomeAzResponse{
Response: cns.Response{
ReturnCode: code,
Message: msg,
},
HomeAzResponse: homeAzResponse,
}
logger.Printf("[HomeAzMonitor] updating home az cache value: %+v", resp)
h.updateCacheValue(resp)
}

Expand Down