Skip to content
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

Add omitempty tag to Status field #507

Merged
merged 1 commit into from
Apr 2, 2020
Merged

Conversation

chetan-rns
Copy link
Member

Add omitempty tags to status field of event-listeners, templates, bindings and cluster bindings.
Adding omitempty tags would allow omitting the status field if they have an empty value.

Changes

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

Add omitempty tags to status field of event-listeners,templates,bindings and cluster bindings.
Adding omitempty tags would allow to omit the status field if they have empty value.
@tekton-robot tekton-robot requested review from dibyom and wlynch March 27, 2020 08:08
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@tekton-robot tekton-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 27, 2020
@tekton-robot
Copy link

Hi @chetan-rns. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@tekton-robot tekton-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 27, 2020
@chetan-rns
Copy link
Member Author

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@dibyom
Copy link
Member

dibyom commented Mar 27, 2020

/ok-to-test

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 27, 2020
@chetan-rns
Copy link
Member Author

/retest

@@ -43,7 +43,7 @@ type ClusterTriggerBinding struct {
Spec TriggerBindingSpec `json:"spec,omitempty"`

// +optional
Status TriggerBindingStatus `json:"status"`
Status TriggerBindingStatus `json:"status,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, do we even need Status for TriggerBinding and TriggerTemplate? I don't think we are using it at all.
So, we can just remove Status like some of the Pipeline types: https://github.com/tektoncd/pipeline/blob/master/pkg/apis/pipeline/v1beta1/task_types.go#L25

@ncskier

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I don't think we're using status... nor do I think it makes sense for the TriggerBindings or TriggerTemplates to have a status 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beware of removing it now though 👼 it might break users (see https://github.com/tektoncd/pipeline/blob/master/pkg/apis/pipeline/v1alpha1/pipeline_types.go#L72-L76 – we had to keep it for… not breaking user 😝 )

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh good catch...though the 0.4 release is already a breaking change due to the API groups changing...so this might be the time to do it if we ever do this!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dibyom So are we keeping the status field for bindings and templates? If not I can push the patch to remove status in the same PR

Copy link
Member

@dibyom dibyom Apr 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually let's keep them with the omitempty for now. I think omitempty should fix @bigkevmcd 's issues with ArgoCD as well (if it doesn't please bring it up and we'll look at removing the status in 0.5 then!)

@bigkevmcd
Copy link
Member

This would be really nice to have, it causes issues for ArgoCD when it's synchronising resources.

Copy link
Member

@dibyom dibyom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 2, 2020
@tekton-robot
Copy link

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 2, 2020
@tekton-robot tekton-robot merged commit 1ae22fd into tektoncd:master Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants