core: replace zap with logtree
Test Plan: Effective refactor. Only tests that could be affected are e2e tests that should continue to run, because we still are logging into the qemu console, even if differently.
X-Origin-Diff: phab/D642
GitOrigin-RevId: 0f12b1bc985af08a3cc269569273184321763e4b
diff --git a/core/internal/kubernetes/csi.go b/core/internal/kubernetes/csi.go
index e151396..def1d6d 100644
--- a/core/internal/kubernetes/csi.go
+++ b/core/internal/kubernetes/csi.go
@@ -24,9 +24,10 @@
"path/filepath"
"regexp"
+ "git.monogon.dev/source/nexantic.git/core/pkg/logtree"
+
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/golang/protobuf/ptypes/wrappers"
- "go.uber.org/zap"
"golang.org/x/sys/unix"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
@@ -49,7 +50,7 @@
KubeletDirectory *localstorage.DataKubernetesKubeletDirectory
VolumesDirectory *localstorage.DataVolumesDirectory
- logger *zap.Logger
+ logger logtree.LeveledLogger
}
func (s *csiPluginServer) Run(ctx context.Context) error {
@@ -240,7 +241,7 @@
func (s *csiPluginServer) NotifyRegistrationStatus(ctx context.Context, req *pluginregistration.RegistrationStatus) (*pluginregistration.RegistrationStatusResponse, error) {
if req.Error != "" {
- s.logger.Warn("Kubelet failed registering CSI plugin", zap.String("error", req.Error))
+ s.logger.Warningf("Kubelet failed registering CSI plugin: %v", req.Error)
}
return &pluginregistration.RegistrationStatusResponse{}, nil
}