Skip to content
This repository was archived by the owner on Apr 24, 2024. It is now read-only.

move to klog, and refactoring around error handling #21

Merged
merged 1 commit into from
Mar 5, 2021
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
COSI repos and images:

[Spec](https://github.com/kubernetes-sigs/container-object-storage-interface-spec) \
[API](https://github.com/kubernetes-sigs/container-object-storage-interface-api) \
[API](https://sigs.k8s.io/container-object-storage-interface-api) \
[Controller](https://github.com/kubernetes-sigs/container-object-storage-interface-controller) <br/>
&emsp; - [images: cosi-controller](https://quay.io/repository/containerobjectstorage/objectstorage-controller?tab=tags) \
[Provisioner Sidecar](https://github.com/kubernetes-sigs/container-object-storage-interface-provisioner-sidecar) <br />
Expand Down
6 changes: 3 additions & 3 deletions cmd/csi-adapter/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"flag"
"os"

_ "github.com/golang/glog"
"github.com/spf13/cobra"
"github.com/spf13/viper"
_ "k8s.io/klog/v2"
)

var Version string
Expand Down Expand Up @@ -51,7 +51,7 @@ func init() {
Version = "v0.0.1"

viper.AutomaticEnv()
// parse the go default flagset to get flags for glog and other packages in future
// parse the go default flagset to get flags for klog and other packages in future
driverCmd.PersistentFlags().AddGoFlagSet(flag.CommandLine)
// defaulting this to true so that logs are printed to console
_ = flag.Set("logtostderr", "true")
Expand All @@ -71,7 +71,7 @@ func init() {
_ = driverCmd.PersistentFlags().MarkHidden("stderrthreshold")
_ = driverCmd.PersistentFlags().MarkHidden("vmodule")

// suppress the incorrect prefix in glog output
// suppress the incorrect prefix in klog output
_ = flag.CommandLine.Parse([]string{})
_ = viper.BindPFlags(driverCmd.PersistentFlags())
}
Expand Down
12 changes: 5 additions & 7 deletions cmd/csi-adapter/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,15 @@ package main
import (
"os"

"github.com/golang/glog"
csicommon "github.com/kubernetes-csi/drivers/pkg/csi-common"
"k8s.io/klog"
"k8s.io/klog/v2"

"github.com/kubernetes-sigs/container-object-storage-interface-csi-adapter/pkg/controller"
id "github.com/kubernetes-sigs/container-object-storage-interface-csi-adapter/pkg/identity"
"github.com/kubernetes-sigs/container-object-storage-interface-csi-adapter/pkg/node"
"sigs.k8s.io/container-object-storage-interface-csi-adapter/pkg/controller"
id "sigs.k8s.io/container-object-storage-interface-csi-adapter/pkg/identity"
"sigs.k8s.io/container-object-storage-interface-csi-adapter/pkg/node"
)

func driver(args []string) error {

if protocol == "unix" {
if err := os.RemoveAll(listen); err != nil {
klog.Fatalf("could not prepare socket: %v", err)
Expand All @@ -40,7 +38,7 @@ func driver(args []string) error {
if err != nil {
return err
}
glog.V(5).Infof("identity server prepared")
klog.InfoS("identity server prepared")

nodeServer := node.NewNodeServerOrDie(identity, nodeID, dataRoot, volumeLimit)
controllerServer, err := controller.NewControllerServer()
Expand Down
4 changes: 2 additions & 2 deletions cmd/csi-adapter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"os/signal"
"syscall"

"github.com/golang/glog"
"k8s.io/klog/v2"
)

func main() {
Expand All @@ -30,7 +30,7 @@ func main() {

go func() {
s := <-sigs
glog.Infof("Exiting on signal %s %#v", s.String(), s)
klog.InfoS("Exiting on signal", "signal", s.String(), "value", s)
}()

if err := Execute(); err != nil {
Expand Down
40 changes: 11 additions & 29 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,37 +1,19 @@
module github.com/kubernetes-sigs/container-object-storage-interface-csi-adapter
module sigs.k8s.io/container-object-storage-interface-csi-adapter

go 1.15

require (
github.com/container-storage-interface/spec v1.3.0
github.com/emicklei/go-restful v2.14.2+incompatible // indirect
github.com/go-logr/logr v0.2.1 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/google/gofuzz v1.2.0 // indirect
github.com/kubernetes-csi/csi-lib-utils v0.8.1 // indirect
github.com/kubernetes-csi/csi-lib-utils v0.9.1 // indirect
github.com/kubernetes-csi/drivers v1.0.2
github.com/kubernetes-sigs/container-object-storage-interface-api v0.0.0-20210126191231-321ababeabd5
github.com/magiconair/properties v1.8.4 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/mitchellh/mapstructure v1.3.3 // indirect
github.com/pelletier/go-toml v1.8.1 // indirect
github.com/spf13/afero v1.4.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/cobra v1.1.1
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.1.3
github.com/spf13/viper v1.7.1
golang.org/x/crypto v0.0.0-20201002094018-c90954cbb977 // indirect
golang.org/x/net v0.0.0-20200930145003-4acb6c075d10 // indirect
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 // indirect
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f // indirect
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
google.golang.org/genproto v0.0.0-20201002142447-3860012362da // indirect
google.golang.org/grpc v1.32.0
gopkg.in/ini.v1 v1.61.0 // indirect
k8s.io/api v0.19.4
k8s.io/apimachinery v0.19.4
k8s.io/client-go v0.19.4
k8s.io/klog v1.0.0
k8s.io/klog/v2 v2.3.0 // indirect
k8s.io/utils v0.0.0-20200912215256-4140de9c8800
google.golang.org/grpc v1.36.0
k8s.io/api v0.20.4
k8s.io/apimachinery v0.20.4
k8s.io/client-go v0.20.0
k8s.io/klog/v2 v2.6.0
k8s.io/utils v0.0.0-20210111153108-fddb29f9d009
sigs.k8s.io/container-object-storage-interface-api v0.0.0-20210225042325-7c26b4fc1ed9
)
Loading