-
Notifications
You must be signed in to change notification settings - Fork 420
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
fix(example): update default branch name in examples #1748
fix(example): update default branch name in examples #1748
Conversation
Hi @l-qing. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
@@ -5,6 +5,6 @@ metadata: | |||
spec: | |||
params: | |||
- name: gitrevision | |||
value: master | |||
value: main |
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.
In this demo, cloning the master
branch will fail because it has been renamed to main
.
@@ -14,6 +14,7 @@ spec: | |||
default: This is the default message | |||
- name: contenttype | |||
description: The Content-Type of the event | |||
default: text/plain |
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.
In this demo, without a default value and without assigning value in TriggerBinding
, the default value $(tt.params.contenttype)
will be retained in TaskRun
, which is quite strange.
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.
Do you mean to say we get $(tt.params.contenttype)
when there's no value in TriggerBinding and no default value? It should during processing of events then,
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.
Yes, I understand that this value should be declared in the TriggerBinding
as the source of the contenttype
variable, which can be either $(body.xxx)
or $(extensions.xxx)
. However, I am not aware of any existing data source to obtain this parameter value, and it is not mentioned in the documentation.
So my current solution is to give it a default value first, which will not affect other TriggerBindings
assigning it a suitable value in the future.
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 referred to the code here and also added a configuration in TriggerBinding
to assign a value to contenttype
.
triggers/examples/v1beta1/trigger-ref/triggerbinding.yaml
Lines 5 to 12 in 87e123e
spec: | |
params: | |
- name: gitrevision | |
value: $(body.head_commit.id) | |
- name: gitrepositoryurl | |
value: $(body.repository.url) | |
- name: contenttype | |
value: $(header.Content-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.
Hey @l-qing when there is not default value what is the issue
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.
If there is no default value, it will not necessarily cause a problem.
It will only cause an issue if there is also no value assigned in the TriggerBinding.
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.
/ok-to-test
/test pull-tekton-triggers-build-tests |
1972134
to
0321ebb
Compare
- name: gitrepositoryurl | ||
value: https://github.com/tektoncd/triggers | ||
- name: contenttype | ||
value: $(header.Content-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.
Ref:
triggers/examples/v1beta1/trigger-ref/triggerbinding.yaml
Lines 5 to 12 in 87e123e
spec: | |
params: | |
- name: gitrevision | |
value: $(body.head_commit.id) | |
- name: gitrepositoryurl | |
value: $(body.repository.url) | |
- name: contenttype | |
value: $(header.Content-Type) |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dibyom 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 |
/auto-cc |
ea25fb0
to
584772f
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
Changes
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes
/kind documentation