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

import github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1 error #4320

Closed
towithyou opened this issue Oct 18, 2021 · 14 comments
Closed

import github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1 error #4320

towithyou opened this issue Oct 18, 2021 · 14 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.

Comments

@towithyou
Copy link

error

github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1

../../../../../../go/pkg/mod/github.com/tektoncd/pipeline@v0.28.2/pkg/apis/pipeline/v1beta1/openapi_generated.go:117: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/tektoncd/pipeline@v0.28.2/pkg/apis/pipeline/v1beta1/openapi_generated.go:146:11: cannot use ref("k8s.io/api/core/v1.Toleration") (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/tektoncd/pipeline@v0.28.2/pkg/apis/pipeline/v1beta1/openapi_generated.go:155:8: cannot use ref("k8s.io/api/core/v1.Affinity") (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/tektoncd/pipeline@v0.28.2/pkg/apis/pipeline/v1beta1/openapi_generated.go:161:8: cannot use ref("k8s.io/api/core/v1.PodSecurityContext") (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/tektoncd/pipeline@v0.28.2/pkg/apis/pipeline/v1beta1/openapi_generated.go:178:11: cannot use ref("k8s.io/api/core/v1.Volume") (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/tektoncd/pipeline@v0.28.2/pkg/apis/pipeline/v1beta1/openapi_generated.go:208:8: cannot use ref("k8s.io/api/core/v1.PodDNSConfig") (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/tektoncd/pipeline@v0.28.2/pkg/apis/pipeline/v1beta1/openapi_generated.go:240:11: cannot use ref("k8s.io/api/core/v1.LocalObjectReference") (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/tektoncd/pipeline@v0.28.2/pkg/apis/pipeline/v1beta1/openapi_generated.go:254:11: cannot use ref("k8s.io/api/core/v1.HostAlias") (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/tektoncd/pipeline@v0.28.2/pkg/apis/pipeline/v1beta1/openapi_generated.go:277: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/tektoncd/pipeline@v0.28.2/pkg/apis/pipeline/v1beta1/openapi_generated.go:320: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/tektoncd/pipeline@v0.28.2/pkg/apis/pipeline/v1beta1/openapi_generated.go:320:3: too many errors

@towithyou towithyou added the kind/bug Categorizes issue or PR as related to a bug. label Oct 18, 2021
@wlynch
Copy link
Member

wlynch commented Oct 18, 2021

Thanks for the bug report! Could you provide a bit more information?

Things that would be useful:

  • go version
  • git show --oneline -s

Thanks!

@wlynch
Copy link
Member

wlynch commented Oct 18, 2021

/triage needs-information

@tekton-robot tekton-robot added the triage/needs-information Indicates an issue needs more information in order to work on it. label Oct 18, 2021
@towithyou
Copy link
Author

go version

go version go1.16.7 darwin/amd64

go mod pipeline version

github.com/tektoncd/pipeline v0.28.2

@towithyou
Copy link
Author

code

func (t *task) List(ctx context.Context, taskGVR schema.GroupVersionResource, ns string, opts metav1.ListOptions) (*v1beta1.TaskList, error) {
	st, err := t.c.Resource(taskGVR).Namespace(ns).List(ctx, opts)
	if err != nil {
		return nil, err
	}

	var taskList *v1beta1.TaskList // import github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1
	if err = runtime.DefaultUnstructuredConverter.FromUnstructured(st.UnstructuredContent(),
		&taskList); err != nil {
		return nil, err
	}

	return taskList, nil
}

@vdemeester
Copy link
Member

Errors looks very similar to #4300

@wlynch
Copy link
Member

wlynch commented Oct 19, 2021

Okay, was able to narrow this down and reproduce - https://gist.github.com/wlynch/8a33caed48a075c023c3bb9ba03105f5

What's happening: is

Easy fix: go get k8s.io/client-go@v0.21.4 first, then go get . as normal. (double check your go.mod - you might need to pin a few more k8s.io deps to fix)

We can probably fix this for newer versions of Tekton by just regenerating the openapi specs using k8s.io >= v0.22.0.

@wlynch
Copy link
Member

wlynch commented Oct 20, 2021

Started going down the dependency update rabbit hole - knative.dev/pkg can't be updated to >=0.22 because of google/gnostic#262 😭

@wlynch
Copy link
Member

wlynch commented Oct 20, 2021

knative.dev/pkg tracking issue - knative/pkg#2320

@wlynch
Copy link
Member

wlynch commented Oct 27, 2021

/remove-triage needs-information
/kind regression
/assign wlynch

Current status - we're going to wait on knative/pkg to bump before taking action in Tekton. Until then, depending on k8s clients <=0.21 is the best workaround for the time being.

@tekton-robot tekton-robot removed the triage/needs-information Indicates an issue needs more information in order to work on it. label Oct 27, 2021
@ycyxuehan
Copy link

how to fix this?
my cluster is 0.23.0

@ghost
Copy link

ghost commented Jan 24, 2022

@ycyxuehan we updated our version of knative in tekton pipelines. Could you try again and see if the problem is fixed for you?

@ghost ghost added the priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. label Jan 24, 2022
@wlynch
Copy link
Member

wlynch commented Jan 25, 2022

Confirmed this is fixed with the latest version of pipelines + deps:

require (
        github.com/tektoncd/pipeline v0.32.0
        k8s.io/apimachinery v0.23.2
        k8s.io/client-go v0.23.2
)

@wlynch
Copy link
Member

wlynch commented Jan 25, 2022

/close

@tekton-robot
Copy link
Collaborator

@wlynch: Closing this issue.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
None yet
Development

No branches or pull requests

5 participants