-
Notifications
You must be signed in to change notification settings - Fork 121
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
[pipeline/trusted-resources] Verify Task and Pipeline for Trusted Task #886
[pipeline/trusted-resources] Verify Task and Pipeline for Trusted Task #886
Conversation
a352903
to
d5f1922
Compare
b0dc170
to
f34abab
Compare
f34abab
to
59f7b5d
Compare
/assign @Yongxuanzhang @wlynch |
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.
Looks good for the most part! Just a few small things.
As the part of Trusted Task project, this work will support verifying Task and Pipeline.
59f7b5d
to
b94e00f
Compare
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.
/lgtm
func (t *TrustedTask) Validate(ctx context.Context) (errs *apis.FieldError) { | ||
k8sClient := kubeclient.Get(ctx) | ||
tektonClient := client.Get(ctx) | ||
|
||
if err := t.verifyTask(ctx, k8sClient, tektonClient); err != nil { | ||
return err | ||
} | ||
|
||
return 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.
Non blocking for this PR, but this is pretty trivial now - it may make sense to collapse this down to 1 func.
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.
thanks Billy. so here mean we could arrange verifyTask
into Validate
, so having a single func right?
cfg := config.FromContextOrDefaults(ctx) | ||
cfg.FeatureFlags.EnableTektonOCIBundles = true | ||
ctx = config.ToContext(ctx, cfg) |
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.
Ideally it'd be great if we didn't need to inject this into the context, but if this is always going to be set for every type, consider setting this for the whole controller here -
return store.ToContext(ctx) |
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.
didn't realize this. thanks this hint!
mark this as a follow up action. see if need certain flexibility or not here for following work. if always, will update in webhook.
cc @Yongxuanzhang
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: wlynch The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Changes
The related issue: #873
Add
Task
andPipeline
Verification in Trusted Task repoFollow-up PR:
Refact/clean error on return vals: #888
TODO
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide
for more details.