Skip to content

Commit

Permalink
Use deprecated flags for connection-timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
msau42 committed Apr 12, 2019
1 parent 4583bd8 commit 771c444
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions cmd/livenessprobe/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,19 @@ import (
"k8s.io/klog"

connlib "github.com/kubernetes-csi/csi-lib-utils/connection"
"github.com/kubernetes-csi/csi-lib-utils/deprecatedflags"
"github.com/kubernetes-csi/csi-lib-utils/rpc"

"google.golang.org/grpc"
)

// Command line flags
var (
// kubeconfig = flag.String("kubeconfig", "", "Absolute path to the kubeconfig file. Required only when running out of cluster.")
connectionTimeout = flag.Duration("connection-timeout", 0, "The --connection-timeout flag is deprecated")
probeTimeout = flag.Duration("probe-timeout", time.Second, "Probe timeout in seconds")
csiAddress = flag.String("csi-address", "/run/csi/socket", "Address of the CSI driver socket.")
healthzPort = flag.String("health-port", "9808", "TCP ports for listening healthz requests")
probeTimeout = flag.Duration("probe-timeout", time.Second, "Probe timeout in seconds")
csiAddress = flag.String("csi-address", "/run/csi/socket", "Address of the CSI driver socket.")
healthzPort = flag.String("health-port", "9808", "TCP ports for listening healthz requests")

_ = deprecatedflags.Add("connection-timeout")
)

type healthProbe struct {
Expand Down Expand Up @@ -74,10 +76,6 @@ func main() {
flag.Set("logtostderr", "true")
flag.Parse()

if *connectionTimeout != 0 {
klog.Warning("--connection-timeout is deprecated and will have no effect")
}

csiConn, err := connlib.Connect(*csiAddress)
if err != nil {
// connlib should retry forever so a returned error should mean
Expand Down

0 comments on commit 771c444

Please sign in to comment.