Bug 1936022: Fix spurious reconciliation of DNS daemonset and service#243
Conversation
|
/test e2e-aws-operator |
|
This is fantastic! Should we look into doing something similar for the ingress operator? |
|
Looking at DNS operator logs with these changes There's an abundance of white-space in the diff outputs... anything we can do to help with that? (Or do we not really care?) |
e6cc6c6 to
0403d59
Compare
|
@Miciah: An error was encountered updating to the POST state for bug 1936022 on the Bugzilla server at https://bugzilla.redhat.com. No known errors were detected, please see the full error message for details. Full error message.
code 32000: Red Hat Bugzilla's database reported a query serialization error. Most likely this occurred because another user or process attempted to change the same data that you were attempting to change. Please press Back and retry the transaction.
Please contact an administrator to resolve this issue, then request a bug refresh with DetailsIn response to this:
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. |
|
@Miciah: This pull request references Bugzilla bug 1936022, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
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. |
Thanks! Yeah, the ingress operator has similar diff output for deployments but not for other resources, and it would be useful to have it for all resources. I will probably make a similar change in the ingress operator for the resources other than deployments.
I don't know a good way to improve the whitespace with our logging solution. I used |
|
We should backport this to OpenShift 4.7, which added the |
|
@Miciah: once the present PR merges, I will cherry-pick it on top of release-4.7 in a new PR and assign it to you. DetailsIn response to this:
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. |
|
/retest |
|
/test e2e-upgrade |
Good enough for me 😁 |
| { | ||
| description: "if the termination grace period is defaulted", | ||
| mutate: func(daemonset *appsv1.DaemonSet) { | ||
| thirty := int64(30) |
There was a problem hiding this comment.
Can we get the API defaulted value right from the corev1 API?
(Not that I anticipate the value changing anytime soon, but IMO using the API constant would make the test cleaner)
https://github.com/kubernetes/api/blob/master/core/v1/types.go#L2601
There was a problem hiding this comment.
Nifty! Thanks for the pointer! Done.
@Miciah any reason to not also print diffs for corefile config map updates? |
This commit improves log output when reconciling managed resources to log the diff between the current and updated resources when performing an update. * pkg/operator/controller/controller_cluster_role.go (updateDNSClusterRole): * pkg/operator/controller/controller_dns_configmap.go (updateDNSConfigMap): * pkg/operator/controller/controller_dns_daemonset.go (updateDNSDaemonSet): * pkg/operator/controller/controller_dns_service.go (updateDNSService): * pkg/operator/controller/controller_service_monitor.go (updateDNSServiceMonitor): Log the diff between the current and updated resources when performing an update.
When comparing daemonsets to determine whether an update is required, treat implicit and explicit default values for terminationGracePeriodSeconds as equal. Before this commit, the update logic would keep trying to revert the default value that the API set for the daemonset's terminationGracePeriodSeconds field. Follow-up to commit f094ddf, which added the logic which reconciles terminationGracePeriodSeconds. This commit is related to bug 1936022. https://bugzilla.redhat.com/show_bug.cgi?id=1936022 * pkg/operator/controller/controller_dns_daemonset.go (daemonsetConfigChanged): Use the new cmpTerminationGracePeriodSeconds function to compare terminationGracePeriodSeconds values so that two daemonsets are considered equal if the only difference between them is that one does not specify terminationGracePeriodSeconds and the other daemonset has the default value. (cmpTerminationGracePeriodSeconds): New function. * pkg/operator/controller/controller_dns_daemonset_test.go (TestDaemonsetConfigChanged): Verify that daemonsetConfigChanged returns false if the only mutation is that terminationGracePeriodSeconds has been updated from empty to the default value.
* pkg/operator/controller/controller_dns_daemonset.go (volumeDefaultMode): Delete const. (cmpConfigMapVolumeSource): Use corev1.ConfigMapVolumeSourceDefaultMode. (cmpSecretVolumeSource): Use corev1.SecretVolumeSourceDefaultMode. * pkg/operator/controller/controller_dns_daemonset_test.go (TestDaemonsetConfigChanged): Use corev1.ConfigMapVolumeSourceDefaultMode and corev1.SecretVolumeSourceDefaultMode.
Ignore the clusterIPs field when comparing services to determine whether an update is required. Before this commit, the update logic would keep trying to revert the value that the API set for the service's clusterIPs field. The clusterIPs field is new in Kubernetes 1.20 (OpenShift 4.7). This commit is related to bug 1936022. https://bugzilla.redhat.com/show_bug.cgi?id=1936022 * pkg/operator/controller/controller_dns_service.go (serviceChanged): Ignore the services' clusterIPs field. * pkg/operator/controller/controller_dns_service_test.go (TestDNSServiceChanged): Verify that serviceChanged returns false if the only mutation is that the clusterIPs field's value has changed.
0403d59 to
d90ad01
Compare
Nope! Done. Thanks! |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Miciah, sgreene570 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 Please review the full test history for this PR and help us cut down flakes. |
9 similar comments
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
@Miciah: All pull requests linked via external trackers have merged: Bugzilla bug 1936022 has been moved to the MODIFIED state. DetailsIn response to this:
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. |
|
@Miciah: new pull request created: #250 DetailsIn response to this:
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. |
Log diffs when reconciling resources
This PR improves log output when reconciling managed resources to log the diff between the current and updated resources when performing an update.
pkg/operator/controller/controller_cluster_role.go(updateDNSClusterRole):pkg/operator/controller/controller_dns_daemonset.go(updateDNSDaemonSet):pkg/operator/controller/controller_dns_service.go(updateDNSService):pkg/operator/controller/controller_service_monitor.go(updateDNSServiceMonitor): Log the diff between the current and updated resources when performing an update.daemonsetConfigChanged: Fix forterminationGracePeriodSecondsdefaultingWhen comparing daemonsets to determine whether an update is required, treat implicit and explicit default values for
terminationGracePeriodSecondsas equal.Before this PR, the update logic would keep trying to revert the default value that the API set for the daemonset's
terminationGracePeriodSecondsfield.Follow-up to #205, which added the logic which reconciles
terminationGracePeriodSeconds.pkg/operator/controller/controller_dns_daemonset.go(daemonsetConfigChanged): Use the newcmpTerminationGracePeriodSecondsfunction to compareterminationGracePeriodSecondsvalues so that two daemonsets are considered equal if the only difference between them is that one does not specifyterminationGracePeriodSecondsand the other daemonset has the default value.(
cmpTerminationGracePeriodSeconds): New function.pkg/operator/controller/controller_dns_daemonset_test.go(TestDaemonsetConfigChanged): Verify thatdaemonsetConfigChangedreturns false if the only mutation is thatterminationGracePeriodSecondshas been updated from empty to the default value.serviceChanged: Fix forclusterIPsdefaultingIgnore the
clusterIPsfield when comparing services to determine whether an update is required.Before this PR, the update logic would keep trying to revert the value that the API set for the service's
clusterIPsfield.The
clusterIPsfield is new in Kubernetes 1.20 (OpenShift 4.7).pkg/operator/controller/controller_dns_service.go(serviceChanged): Ignore the services'clusterIPsfield.pkg/operator/controller/controller_dns_service_test.go(TestDNSServiceChanged): Verify thatserviceChangedreturns false if the only mutation is that theclusterIPsfield's value has changed.