Client-go: Unable to build the image using client-go

Created on 15 Aug 2019  路  15Comments  路  Source: kubernetes/client-go

Hi,
I am getting the below error while trying to build an image using the client-go lib.
Can someone help.
/go/src/k8s.io/client-go/transport/round_trippers.go:70:11: cannot convert klog.V(9) (type klog.Verbose) to type bool

Most helpful comment

you will need to either:

  1. use a dependency manager (like go modules as of go1.12) to assemble suitable versions of dependencies
  2. do something to check out the appropriate versions of dependencies yourself, e.g. go get k8s.io/klog && cd $GOPATH/src/k8s.io/klog && git checkout v0.4.0

All 15 comments

k8s.io/client-go/util/keyutil

k8s.io/client-go/transport

/go/src/k8s.io/client-go/transport/round_trippers.go:70:11: cannot convert klog.V(9) (type klog.Verbose) to type bool
/go/src/k8s.io/client-go/transport/round_trippers.go:72:11: cannot convert klog.V(8) (type klog.Verbose) to type bool
/go/src/k8s.io/client-go/transport/round_trippers.go:74:11: cannot convert klog.V(7) (type klog.Verbose) to type bool
/go/src/k8s.io/client-go/transport/round_trippers.go:76:11: cannot convert klog.V(6) (type klog.Verbose) to type bool
golang.org/x/time/rate

Same issue.

@tedyu can you pls have a look.

@sunnyanand17 The effects of this are reported in other issues

the master version of k8s.io/klog changed the type in https://github.com/kubernetes/klog/pull/20

How about the following change ?

diff --git a/staging/src/k8s.io/client-go/transport/round_trippers.go b/staging/src/k8s.io/client-go/transport/round_trippers.go
index 844ee9a21b..79c223dd29 100644
--- a/staging/src/k8s.io/client-go/transport/round_trippers.go
+++ b/staging/src/k8s.io/client-go/transport/round_trippers.go
@@ -67,7 +67,7 @@ func HTTPWrappersForConfig(config *Config, rt http.RoundTripper) (http.RoundTrip
 // DebugWrappers wraps a round tripper and logs based on the current log level.
 func DebugWrappers(rt http.RoundTripper) http.RoundTripper {
        switch {
-       case bool(klog.V(9)):
+       case klog.V(9).Enabled():
                rt = newDebuggingRoundTripper(rt, debugCurlCommand, debugURLTiming, debugResponseHeaders)
        case bool(klog.V(8)):
                rt = newDebuggingRoundTripper(rt, debugJustURL, debugRequestHeaders, debugResponseStatus, debugResponseHeaders)

If it looks good, I can send a PR

Its very important for me to get this in guys, I will really appreciate this. My whole product GA is hung now. Pls help.

any change would happen via a PR to kubernetes/kubernetes, paired with a corresponding bump of klog. can discuss the best approach in that repo. Existing branches of client-go will not be updated. Builds against existing branches of client-go should use the version of klog that corresponds to that version of client-go.

For example, for the latest release branch:
https://github.com/kubernetes/client-go/blob/release-13.0/go.mod#L31

@liggitt I am just referencing k8s.io/client-go in the application and using 'go get' when building the image. What's the work-around?

I am doing the same. It would be great if we can have some temp fix.
Using below in my image and leaving it to the K8 client to resolve the downstream libraries.
RUN go get -v ./...
RUN go install -v ./...

Not using any dependency management as of now.

Same issue.

Same issue.

you will need to either:

  1. use a dependency manager (like go modules as of go1.12) to assemble suitable versions of dependencies
  2. do something to check out the appropriate versions of dependencies yourself, e.g. go get k8s.io/klog && cd $GOPATH/src/k8s.io/klog && git checkout v0.4.0

Why not update everything at once? Including the go client?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AdheipSingh picture AdheipSingh  路  5Comments

inetkiller picture inetkiller  路  6Comments

alexec picture alexec  路  5Comments

jharshman picture jharshman  路  4Comments

prestonvanloon picture prestonvanloon  路  6Comments