Fixing namespace reconciler bugs#1128
Conversation
|
I'm not sure we want to clean up the resources if the annotation is removed. That will instantaneously stop all |
n3wscott
left a comment
There was a problem hiding this comment.
Awesome! And Nacho just added back the watchers on these dependents (but not the cleanup like this). Couple comments.
/cc @nachocano
| FieldSelector: fmt.Sprintf("metadata.name=%s", resources.DefaultBrokerName), | ||
| }) | ||
| if err != nil && !k8serrors.IsNotFound(err) { | ||
| logging.FromContext(ctx).Error("Error deleting broker in namespace", zap.String("brokername", resources.DefaultBrokerName), zap.Error(err)) |
There was a problem hiding this comment.
it is an error? perhaps the user deleted it and disabled the namespace annotation?
| FieldSelector: fmt.Sprintf("metadata.name=%s", resources.ServiceAccountName), | ||
| }) | ||
| if serr != nil && !k8serrors.IsNotFound(serr) { | ||
| logging.FromContext(ctx).Error("Error deleting service account %s in namespace", zap.String("name", resources.ServiceAccountName), zap.Error(serr)) |
There was a problem hiding this comment.
And here? perhaps not an error. Log it and try to delete the other things too.
If one resource is missing you will miss out of deleting the others.
There was a problem hiding this comment.
Thats a good idea. I will update that
|
/hold I've outlined my concerns in the linked bug (#1080). |
6f69701 to
51c7dcd
Compare
| controllerAgentName = "knative-eventing-namespace-controller" | ||
| controllerAgentName = "knative-eventing-namespace-controller" | ||
| namespaceReconciled = "NamespaceReconciled" | ||
| namespaceReconcileFailure = "ReconcileReconcileFailure" |
There was a problem hiding this comment.
"ReconcileReconcileFailure" -> "NamespaceReconcileFailure"
| if apierrs.IsNotFound(err) { | ||
| // The resource may no longer exist, in which case we stop processing. | ||
| logging.FromContext(ctx).Error("namespace key in work queue no longer exists") | ||
| logging.FromContext(ctx).Error("namespace key in work queue no longer exists", zap.String("key", key)) |
| logging.FromContext(ctx).Error("Error reconciling Namespace", zap.Error(err)) | ||
| } else { | ||
| logging.FromContext(ctx).Debug("Namespace reconciled") | ||
| logging.FromContext(ctx).Error("Error reconciling Namespace", zap.Error(err), zap.String("key", key)) |
|
|
||
| // Requeue if the resource is not ready: | ||
| return err | ||
| logging.FromContext(ctx).Debug("Namespace reconciled", zap.String("key", key)) |
There was a problem hiding this comment.
key is no longer required.
| InjectionLabelKey = "knative-eventing-injection" | ||
| InjectionEnabledLabelValue = "enabled" | ||
| InjectionDisabledLabelValue = "disabled" | ||
| ResourceInjectionLabel = "eventing.knative.dev/namespaceInjected" |
|
@Harwayne : Addressed all your comments. |
|
/test pull-knative-eventing-integration-tests |
| logging.FromContext(ctx).Error("Error reconciling Namespace", zap.Error(err)) | ||
| } else { | ||
| logging.FromContext(ctx).Debug("Namespace reconciled") | ||
| logging.FromContext(ctx).Error("Error reconciling Namespace") |
There was a problem hiding this comment.
zap.Error(error) should still be here.
- produces reconciliation sucesss/failure events - unit test for default broker in namespace
|
The following is the coverage report on pkg/.
|
|
/test pull-knative-eventing-integration-tests |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Harwayne, shashwathi The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest
…On Thu, May 2, 2019 at 9:47 AM Knative Prow Robot ***@***.***> wrote:
@shashwathi <https://github.com/shashwathi>: The following test *failed*,
say /retest to rerun them all:
Test name Commit Details Rerun command
pull-knative-eventing-integration-tests 61484a7
<61484a7>
link
<https://gubernator.knative.dev/build/knative-prow/pr-logs/pull/knative_eventing/1128/pull-knative-eventing-integration-tests/1123987606384676864/> /test
pull-knative-eventing-integration-tests
Full PR test history
<https://gubernator.knative.dev/pr/knative_eventing/1128>. Your PR
dashboard <https://gubernator.knative.dev/pr/shashwathi>.
Instructions for interacting with me using PR comments are available here
<https://git.k8s.io/community/contributors/guide/pull-requests.md>. If
you have questions or suggestions related to my behavior, please file an
issue against the kubernetes/test-infra
<https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:>
repository. I understand the commands that are listed here
<https://go.k8s.io/bot-commands>.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#1128 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB4XEN6GICOEFUYP3BNULODPTMLKDANCNFSM4HJQ3O7Q>
.
--
Evan Anderson <argent@google.com>
|
|
/test pull-knative-eventing-integration-tests |
Addressed few issues mentioned in #1080
Proposed Changes
cc @n3wscott