-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exec plugin returning bad version #6749
Comments
This issue seems to indicate the client is the problem: |
See my comment here - #5958 (comment). |
Hi @alexmt following up on this from the argocd meeting. Did you have an example to declaratively gke auth in a secret? |
Sorry @rwong2888 , Unfortunately I had no time last month and could not help. The native GKE support was merged #9190 and will be available in v2.4 The simplest possible was to get it in v2.3 is to build golang using this snippet below, make sure binary is available in application controller pod and use instructions from the PR to configure cluster secret. package commands
import (
"context"
"fmt"
"os"
"github.com/spf13/cobra"
"golang.org/x/oauth2/google"
)
var (
// defaultGCPScopes:
// - cloud-platform is the base scope to authenticate to GCP.
// - userinfo.email is used to authenticate to GKE APIs with gserviceaccount
// email instead of numeric uniqueID.
// https://github.com/kubernetes/client-go/blob/be758edd136e61a1bffadf1c0235fceb8aee8e9e/plugin/pkg/client/auth/gcp/gcp.go#L59
defaultGCPScopes = []string{
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/userinfo.email",
}
)
func newGCPCommand() *cobra.Command {
var command = &cobra.Command{
Use: "gcp",
Run: func(c *cobra.Command, args []string) {
// Preferred way to retrieve GCP credentials
// https://github.com/golang/oauth2/blob/9780585627b5122c8cc9c6a378ac9861507e7551/google/doc.go#L54-L68
cred, err := google.FindDefaultCredentials(context.Background(), defaultGCPScopes...)
if err != nil {
panic(err)
}
token, err := cred.TokenSource.Token()
if err != nil {
panic(err)
}
_, _ = fmt.Fprint(os.Stdout, formatJSON(token.AccessToken, token.Expiry))
},
}
return command
} |
Thank you @alexmt, I hope you are feeling better now and have more free time. Your follow-up is much appreciated. I look forward to 2.4 and will test it out post-release. I will keep this issue open until then. |
Hey guys, I'm having the same problem with argocd v2.4.0-rc2 |
@rekiemfaxaf following the doc works. I am on Thank you @alexmt , closing the issue. |
I'm trying to use exec plugin and I'm getting this error. I tried v1, v1beta1, v1alpha1 to no avail. Any suggestions?
The text was updated successfully, but these errors were encountered: