Skip to content
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

Support client.authentication.k8s.io/v1 #7596

Open
aschleck opened this issue Jan 20, 2022 · 8 comments
Open

Support client.authentication.k8s.io/v1 #7596

aschleck opened this issue Jan 20, 2022 · 8 comments
Labels
area/build Build or GithubAction/CI issues type/feature Feature request

Comments

@aschleck
Copy link

Summary

Mirroring argoproj/argo-rollouts#1741, argo cli 3.2.6 doesn't support kubeconfig auth token plugins using version client.authentication.k8s.io/v1

What happened/what you expected to happen?

FATA[2022-01-20T00:57:14.543Z] failure to create dynamic client: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1"

when my plugin outputs

{"kind":"ExecCredential","apiVersion":"client.authentication.k8s.io/v1","spec":{},"status":{"expirationTimestamp":"2022-01-20T09:57:28Z","token":"blahblahblah"}}

I expected this to work fine.

What version of Argo Workflows are you running?
3.2.6

Diagnostics

Have a kubeconfig that uses a v1 auth plugin, then run any argo workflow command that uses a kubeconfig: argo list --completed --since 7d


Thank you for your work on this project!

Message from the maintainers:

Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.

@terrytangyuan
Copy link
Member

Would you like to submit a PR for this?

@alexec
Copy link
Contributor

alexec commented Jan 20, 2022

What version of Kubernetes are you using? If you are using an older version, you may also need to use an older version of workflows.

@alexec alexec removed the triage label Jan 20, 2022
@aschleck
Copy link
Author

Happy to submit a PR but wasn't quite sure how to generate the changes. Is it mostly running go get -u ./... and praying? In the argo-rollouts PR there were a bunch of other changes so it made me nervous.

Re client version, I think my kubectl should be okay:

lient Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.1", GitCommit:"86ec240af8cbd1b60bcc4c03c20da9b98005b92e", GitTreeState:"clean", BuildDate:"2021-12-16T11:33:37Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"darwin/arm64"}
Server Version: version.Info{Major:"1", Minor:"21+", GitVersion:"v1.21.2-eks-06eac09", GitCommit:"5f6d83fe4cb7febb5f4f4e39b3b2b64ebbbe3e97", GitTreeState:"clean", BuildDate:"2021-09-13T14:20:15Z", GoVersion:"go1.16.5", Compiler:"gc", Platform:"linux/amd64"}
WARNING: version difference between client (1.23) and server (1.21) exceeds the supported minor version skew of +/-1

@aschleck
Copy link
Author

