-
Notifications
You must be signed in to change notification settings - Fork 11
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
[WIP] Adds support for v1 versions of Tekton #47
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The following is the coverage report on the affected files.
|
Signed-off-by: PuneetPunamiya <[email protected]>
2e4a710
to
76fe2f9
Compare
The following is the coverage report on the affected files.
|
@@ -22,7 +22,7 @@ import ( | |||
|
|||
"github.com/tektoncd/catlin/pkg/parser" | |||
"github.com/tektoncd/catlin/pkg/validator" | |||
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" | |||
v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" | |
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" |
// case "clustertask": | ||
// task := res.(*v1beta1.ClusterTask) | ||
// t.collectOverSteps(task.Spec.Steps, task.ObjectMeta.Name, &result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's remove this?
// const clusterTaskTest = ` | ||
// apiVersion: tekton.dev/v1beta1 | ||
// kind: ClusterTask | ||
// metadata: | ||
// name: hello-moto | ||
// spec: | ||
// steps: | ||
// - name: nogood | ||
// image: image1 | ||
// script: | | ||
// #!/usr/bin/env sh | ||
// ' | ||
// ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
// func Test_ClusterTaskParse(t *testing.T) { | ||
// r := strings.NewReader(clusterTaskTest) | ||
// parser := parser.ForReader(r) | ||
|
||
res, err := parser.Parse() | ||
assert.NilError(t, err) | ||
// res, err := parser.Parse() | ||
// assert.NilError(t, err) | ||
|
||
tl := &taskLinter{ | ||
res: res, | ||
configs: configSh, | ||
} | ||
result := tl.Validate() | ||
assert.Equal(t, 1, result.Errors) | ||
} | ||
// tl := &taskLinter{ | ||
// res: res, | ||
// configs: configSh, | ||
// } | ||
// result := tl.Validate() | ||
// assert.Equal(t, 1, result.Errors) | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same or let's add t.Skip() if we need to keep it
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" | ||
) | ||
|
||
func registerSchema() { | ||
beta1 := runtime.NewSchemeBuilder(v1beta1.AddToScheme) | ||
beta1 := runtime.NewSchemeBuilder(v1beta1.AddToScheme, v1.AddToScheme) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's rename the variable from beta1
to maybe builder
@@ -154,7 +155,7 @@ type tektonResource interface { | |||
func typeForKind(kind string) (tektonResource, error) { | |||
switch kind { | |||
case "Task": | |||
return &v1beta1.Task{}, nil | |||
return &v1.Task{}, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add tests for both v1 and v1beta1 to ensure things are working for both API version ?
No description provided.