Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions cns/common/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
acn "github.com/Azure/azure-container-networking/common"
"github.com/Azure/azure-container-networking/server/tls"
"github.com/Azure/azure-container-networking/store"
"go.uber.org/zap"
)

// Service implements behavior common to all services.
Expand All @@ -20,6 +21,7 @@ type Service struct {
ErrChan chan<- error
Store store.KeyValueStore
ChannelMode string
Logger *zap.Logger
}

// ServiceAPI defines base interface.
Expand All @@ -41,6 +43,7 @@ type ServiceConfig struct {
Server server
ChannelMode string
TLSSettings tls.TlsSettings
Logger *zap.Logger
}

// server struct to store primaryInterfaceIP from VM, port where customer provides by -p and temporary flag EnableLocalServer
Expand Down Expand Up @@ -80,6 +83,7 @@ func (service *Service) Initialize(config *ServiceConfig) error {
service.Store = config.Store
service.Version = config.Version
service.ChannelMode = config.ChannelMode
service.Logger = config.Logger

logger.Debugf("[Azure CNS] nitialized service: %+v with config: %+v.", service, config)

Expand Down
1 change: 1 addition & 0 deletions cns/service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,7 @@ func main() {
}
host, _ := os.Hostname()
z = z.With(zap.String("hostname", host), zap.String("version", version), zap.String("kubernetes_apiserver", os.Getenv("KUBERNETES_SERVICE_HOST")))
config.Logger = z.With(zap.String("module", "cns service"))
// Set the v2 logger to the global logger if v2 logger enabled.
if cnsconfig.EnableLoggerV2 {
logger.Printf("hotswapping logger v2") //nolint:staticcheck // ignore new deprecation
Expand Down
Loading