Skip to content

Conversation

@Miciah
Copy link
Contributor

@Miciah Miciah commented Mar 6, 2021

Log diffs when reconciling resources

This change improves log output when reconciling managed resources to include the diff between the current and updated resources when updating resources.

  • pkg/operator/controller/canary/route.go (updateCanaryRoute): Log the diff between the current and updated resources when updating the route.
  • pkg/operator/controller/ingress/cluster-role.go (ensureClusterRole): Move logging of updates from here...
    (updateClusterRole): ...to here. Log diff.
  • pkg/operator/controller/ingress/dns.go (ensureWildcardDNSRecord): Move logging of updates from here...
    (updateDNSRecord): ...to here. Log diff.
  • pkg/operator/controller/ingress/load_balancer_service.go (ensureLoadBalancerService): Move logging of updates from here...
    (updateLoadBalancerService): ...to here. Log diff.
  • pkg/operator/controller/ingress/monitoring.go (ensureServiceMonitor): Move logging of updates from here...
    (updateServiceMonitor): ...to here. Log diff.
  • pkg/operator/controller/ingress/nodeport_service.go (ensureNodePortService): Move logging of updates from here...
    (updateNodePortService): ...to here. Log diff.
  • pkg/operator/controller/ingress/poddisruptionbudget.go (ensureRouterPodDisruptionBudget): Move logging of updates from here...
    (updateRouterPodDisruptionBudget): ...to here. Log diff.
  • pkg/operator/controller/ingress/rsyslog_configmap.go (ensureRsyslogConfigMap): Move logging of updates from here...
    (updateRouterPodDisruptionBudget): ...to here. Log diff.
  • pkg/operator/controller/ingress/serviceca_configmap.go (ensureServiceCAConfigMap): Move logging of updates from here...
    (updateServiceCAConfigMap): ...to here. Log diff.

nodePortServiceChanged: Fix for clusterIPs

Ignore the clusterIPs field when comparing NodePort services to determine whether an update is required.

Before this change, the update logic would keep trying to revert the default value that the API set for the service's clusterIPs field.

The clusterIPs field is new in Kubernetes 1.20 (OpenShift 4.7).

  • pkg/operator/controller/ingress/nodeport_service.go (nodePortServiceChanged): Ignore the service's clusterIPs field.
  • pkg/operator/controller/ingress/nodeport_service_test.go (TestNodePortServiceChanged): Verify that nodePortServiceChanged returns false if the only mutation is that the clusterIPs field's value has changed.

Miciah added 2 commits March 5, 2021 19:42
This commit improves log output when reconciling managed resources to
include the diff between the current and updated resources when updating
resources.

* pkg/operator/controller/canary/route.go (updateCanaryRoute): Log the diff
between the current and updated resources when updating the route.
* pkg/operator/controller/ingress/cluster-role.go (ensureClusterRole): Move
logging of updates from here...
(updateClusterRole): ...to here.  Log diff.
* pkg/operator/controller/ingress/dns.go (ensureWildcardDNSRecord): Move
logging of updates from here...
(updateDNSRecord): ...to here.  Log diff.
* pkg/operator/controller/ingress/load_balancer_service.go
(ensureLoadBalancerService): Move logging of updates from here...
(updateLoadBalancerService): ...to here.  Log diff.
* pkg/operator/controller/ingress/monitoring.go (ensureServiceMonitor):
Move logging of updates from here...
(updateServiceMonitor): ...to here.  Log diff.
* pkg/operator/controller/ingress/nodeport_service.go
(ensureNodePortService): Move logging of updates from here...
(updateNodePortService): ...to here.  Log diff.
* pkg/operator/controller/ingress/poddisruptionbudget.go
(ensureRouterPodDisruptionBudget): Move logging of updates from here...
(updateRouterPodDisruptionBudget): ...to here.  Log diff.
* pkg/operator/controller/ingress/rsyslog_configmap.go
(ensureRsyslogConfigMap): Move logging of updates from here...
(updateRouterPodDisruptionBudget): ...to here.  Log diff.
* pkg/operator/controller/ingress/serviceca_configmap.go
(ensureServiceCAConfigMap): Move logging of updates from here...
(updateServiceCAConfigMap): ...to here.  Log diff.
Ignore the clusterIPs field when comparing NodePort services to determine
whether an update is required.

Before this commit, the update logic would keep trying to revert the
default 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 fixes bug 1936030.

https://bugzilla.redhat.com/show_bug.cgi?id=1936030

* pkg/operator/controller/ingress/nodeport_service.go
(nodePortServiceChanged): Ignore the service's clusterIPs field.
* pkg/operator/controller/ingress/nodeport_service_test.go
(TestNodePortServiceChanged): Verify that nodePortServiceChanged returns
false if the only mutation is that the clusterIPs field's value has
changed.
@openshift-ci-robot openshift-ci-robot added the bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. label Mar 6, 2021
@openshift-ci-robot
Copy link
Contributor

@Miciah: This pull request references Bugzilla bug 1936030, 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
  • bug is open, matching expected state (open)
  • bug target release (4.8.0) matches configured target release for branch (4.8.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @lihongan

Details

In response to this:

Bug 1936030: Fix spurious reconciliation of NodePort services

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.

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Mar 6, 2021
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 6, 2021
@Miciah
Copy link
Contributor Author

Miciah commented Mar 6, 2021

We should backport this to OpenShift 4.7, which added the clusterIPs field.
/cherry-pick release-4.7

@openshift-cherrypick-robot

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

Details

In response to this:

We should backport this to OpenShift 4.7, which added the clusterIPs field.
/cherry-pick release-4.7

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
Copy link
Contributor Author

Miciah commented Mar 8, 2021

/retest

3 similar comments
@Miciah
Copy link
Contributor Author

Miciah commented Mar 8, 2021

/retest

@sgreene570
Copy link
Contributor

/retest

@sgreene570
Copy link
Contributor

/retest

@sgreene570
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 9, 2021
@openshift-ci-robot
Copy link
Contributor

[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

Details 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

@Miciah
Copy link
Contributor Author

Miciah commented Mar 10, 2021

/retest

@Miciah
Copy link
Contributor Author

Miciah commented Mar 10, 2021

/test e2e-upgrade

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

2 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 5f5112d into openshift:master Mar 10, 2021
@openshift-ci-robot
Copy link
Contributor

@Miciah: All pull requests linked via external trackers have merged:

Bugzilla bug 1936030 has been moved to the MODIFIED state.

Details

In response to this:

Bug 1936030: Fix spurious reconciliation of NodePort services

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.

@openshift-cherrypick-robot

@Miciah: new pull request created: #570

Details

In response to this:

We should backport this to OpenShift 4.7, which added the clusterIPs field.
/cherry-pick release-4.7

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.

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. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants