-
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
Revert removal of template.Name field and handle Deprecation of template.Name field #912
Revert removal of template.Name field and handle Deprecation of template.Name field #912
Conversation
/cc @dibyom @khrm @MarcelMue |
Spec *TriggerTemplateSpec `json:"spec,omitempty"` | ||
// Deprecated: Use Ref instead | ||
// To be removed in a later release #911 | ||
DeprecatedName string `json:"name,omitempty"` |
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.
Not blocking just wondering:
Why does the omitempty
fix the problem described in slack?
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.
Because omitempty ensures that when this struct is store, it stores nothing related to DeprecatedName field but Ref using defaults. Previously, default wasn't working properly because it stored "".
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 I mean is: We have removed the name field completely already, creating a new CR should therefore not have the field anymore. So even if it was stored with "" we should fix anything going wrong in that case.
Readding the field here kind of implies that users first need to upgrade to this specific version before updating to the next minor.
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 think we can recommend the user to directly upgrade to v0.11.0 from v0.10.2
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.
So then it would make sense to put this change into v0.10.3
instead of v0.11.1
, right?
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.
yeah doing a 0.10.3 is also an option. Though that would mean users would first have to move to v0.10.3 and then to v0.11.0/v0.11.1
@@ -30,6 +30,7 @@ func (el *EventListener) SetDefaults(ctx context.Context) { | |||
for i := range el.Spec.Triggers { | |||
triggerSpecBindingArray(el.Spec.Triggers[i].Bindings). | |||
defaultBindings() | |||
templateNameToRef(el.Spec.Triggers[i].Template) |
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.
Call this function only if there's Template isn't nil. I think that's why test is failing.
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 its failing because of that
Updating
5af3ed0
to
515f9c1
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: khrm 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 |
The following is the coverage report on the affected files.
|
515f9c1
to
9c5fec1
Compare
The following is the coverage report on the affected files.
|
Summarizing the issue here: We had logic in triggers_default.go to change template.Name to template.Ref. But because the Name field did not have a omitempty tag, the resource still contained a (another candidate for #619) |
🙄 |
/lgtm |
Fine with me - I think it's the easiest way forward for users. /lgtm |
Gonna try to close/re-open this PR for trigger the CLA again |
The following is the coverage report on the affected files.
|
9c5fec1
to
34391b1
Compare
I have done force push |
The following is the coverage report on the affected files.
|
/lgtm |
Issue: slack discussion
RootCause: https://tektoncd.slack.com/archives/CL3T51NRF/p1611039325020300?thread_ts=1610982177.013500&cid=CL3T51NRF
Changes
Reverted back changes done as part of this PR and handled Deprecation for
template.Name
fieldWill remove
template.Name
field may be in the next releasev0.12.0
We may need to do patch release to handle this issue
Signed-off-by: Savita Ashture [email protected]
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.
Release Notes