-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 v1 Task&Pipeline in remote resolution #6141
Comments
Thanks for creating the issue @Yongxuanzhang It feels to me 2 ways moving forward:
But I was not sure how we should specify this somewhere for the usage of resovlers? cc @abayer this is the use case as discussed offline:) |
I think most likely we just need to make it so that the resolver can "marshal/unmarshal" v1 as well as v1beta1, isn't it ? // resolvePipeline accepts an impl of remote.Resolver and attempts to
// fetch a pipeline with given name. An error is returned if the
// resolution doesn't work or the returned data isn't a valid
// v1beta1.PipelineObject.
func resolvePipeline(ctx context.Context, resolver remote.Resolver, name string) (v1beta1.PipelineObject, *v1beta1.ConfigSource, error) {
obj, configSource, err := resolver.Get(ctx, "pipeline", name)
if err != nil {
return nil, nil, err
}
pipelineObj, err := readRuntimeObjectAsPipeline(ctx, obj)
if err != nil {
return nil, nil, fmt.Errorf("failed to convert obj %s into Pipeline", obj.GetObjectKind().GroupVersionKind().String())
}
return pipelineObj, configSource, nil
}
// readRuntimeObjectAsPipeline tries to convert a generic runtime.Object
// into a v1beta1.PipelineObject type so that its meta and spec fields
// can be read. An error is returned if the given object is not a
// PipelineObject or if there is an error validating or upgrading an
// older PipelineObject into its v1beta1 equivalent.
func readRuntimeObjectAsPipeline(ctx context.Context, obj runtime.Object) (v1beta1.PipelineObject, error) {
if pipeline, ok := obj.(v1beta1.PipelineObject); ok {
return pipeline, nil
}
return nil, errors.New("resource is not a pipeline")
} We would want to support both, and call the conversion to whatever the storage version is at the time. |
Yes:) I think conversion makes sense and to support both until the deprecation of v1beta1.
|
/assign |
Expected Behavior
Remote resolution can resolve remote v1 tasks and pipelines
Actual Behavior
Remote resolution cannot resolve remote v1 tasks and pipelines
The pipelinerun is not created, and error log is:
Steps to Reproduce the Problem
apply the sample pipeline run:
Additional Info
Kubernetes version:
Output of
kubectl version
:Tekton Pipeline version:
Output of
tkn version
orkubectl get pods -n tekton-pipelines -l app=tekton-pipelines-controller -o=jsonpath='{.items[0].metadata.labels.version}'
The text was updated successfully, but these errors were encountered: