-
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
Implement template variable expansion for Resources. #153
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dlorenc 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 |
This commit builds upon tektoncd#149 and makes resource keys available for expansion inside a TaskRun. Resources are available under the namespace 'inputs.resources', and each resource is namespaced under it's own name. This commit adds to the PipelineResourceInterface, requiring types to support a Replacements method. This supplies keys to be replaced.
5b45385
to
886af16
Compare
b = b.DeepCopy() | ||
f(b) | ||
return b | ||
} |
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.
whoa 😎
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.
I had one totally minor comment about error messages but otherwise I think it's looking good!
/lgtm
Remove if you want to merge as-is:
/hold
also one more comment from me, the
was wondering if we can combine these two operations in one loop? we can also make this optimization in a later PR if you want to merge this in. |
- Move logic to a new file in resources pkg. - Switch to using a Getter from a Lister - Add separate tests for params and resources
Ah I thought I addressed this somewhere else. I prefer keeping the two loops separate (for readability and testability), but we could fetch the list of resources once and use that in the loops rather than going through the Lister each time. I'm not sure how big of a speedup that would be though, given that the Lister is cached. WDYT? |
Fixed it! |
case PipelineResourceTypeImage: | ||
return NewImageResource(r) | ||
} | ||
return nil, fmt.Errorf("%s is an invalid or unimplemented PipelineResource", r.Spec.Type) |
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.
lol okay
} | ||
} | ||
|
||
type rg struct { |
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.
what's the g
in rg
?
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.
IT IS A BEAUTIFUL THING
/lgtm
/meow space
In response to this:
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. |
im just gonna remove the hold for you cuz i assume that is what you want 😇 /hold cancel |
Fix typo in Makefile
This commit builds upon #149 and makes resource keys available for expansion
inside a TaskRun.
Resources are available under the namespace 'inputs.resources', and each
resource is namespaced under it's own name.
This commit adds to the PipelineResourceInterface, requiring types to support a
Replacements method. This supplies keys to be replaced.
Ref #64