-
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
Resolve TriggerBindings with no Kind set in sink #461
Conversation
/test pull-tekton-triggers-build-tests |
This might be a problem if a user does not add the if b.Kind != NamespacedTriggerBindingKind && b.Kind != ClusterTriggerBindingKind {
return apis.ErrInvalidValue(fmt.Errorf("invalid kind"), fmt.Sprintf("bindings[%d].kind", i))
} |
I don't think so. For any newly created/updated bindings, we'll set the right defaults so that validation branch should never be hit. The issue is only for old bindings that are not updated. |
Also, the build failures are real, still testing this out :D |
When upgrading from 0.2.1 to 0.3, the Sink might have to process a Binding that has no `Kind` set. This is because, we only persist the default Kind when the Binding object is created/updated. The reconciler also sets the defaults by calling `SetDefaults` but that change is not persisted to etcd. In the future, we might want to consider updating the object from the reconciler itself if any default values were set. Fixes: tektoncd#459 Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
/approve |
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 tested this out and was able to upgrade from v0.2.1 without any problems 👍
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: akihikokuroda, ncskier 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
When upgrading from 0.2.1 to 0.3, the Sink might have
to process a Binding that has no
Kind
set. This isbecause, we only persist the default Kind when the Binding
object is created/updated. The reconciler also sets the defaults
by calling
SetDefaults
but that change is not persisted to etcd.In the future, we might want to consider updating the object from the
reconciler itself if any default values were set.
Fixes: #459
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.