$ go get -u ./...
...
# github.com/argoproj/argo-events/pkg/apis/common
../../go/pkg/mod/github.com/argoproj/[email protected]/pkg/apis/common/openapi_generated.go:53:3: cannot use "github.com/go-openapi/spec".Schema{...} (type "github.com/go-openapi/spec".Schema) as ty
pe "k8s.io/kube-openapi/pkg/validation/spec".Schema in field value
../../go/pkg/mod/github.com/argoproj/[email protected]/pkg/apis/common/openapi_generated.go:65:3: cannot use "github.com/go-openapi/spec".Schema{...} (type "github.com/go-openapi/spec".Schema) as ty
pe "k8s.io/kube-openapi/pkg/validation/spec".Schema in field value
../../go/pkg/mod/github.com/argoproj/[email protected]/pkg/apis/common/openapi_generated.go:73:8: cannot use ref("github.com/argoproj/argo-events/pkg/apis/common.Int64OrString") (type "k8s.io/kube-o
penapi/pkg/validation/spec".Ref) as type "github.com/go-openapi/spec".Ref in field value
../../go/pkg/mod/github.com/argoproj/[email protected]/pkg/apis/common/openapi_generated.go:79:8: cannot use ref("github.com/argoproj/argo-events/pkg/apis/common.Amount") (type "k8s.io/kube-openapi/
pkg/validation/spec".Ref) as type "github.com/go-openapi/spec".Ref in field value
../../go/pkg/mod/github.com/argoproj/[email protected]/pkg/apis/common/openapi_generated.go:85:8: cannot use ref("github.com/argoproj/argo-events/pkg/apis/common.Amount") (type "k8s.io/kube-openapi/
pkg/validation/spec".Ref) as type "github.com/go-openapi/spec".Ref in field value
../../go/pkg/mod/github.com/argoproj/[email protected]/pkg/apis/common/openapi_generated.go:105:3: cannot use "github.com/go-openapi/spec".Schema{...} (type "github.com/go-openapi/spec".Schema) as t
ype "k8s.io/kube-openapi/pkg/validation/spec".Schema in field value
../../go/pkg/mod/github.com/argoproj/[email protected]/pkg/apis/common/openapi_generated.go:113:8: cannot use ref("k8s.io/api/core/v1.SecretKeySelector") (type "k8s.io/kube-openapi/pkg/validation/sp
ec".Ref) as type "github.com/go-openapi/spec".Ref in field value
../../go/pkg/mod/github.com/argoproj/[email protected]/pkg/apis/common/openapi_generated.go:119:8: cannot use ref("k8s.io/api/core/v1.SecretKeySelector") (type "k8s.io/kube-openapi/pkg/validation/sp
ec".Ref) as type "github.com/go-openapi/spec".Ref in field value
../../go/pkg/mod/github.com/argoproj/[email protected]/pkg/apis/common/openapi_generated.go:132:3: cannot use "github.com/go-openapi/spec".Schema{...} (type "github.com/go-openapi/spec".Schema) as t
ype "k8s.io/kube-openapi/pkg/validation/spec".Schema in field value
../../go/pkg/mod/github.com/argoproj/[email protected]/pkg/apis/common/openapi_generated.go:157:8: cannot use ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time") (type "k8s.io/kube-openapi/pkg/validati
on/spec".Ref) as type "github.com/go-openapi/spec".Ref in field value
../../go/pkg/mod/github.com/argoproj/[email protected]/pkg/apis/common/openapi_generated.go:132:3: too many errors
# github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1
pkg/apis/workflow/v1alpha1/openapi_generated.go:142:3: cannot use "github.com/go-openapi/spec".Schema{...} (type "github.com/go-openapi/spec".Schema) as type "k8s.io/kube-openapi/pkg/validation/spec".
Schema in field value
pkg/apis/workflow/v1alpha1/openapi_generated.go:154:3: cannot use "github.com/go-openapi/spec".Schema{...} (type "github.com/go-openapi/spec".Schema) as type "k8s.io/kube-openapi/pkg/validation/spec".
Schema in field value
pkg/apis/workflow/v1alpha1/openapi_generated.go:161:8: cannot use ref("github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1.Tar...) (type "k8s.io/kube-openapi/pkg/validation/spec".Ref) as
type "github.com/go-openapi/spec".Ref in field value
pkg/apis/workflow/v1alpha1/openapi_generated.go:166:8: cannot use ref("github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1.Non...) (type "k8s.io/kube-openapi/pkg/validation/spec".Ref) as
type "github.com/go-openapi/spec".Ref in field value
pkg/apis/workflow/v1alpha1/openapi_generated.go:171:8: cannot use ref("github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1.Zip...) (type "k8s.io/kube-openapi/pkg/validation/spec".Ref) as
type "github.com/go-openapi/spec".Ref in field value
pkg/apis/workflow/v1alpha1/openapi_generated.go:184:3: cannot use "github.com/go-openapi/spec".Schema{...} (type "github.com/go-openapi/spec".Schema) as type "k8s.io/kube-openapi/pkg/validation/spec".
Schema in field value
pkg/apis/workflow/v1alpha1/openapi_generated.go:203:11: cannot use ref("github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1.Par...) (type "k8s.io/kube-openapi/pkg/validation/spec".Ref) as
 type "github.com/go-openapi/spec".Ref in field value
pkg/apis/workflow/v1alpha1/openapi_generated.go:223:11: cannot use ref("github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1.Art...) (type "k8s.io/kube-openapi/pkg/validation/spec".Ref) as
 type "github.com/go-openapi/spec".Ref in field value
pkg/apis/workflow/v1alpha1/openapi_generated.go:283:8: cannot use ref("github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1.S3A...) (type "k8s.io/kube-openapi/pkg/validation/spec".Ref) as
type "github.com/go-openapi/spec".Ref in field value
pkg/apis/workflow/v1alpha1/openapi_generated.go:289:8: cannot use ref("github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1.Git...) (type "k8s.io/kube-openapi/pkg/validation/spec".Ref) as
type "github.com/go-openapi/spec".Ref in field value
pkg/apis/workflow/v1alpha1/openapi_generated.go:289:8: too many errors
# github.com/argoproj-labs/argo-dataflow/api/v1alpha1
../../go/pkg/mod/github.com/argoproj-labs/[email protected]/api/v1alpha1/step_types.go:179:6: unknown field 'Handler' in struct literal of type "k8s.io/api/core/v1".Probe
../../go/pkg/mod/github.com/argoproj-labs/[email protected]/api/v1alpha1/step_types.go:184:16: undefined: "k8s.io/api/core/v1".Handler
../../go/pkg/mod/github.com/argoproj-labs/[email protected]/api/v1alpha1/step_types.go:198:16: undefined: "k8s.io/api/core/v1".Handler

Trying make codegen:

...
# These files are generated on a v3/ folder by the tool. Link them to the root folder
[ -e ./v3 ] || ln -s . v3
/Users/april/go/bin/openapi-gen \
          --go-header-file ./hack/custom-boilerplate.go.txt \
          --input-dirs github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1 \
          --output-package github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1 \
          --report-filename pkg/apis/api-rules/violation_exceptions.list
# Delete the link
[ -e ./v3 ] && rm -rf v3
# protoc pkg/apiclient/clusterworkflowtemplate/cluster-workflow-template.proto
[ -e ./vendor ] || go mod vendor
protoc -I /usr/local/include -I /Users/april/random/argo-workflows -I /Users/april/random/argo-workflows/vendor -I /Users/april/go/src -I /Users/april/go/pkg/mod/github.com/gogo/[email protected]/gogopr
oto -I /Users/april/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/third_party/googleapis --gogofast_out=plugins=grpc:/Users/april/go/src --grpc-gateway_out=logtostderr=true:/Users/april/go
/src --swagger_out=logtostderr=true,fqn_for_swagger_name=true:. pkg/apiclient/clusterworkflowtemplate/cluster-workflow-template.proto
/usr/local/include: warning: directory does not exist.
github.com/argoproj/argo-workflows/pkg/apis/workflow/v1alpha1/generated.proto: File not found.
pkg/apiclient/clusterworkflowtemplate/cluster-workflow-template.proto:6:1: Import "github.com/argoproj/argo-workflows/pkg/apis/workflow/v1alpha1/generated.proto" was not found or had errors.
pkg/apiclient/clusterworkflowtemplate/cluster-workflow-template.proto:15:5: "github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplate" is not defined.
pkg/apiclient/clusterworkflowtemplate/cluster-workflow-template.proto:31:5: "github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplate" is not defined.
pkg/apiclient/clusterworkflowtemplate/cluster-workflow-template.proto:41:5: "github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplate" is not defined.
pkg/apiclient/clusterworkflowtemplate/cluster-workflow-template.proto:46:87: "github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplate" is not defined.
pkg/apiclient/clusterworkflowtemplate/cluster-workflow-template.proto:53:81: "github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplate" is not defined.
pkg/apiclient/clusterworkflowtemplate/cluster-workflow-template.proto:57:84: "github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplateList" is not defined.
pkg/apiclient/clusterworkflowtemplate/cluster-workflow-template.proto:61:87: "github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplate" is not defined.
pkg/apiclient/clusterworkflowtemplate/cluster-workflow-template.proto:72:83: "github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplate" is not defined.
make: *** [pkg/apiclient/clusterworkflowtemplate/cluster-workflow-template.swagger.json] Error 1

Hm

@blkperl
Copy link
Contributor

blkperl commented Jan 28, 2022

Hi @aschleck, I had the same issue. make codegen expects argo-workflows to be checked out in $(GOPATH)/src/github.com/argoproj/argo-workflows per this troubleshooting doc: https://github.com/argoproj/argo-workflows/blob/master/docs/running-locally.md

@alexec alexec added the v3.2 label Feb 4, 2022
@blkperl
Copy link
Contributor

blkperl commented Feb 5, 2022

We will need argo-events to update to k8s 1.22 before we can upgrade argo-workflows to 1.22. I filed argoproj/argo-events#1607 to get that started.

@alexec alexec added type/feature Feature request area/build Build or GithubAction/CI issues and removed type/bug labels Feb 7, 2022
@alexec alexec removed the v3.2 label Mar 9, 2022
@tooptoop4
Copy link
Contributor

is this solved @blkperl ?

@blkperl
Copy link
Contributor

blkperl commented Oct 1, 2024

@tooptoop4 I'm not sure, if the new version of Kubernetes was all that was required then yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build Build or GithubAction/CI issues type/feature Feature request
Projects
None yet
Development

No branches or pull requests

5 participants