Closed gtseres closed 5 years ago
Maybe adding line _ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
can help fix the issue. Can you please verify if the suggested fix is valid so that I can send out a PR? Thanks!
I guess something changed auth module. I don't have GCP cluster to test. Could you try replacing
_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
with
_ "k8s.io/client-go/plugin/pkg/client/auth
This should include all possible auth providers and fix the issue.
Thanks for the feedback. I tried that out and run
make install_deps
make build
but I got the following on make build
:
--> Go Version
go version go1.11.2 darwin/amd64
--> Compiling the project
go build -ldflags "-X main.gitsha=v0.1-22-g86418f1-dirty -X main.compiled=1550601150" -o bin/kube-cleanup-operator ./cmd
# github.com/lwolf/kube-cleanup-operator/vendor/k8s.io/client-go/plugin/pkg/client/auth/azure
vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure.go:241:4: cannot use expiresIn (type string) as type json.Number in field value
vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure.go:242:4: cannot use expiresOn (type string) as type json.Number in field value
vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure.go:243:4: cannot use expiresOn (type string) as type json.Number in field value
vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure.go:260:23: cannot use token.token.ExpiresIn (type json.Number) as type string in assignment
vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure.go:261:23: cannot use token.token.ExpiresOn (type json.Number) as type string in assignment
vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure.go:295:3: cannot use spt.Token (type func() adal.Token) as type adal.Token in field value
make: *** [build] Error 2
that's weird, ok, thanks for trying. let's just have 2 auth modes imported for now, as a workaround. I'll look at it later
_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
I have sent out this PR, please let me know if any comments: https://github.com/lwolf/kube-cleanup-operator/pull/26
I cut the release with all your changes. https://github.com/lwolf/kube-cleanup-operator/releases/tag/v0.4.4
Thank you for your contributions.
I followed the steps in the readme file, but faced an issue when running the binary:
The error is the following:
I have managed to overcome this issue by replacing the following line in main.go:
_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
to
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
Am I doing something wrong?