argo-workflows: Argo Client does not work with newer k8s client versions (>=v0.21.0)

Summary

I am using the go-client for argo and hereโ€™s how I defined it:

	opts := apiclient.Opts{
		ArgoServerOpts: apiclient.ArgoServerOpts{
			URL:                argoURI,
			Path:               argoPath,
			Secure:             true,
			InsecureSkipVerify: false,
			HTTP1:              true,
		},
		AuthSupplier: func() string {
			return ""
		},
	}
	argoCtx, argo, err := apiclient.NewClientFromOpts(opts)
	if err != nil {
		return "", err
	}

My go.mod file:

module ...

go 1.15

require (
	github.com/argoproj/argo-workflows/v3 v3.0.0
	github.com/go-logr/logr v0.4.0
	github.com/go-yaml/yaml v2.1.0+incompatible
	github.com/onsi/ginkgo v1.14.2
	github.com/onsi/gomega v1.10.4
	gitlab-odx.oracledx.com/cx-sales/code/titan/titan-core v0.2.0
	k8s.io/apimachinery v0.21.0
	k8s.io/client-go v0.21.0
	sigs.k8s.io/controller-runtime v0.7.2
)

What happened/what you expected to happen? I need to use k8s go client version >= v0.21.0 but it seems the latest argo client is incompatible with the newer k8s versions. So

Running go vet ./... gives an error:

..\..\..\..\..\go\pkg\mod\github.com\argoproj\argo-workflows\v3@v3.1.12\util\kubeconfig\kubeconfig.go:147:37: not enough arguments in call 
to exec.GetAuthenticator
        have (*api.ExecConfig)
        want (*api.ExecConfig, *clientauthentication.Cluster)

Clearly, the exec.GetAuthenticator function requires two arguments in the newer k8s client versions. Can a bug fix be released for this purpose? Alternately, how should I define my apiClient to be compatible with the latest k8s client? Would appreciate any pointers!

Diagnostics

What Kubernetes provider are you using? Terraform

What version of Argo Workflows are you running? v0.3.12

What executor are you running? Docker/K8SAPI/Kubelet/PNS/Emissary Docker

Did this work in a previous version? I.e. is it a regression? No


Message from the maintainers:

Impacted by this bug? Give it a ๐Ÿ‘. We prioritise the issues with the most ๐Ÿ‘.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 11
  • Comments: 27 (10 by maintainers)

Commits related to this issue

Most upvoted comments

EDIT: I tried with the master branch version of argo. This fixes the exec.GetAuthenticator error above, but raises a bunch of other issues on running go vet ./... :

..\..\..\..\..\go\pkg\mod\github.com\argoproj\argo-events@v1.4.0\pkg\apis\common\openapi_generated.go:52: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
..\..\..\..\..\go\pkg\mod\github.com\argoproj\argo-events@v1.4.0\pkg\apis\common\openapi_generated.go:64: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
..\..\..\..\..\go\pkg\mod\github.com\argoproj\argo-events@v1.4.0\pkg\apis\common\openapi_generated.go:72:8: cannot use ref("github.com/argoproj/argo-events/pkg/apis/common.Int64OrString") (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\argo-events@v1.4.0\pkg\apis\common\openapi_generated.go:78: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\argo-events@v1.4.0\pkg\apis\common\openapi_generated.go:84: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\argo-events@v1.4.0\pkg\apis\common\openapi_generated.go:104: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
..\..\..\..\..\go\pkg\mod\github.com\argoproj\argo-events@v1.4.0\pkg\apis\common\openapi_generated.go:112:8: cannot use ref("k8s.io/api/core/v1.SecretKeySelector") (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\argo-events@v1.4.0\pkg\apis\common\openapi_generated.go:118:8: cannot use ref("k8s.io/api/core/v1.SecretKeySelector") (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\argo-events@v1.4.0\pkg\apis\common\openapi_generated.go:131: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
..\..\..\..\..\go\pkg\mod\github.com\argoproj\argo-events@v1.4.0\pkg\apis\common\openapi_generated.go:153:8: cannot use ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time") (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\argo-events@v1.4.0\pkg\apis\common\openapi_generated.go:131:3: too many errors# github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1
..\..\..\..\..\go\pkg\mod\github.com\argoproj\argo-workflows\v3@v3.2.0-rc3.0.20210916144414-7684ef4a0c5f\pkg\apis\workflow\v1alpha1\openapi_generated.go:139: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
..\..\..\..\..\go\pkg\mod\github.com\argoproj\argo-workflows\v3@v3.2.0-rc3.0.20210916144414-7684ef4a0c5f\pkg\apis\workflow\v1alpha1\openapi_generated.go:151: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
..\..\..\..\..\go\pkg\mod\github.com\argoproj\argo-workflows\v3@v3.2.0-rc3.0.20210916144414-7684ef4a0c5f\pkg\apis\workflow\v1alpha1\openapi_generated.go:158: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
..\..\..\..\..\go\pkg\mod\github.com\argoproj\argo-workflows\v3@v3.2.0-rc3.0.20210916144414-7684ef4a0c5f\pkg\apis\workflow\v1alpha1\openapi_generated.go:163: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
..\..\..\..\..\go\pkg\mod\github.com\argoproj\argo-workflows\v3@v3.2.0-rc3.0.20210916144414-7684ef4a0c5f\pkg\apis\workflow\v1alpha1\openapi_generated.go:168: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
..\..\..\..\..\go\pkg\mod\github.com\argoproj\argo-workflows\v3@v3.2.0-rc3.0.20210916144414-7684ef4a0c5f\pkg\apis\workflow\v1alpha1\openapi_generated.go:181: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
..\..\..\..\..\go\pkg\mod\github.com\argoproj\argo-workflows\v3@v3.2.0-rc3.0.20210916144414-7684ef4a0c5f\pkg\apis\workflow\v1alpha1\openapi_generated.go:200: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
..\..\..\..\..\go\pkg\mod\github.com\argoproj\argo-workflows\v3@v3.2.0-rc3.0.20210916144414-7684ef4a0c5f\pkg\apis\workflow\v1alpha1\openapi_generated.go:220: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
..\..\..\..\..\go\pkg\mod\github.com\argoproj\argo-workflows\v3@v3.2.0-rc3.0.20210916144414-7684ef4a0c5f\pkg\apis\workflow\v1alpha1\openapi_generated.go:280: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
..\..\..\..\..\go\pkg\mod\github.com\argoproj\argo-workflows\v3@v3.2.0-rc3.0.20210916144414-7684ef4a0c5f\pkg\apis\workflow\v1alpha1\openapi_generated.go:286: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
..\..\..\..\..\go\pkg\mod\github.com\argoproj\argo-workflows\v3@v3.2.0-rc3.0.20210916144414-7684ef4a0c5f\pkg\apis\workflow\v1alpha1\openapi_generated.go:286:8: too many errors

image