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

Short term fix for Cloud Event Source #3761

Merged
merged 1 commit into from
Feb 24, 2021

Conversation

jmcshane
Copy link
Contributor

@jmcshane jmcshane commented Feb 14, 2021

Changes

Closes #2676

SelfLink is deprecated and is causing an error on Kubernetes v1.20
clusters as outlined in the issue. This is a short term fix that
would set the source field to a value that should match the current
source URI without the value of the auto-populated selfLink field.

Another field could be used for the source field without issue, but
could cause concerns about backwards compatibility.

/kind bug

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes tests (if functionality changed/added)
  • Includes docs (if user facing)
  • Commit messages follow commit message best practices
  • Release notes block has been filled in or deleted (only if no user facing changes)

See the contribution guide for more details.

Double check this list of stuff that's easy to miss:

Reviewer Notes

If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.

Release Notes

Resolves #2676 by providing Cloud Event source value when selfLink unset

SelfLink is deprecated and is causing an error on Kubernetes v1.20
clusters as outlined in the issue. This is a short term fix that
would set the source field to a value that should match the current
source URI without the value of the auto-populated selfLink field.

Another field could be used for the source field without issue, but
could cause concerns about backwards compatibility.
@tekton-robot tekton-robot added kind/bug Categorizes issue or PR as related to a bug. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Feb 14, 2021
@tekton-robot tekton-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 14, 2021
@tekton-robot
Copy link
Collaborator

Hi @jmcshane. 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.

@jmcshane jmcshane changed the title Short term fix for #2676 Short term fix for Cloud Event Source Feb 14, 2021
@jmcshane
Copy link
Contributor Author

If the maintainers want a longer term solution that does not rely on self link, I'd be willing to do the work on this. As of today, Tekton pipelines installation on Kubernetes v1.20 clusters by default will not send cloud events. The error message can be seen outlined in the linked issue.

@afrittoli
Copy link
Member

/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 Feb 22, 2021
Copy link
Member

@afrittoli afrittoli left a comment

Choose a reason for hiding this comment

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

Thank you!
/approve

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 22, 2021
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/events/cloudevent/cloudevent.go 90.6% 91.2% 0.7

Copy link
Member

@vdemeester vdemeester 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 Feb 24, 2021
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afrittoli, vdemeester

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:
  • OWNERS [afrittoli,vdemeester]

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 merged commit 5354579 into tektoncd:master Feb 24, 2021
@jmcshane jmcshane deleted the bugfix/self-link branch April 12, 2021 17:30
afrittoli added a commit to waveywaves/tekton-experimental that referenced this pull request Jun 14, 2021
Do not use the events package from pipeline as it will send both
k8s and cloud events. Send cloud events only instead.

The pipeline controller as enough context to decide whether to send
an event or not, based on previous and new condition. The cloud
events controller instead does not update the pipeline run condition,
so it is only aware of the current resource condition. The only
option for now is to send and event every time a resource is queued.

Pull in pipelines v0.24.3 to get tektoncd/pipeline#3761
which fixes events on k8s 1.20.

Extend the cluster role to be able to write k8s events, so that we
may write an event in case of reconcile or cloud event delivery
failure.

Cloud events are now sent when a sink is specified. Note that since
resources do not have a condition when they're just started, the start
cloud event is not send for now. The controller will have to replicate
the logic in the pipelinerun controller to set a condition before the
event is sent.

Unit tests are passing, but coverage needs to be added.

Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
afrittoli added a commit to waveywaves/tekton-experimental that referenced this pull request Jun 14, 2021
Do not use the events package from pipeline as it will send both
k8s and cloud events. Send cloud events only instead.

The pipeline controller as enough context to decide whether to send
an event or not, based on previous and new condition. The cloud
events controller instead does not update the pipeline run condition,
so it is only aware of the current resource condition. The only
option for now is to send and event every time a resource is queued.

Pull in pipelines v0.24.3 to get tektoncd/pipeline#3761
which fixes events on k8s 1.20.

Extend the cluster role to be able to write k8s events, so that we
may write an event in case of reconcile or cloud event delivery
failure.

Cloud events are now sent when a sink is specified. Note that since
resources do not have a condition when they're just started, the start
cloud event is not send for now. The controller will have to replicate
the logic in the pipelinerun controller to set a condition before the
event is sent.

Unit tests are passing, but coverage needs to be added.

Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
tekton-robot pushed a commit to tektoncd/experimental that referenced this pull request Jun 14, 2021
Do not use the events package from pipeline as it will send both
k8s and cloud events. Send cloud events only instead.

The pipeline controller as enough context to decide whether to send
an event or not, based on previous and new condition. The cloud
events controller instead does not update the pipeline run condition,
so it is only aware of the current resource condition. The only
option for now is to send and event every time a resource is queued.

Pull in pipelines v0.24.3 to get tektoncd/pipeline#3761
which fixes events on k8s 1.20.

Extend the cluster role to be able to write k8s events, so that we
may write an event in case of reconcile or cloud event delivery
failure.

Cloud events are now sent when a sink is specified. Note that since
resources do not have a condition when they're just started, the start
cloud event is not send for now. The controller will have to replicate
the logic in the pipelinerun controller to set a condition before the
event is sent.

Unit tests are passing, but coverage needs to be added.

Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
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. kind/bug Categorizes issue or PR as related to a bug. 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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix Event ID and Source for Cloud Events without SelfLink
4 participants