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

Emitting corev1 Events for debugging purposes #746

Merged
merged 12 commits into from
Jan 25, 2019

Conversation

nachocano
Copy link
Contributor

@nachocano nachocano commented Jan 23, 2019

Fixes #724

Proposed Changes

  • Adding corev1.Events to InMemoryChannel, ClusterChannelProvisioner and Subscription objects in their respective reconcile processes, in order to make debugging easier.
  • Adding a MockEventRecorder that contains a slice with the events emitted, and verifies their existence afterwards.
  • Adding permissions to manipulate events to the in-memory-channel default configuration
  • Here is the list of the events emitted:

InMemoryChannel

Name Type Description
ChannelConfigSyncFailed Warning When the Channel's config couldn't be synced. Includes the go error string.
K8sServiceCreateFailed Warning When the K8s Service couldn't be created. Includes the go error string.
VirtualServiceCreateFailed Warning When the Virtual Service couldn't be created. Includes the go error string.
ChannelUpdateStatusFailed Warning When the Channel's status couldn't be updated. It can happen even if the reconciliation process was successful. Includes the go error string.
ChannelReconciled Normal When the Channel's reconciliation process succeeds. This is the "Success" event. Includes the channel name.

ClusterChannelProvisioner

Name Type Description
K8sServiceCreateFailed Warning When the K8s Service couldn't be created. Includes the go error string.
K8sServiceDeleteFailed Warning When the old K8s Service couldn't be deleted. Includes the go error string.
CcpUpdateStatusFailed Warning When the Ccp's status couldn't be updated. It can happen even if the reconciliation process was successful. Includes the go error string.
CcpReconciled Normal When the Ccp's reconciliation process succeeds. This is the "Success" event. Includes the ccp name.

Subscription

Name Type Description
PhysicalChannelSyncFailed Warning When the physical Channel couldn't not be synced. Includes the go error string.
ChannelReferenceFetchFailed Warning When we couldn't validate the existence of the Channel. Includes the go error string.
SubscriberResolveFailed Warning When we couldn't resolve the Subscriber's URI. Includes the go error string.
ResultResolveFailed Warning When we couldn't resolve the Subscription's reply. Includes the go error string.
SubscriptionUpdateStatusFailed Warning When the Subscription's status couldn't be updated. It can happen even if the reconciliation process was successful. Includes the go error string.
SubscriptionReconciled Normal When the reconciliation process succeeds. This is the "Success" event. Includes the subscription name.

Release Note

InMemoryChannel, ClusterChannelProvisioner, and Subscription are now more detailed when errors occur.

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Jan 23, 2019
@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 23, 2019
@nachocano
Copy link
Contributor Author

/assign @adamharwayne @grantr

@knative-prow-robot
Copy link
Contributor

@nachocano: GitHub didn't allow me to assign the following users: adamharwayne.

Note that only knative members and repo collaborators can be assigned.
For more information please see the contributor guide

In response to this:

/assign @adamharwayne @grantr

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.

@Harwayne
Copy link
Contributor

/assign @Harwayne

pkg/controller/eventing/inmemory/channel/reconcile.go Outdated Show resolved Hide resolved
pkg/controller/eventing/inmemory/channel/reconcile.go Outdated Show resolved Hide resolved
pkg/controller/eventing/inmemory/channel/reconcile.go Outdated Show resolved Hide resolved
pkg/controller/eventing/subscription/reconcile.go Outdated Show resolved Hide resolved
pkg/controller/eventing/subscription/reconcile.go Outdated Show resolved Hide resolved
pkg/controller/testing/mock_event_recorder.go Outdated Show resolved Hide resolved
pkg/controller/testing/table.go Outdated Show resolved Hide resolved
pkg/controller/testing/table.go Show resolved Hide resolved
@nachocano
Copy link
Contributor Author

/test pull-knative-eventing-build-tests

@vaikas
Copy link
Contributor

vaikas commented Jan 24, 2019

/approve

leaving lgtm for others who made comments. Thanks for doing this!

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nachocano, vaikas-google

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

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 24, 2019
@grantr
Copy link
Contributor

grantr commented Jan 24, 2019

I initially thought the build failure here was due to it trying to verify that the boilerplate header was the same in all files, but I was incorrect. Only the generated code is verified, and it's diffing the whole file, not the boilerplate header specifically.

So I think it would have been successful to update the boilerplate to 2019 here and then regenerate code. Regardless I'd prefer the boilerplate change to happen in a different PR 🙂

@Harwayne
Copy link
Contributor

/lgtm
/hold

Please check the in-memory-channel-controller's logs to ensure it is not complaining about not being able to write events (perhaps just a subset of them, whereas others do get created successfully). If the logs do not have any errors, then cancel the hold.

@knative-prow-robot knative-prow-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 24, 2019
@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 24, 2019
@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Jan 24, 2019
@nachocano
Copy link
Contributor Author

@Harwayne you were right :) I saw the patch problem again, I was looking at the wrong log before. Thanks for pointing that out. I added the patch verb and now it seems to be working fine.

@Harwayne
Copy link
Contributor

@Harwayne you were right :) I saw the patch problem again, I was looking at the wrong log before. Thanks for pointing that out. I added the patch verb and now it seems to be working fine.

Can we add update just to be safe? I think this is is the relevant code https://github.com/kubernetes/client-go/blob/583180148285a4936b884d8d27ed0063146a8df6/tools/record/event.go#L47, which has create, update, and patch.

@Harwayne
Copy link
Contributor

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 24, 2019
@nachocano
Copy link
Contributor Author

@Harwayne you were right :) I saw the patch problem again, I was looking at the wrong log before. Thanks for pointing that out. I added the patch verb and now it seems to be working fine.

Can we add update just to be safe? I think this is is the relevant code https://github.com/kubernetes/client-go/blob/583180148285a4936b884d8d27ed0063146a8df6/tools/record/event.go#L47, which has create, update, and patch.

Done! Should have triggered another build

@Harwayne
Copy link
Contributor

/hold cancel

@knative-prow-robot knative-prow-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 24, 2019
@knative-metrics-robot
Copy link

The following is the coverage report on pkg/.
Say /test pull-knative-eventing-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/controller/eventing/inmemory/channel/reconcile.go 97.8% 97.9% 0.1
pkg/controller/eventing/inmemory/clusterchannelprovisioner/reconcile.go 94.3% 93.1% -1.2
pkg/controller/eventing/subscription/reconcile.go 78.0% 77.6% -0.4

@nachocano
Copy link
Contributor Author

/test pull-knative-eventing-integration-tests

@nachocano
Copy link
Contributor Author

@Harwayne have you seen an error like this? It seems that there is something going on with us-central1-b?

@Harwayne
Copy link
Contributor

@Harwayne have you seen an error like this? It seems that there is something going on with us-central1-b?

The error is Try a different location, or try again later: Google Compute Engine does not have enough resources available to fulfill request: us-central1-b. Which is definitely a GCE error. I don't know how (or if we can) switch zones for the test. @evankanderson @adrcunha

@nachocano
Copy link
Contributor Author

/test pull-knative-eventing-integration-tests

@knative-prow-robot knative-prow-robot merged commit 030370b into knative:master Jan 25, 2019
@nachocano nachocano deleted the eventing-724 branch January 25, 2019 02:32
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 Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Emit corev1 Events for debugging purposes
7 participants