-
Notifications
You must be signed in to change notification settings - Fork 753
Added import for all client-go auth plugins #991
Conversation
Gopkg.toml
Outdated
@@ -54,23 +54,23 @@ | |||
version = "0.1.10" | |||
|
|||
[[constraint]] | |||
branch = "master" | |||
branch = "latestKubeless" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the rest of the changes are fine but this should still be master
to get updates for the different triggers. Can you post the error you receive here if you let this master
? We should try to fix that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I just run a dep ensure
and then make binary
on the master branch without any modifications, I get the following:
$ make binary
CGO_ENABLED=0 ./script/binary
Removing Old Kubeless binaries
Build Kubeless Components binaries
# github.com/kubeless/kubeless/cmd/kubeless/trigger/http
cmd/kubeless/trigger/http/create.go:158:22: undefined: "github.com/kubeless/kubeless/vendor/github.com/kubeless/http-trigger/pkg/utils".GetKubelessClientOutCluster
cmd/kubeless/trigger/http/delete.go:46:22: undefined: "github.com/kubeless/kubeless/vendor/github.com/kubeless/http-trigger/pkg/utils".GetKubelessClientOutCluster
cmd/kubeless/trigger/http/list.go:46:22: undefined: "github.com/kubeless/kubeless/vendor/github.com/kubeless/http-trigger/pkg/utils".GetKubelessClientOutCluster
cmd/kubeless/trigger/http/update.go:51:22: undefined: "github.com/kubeless/kubeless/vendor/github.com/kubeless/http-trigger/pkg/utils".GetKubelessClientOutCluster
# github.com/kubeless/kubeless/cmd/kubeless/trigger/nats
cmd/kubeless/trigger/nats/create.go:76:22: undefined: "github.com/kubeless/kubeless/vendor/github.com/kubeless/nats-trigger/pkg/utils".GetKubelessClientOutCluster
cmd/kubeless/trigger/nats/delete.go:46:22: undefined: "github.com/kubeless/kubeless/vendor/github.com/kubeless/nats-trigger/pkg/utils".GetKubelessClientOutCluster
cmd/kubeless/trigger/nats/list.go:48:22: undefined: "github.com/kubeless/kubeless/vendor/github.com/kubeless/nats-trigger/pkg/utils".GetKubelessClientOutCluster
cmd/kubeless/trigger/nats/update.go:48:22: undefined: "github.com/kubeless/kubeless/vendor/github.com/kubeless/nats-trigger/pkg/utils".GetKubelessClientOutCluster
# github.com/kubeless/kubeless/cmd/kubeless/trigger/kafka
cmd/kubeless/trigger/kafka/create.go:100:23: undefined: "github.com/kubeless/kubeless/vendor/github.com/kubeless/kafka-trigger/pkg/utils".GetKubelessClientOutCluster
cmd/kubeless/trigger/kafka/delete.go:46:23: undefined: "github.com/kubeless/kubeless/vendor/github.com/kubeless/kafka-trigger/pkg/utils".GetKubelessClientOutCluster
cmd/kubeless/trigger/kafka/list.go:48:23: undefined: "github.com/kubeless/kubeless/vendor/github.com/kubeless/kafka-trigger/pkg/utils".GetKubelessClientOutCluster
cmd/kubeless/trigger/kafka/update.go:48:23: undefined: "github.com/kubeless/kubeless/vendor/github.com/kubeless/kafka-trigger/pkg/utils".GetKubelessClientOutCluster
# github.com/kubeless/kubeless/cmd/kubeless/trigger/kinesis
cmd/kubeless/trigger/kinesis/create.go:140:25: undefined: "github.com/kubeless/kubeless/vendor/github.com/kubeless/kinesis-trigger/pkg/utils".GetKubelessClientOutCluster
cmd/kubeless/trigger/kinesis/delete.go:46:25: undefined: "github.com/kubeless/kubeless/vendor/github.com/kubeless/kinesis-trigger/pkg/utils".GetKubelessClientOutCluster
cmd/kubeless/trigger/kinesis/list.go:48:25: undefined: "github.com/kubeless/kubeless/vendor/github.com/kubeless/kinesis-trigger/pkg/utils".GetKubelessClientOutCluster
cmd/kubeless/trigger/kinesis/update.go:51:25: undefined: "github.com/kubeless/kubeless/vendor/github.com/kubeless/kinesis-trigger/pkg/utils".GetKubelessClientOutCluster
Makefile:29: recipe for target 'binary' failed
make: *** [binary] Error 2
So there must be an issue with the *-trigger
master branches. It looks like PR #871 is the cause.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, the problem is that that function is now only in the core of kubeless. It should be easy to fix as well, you need to go over those files and change the the package of the call:
- natsClient, err := natsUtils.GetKubelessClientOutCluster()
+ natsClient, err := kubelessUtils.GetKubelessClientOutCluster()
Usually kubelessUtils
is already defined, if not it should be added as:
import (
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
+ kubelessUtils "github.com/kubeless/kubeless/pkg/utils"
natsUtils "github.com/kubeless/nats-trigger/pkg/utils"
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I replace kafkaUtils.GetKubelessClientOutCluster()
for kubelessUtils.GetKubelessClientOutcluster()
I get the following error:
# github.com/kubeless/kubeless/cmd/kubeless/trigger/kafka
cmd/kubeless/trigger/kafka/create.go:104:52: cannot use kafkaClient (type "github.com/kubeless/kubeless/pkg/client/clientset/versioned".Interface) as type "github.com/kubeless/kubeless/vendor/github.com/kubeless/kafka-trigger/pkg/client/clientset/versioned".Interface in argument to "github.com/kubeless/kubeless/vendor/github.com/kubeless/kafka-trigger/pkg/utils".CreateKafkaTriggerCustomResource:
"github.com/kubeless/kubeless/pkg/client/clientset/versioned".Interface does not implement "github.com/kubeless/kubeless/vendor/github.com/kubeless/kafka-trigger/pkg/client/clientset/versioned".Interface (wrong type for Kubeless method)
have Kubeless() "github.com/kubeless/kubeless/pkg/client/clientset/versioned/typed/kubeless/v1beta1".KubelessV1beta1Interface
want Kubeless() "github.com/kubeless/kubeless/vendor/github.com/kubeless/kafka-trigger/pkg/client/clientset/versioned/typed/kubeless/v1beta1".KubelessV1beta1Interface
So, does this mean I need to fix the trigger repos before fixing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, my previous comment was wrong. Calls should indeed be natsUtils.GetKubelessClientOutCluster
so you should not need to change any code. The problem is that the Gopkg.lock
contains an old commit for those repositories. The only thing you need to do is delete the Gopkg.lock
file and it will download the latest commit which will fix the issue you are seeing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That did the trick!
After fixing the dependency issue with the triggers, I used the updated Everything is working. Should we add a note to https://kubeless.io/docs/kubeless-on-AKS/ explaining that clusters which use the |
Yes, that note would be great. Thanks for the changes! When you add that we can merge this PR. |
Added a note about the addition of the Azure AD auth provider in CLI version > 1.0.1
@andresmgot Added the note! Ready to merge. |
Issue Ref: #990
Description
In the first commit, I made the changes necessary to support all auth plugins (especially Azure). It just required some small tweaks to an import and updating
Gopkg.toml
versions.The second commit, I need some advice on. I don't know the pattern that is to be followed for
/vendor
packages. I just randep ensure
and committed everything.I tested this manually and am now able to connect to my Kubernetes cluster secured by Azure AD.
Testing
Original error:
After making the change and compiling locally:
$ $GOPATH/bin/kubeless get-server-config INFO[0000] Current Server Config: INFO[0000] Supported Runtimes are: ballerina0.981.0, dotnetcore2.0, dotnetcore2.1, go1.10, java1.8, nodejs6, nodejs8, php7.2, python2.7, python3.4, python3.6, python3.7, ruby2.3, ruby2.4, ruby2.5, jvm1.8, nodejs_distroless8, nodejsCE8
TODOs: