Skip to content

Conversation

@Miciah
Copy link
Contributor

@Miciah Miciah commented May 11, 2022

This is a manual cherry-pick of #681 and #691. #582 introduced conflicts that required resolution.


setDefaultPublishingStrategy: Reformat with switch

Refactor the update logic in setDefaultPublishingStrategy.

  • pkg/operator/controller/ingress/controller.go (setDefaultPublishingStrategy): Use a switch statement for the update logic so that the logic only looks at parameters related to the selected endpoint publishing strategy type.

setDefaultPublishingStrategy: Fix PROXY protocol

Fix the update logic in setDefaultPublishingStrategy so that updates are properly handled when status.endpointPublishingStrategy.hostNetwork or status.endpointPublishingStrategy.nodePort is null.

Before OpenShift 4.8, the IngressController API did not have any fields under the status.endpointPublishingStrategy.hostNetwork and status.endpointPublishingStrategy.nodePort fields. As result, these fields could be null even if the spec.endpointPublishingStrategy.type field was set to "HostNetwork" or "NodePortService".

OpenShift 4.8 added status.endpointPublishingStrategy.hostNetwork.protocol and status.endpointPublishingStrategy.nodePort.protocol fields, and the operator now sets default values for these fields when the operator admits or re-admits an ingresscontroller that specifies the "HostNetwork" or "NodePortService" strategy type, respectively.

However, a cluster that was upgraded from a version of OpenShift before 4.8 could have an already admitted ingresscontroller with null values for status.endpointPublishingStrategy.hostNetwork and status.endpointPublishingStrategy.nodePort even when ingresscontroller specifies the "HostNetwork" or "NodePortService" strategy type.

In this case, the operator ignored updates to the spec.endpointPublishingStrategy.hostNetwork.protocol or spec.endpointPublishingStrategy.nodePort.protocol fields.

This PR fixes the update logic so that it correctly updates the status.endpointPublishingStrategy.hostNetwork.protocol or status.endpointPublishingStrategy.nodePort.protocol field when status.endpointPublishingStrategy.hostNetwork or status.endpointPublishingStrategy.nodePort is null, the spec.endpointPublishingStrategy.hostNetwork.protocol or spec.endpointPublishingStrategy.nodePort.protocol field is set, and the strategy type is "HostNetwork" or "NodePortService", respectively.

  • pkg/operator/controller/ingress/controller.go (setDefaultPublishingStrategy): Fix logic to properly handle null values for status.endpointPublishingStrategy.hostNetwork or status.endpointPublishingStrategy.nodePort.

setDefaultPublishingStrategy: Deep copy, tests

Make a copy of spec.endpointPublishingStrategy to avoid mutating it, and add unit tests for setDefaultDomain and setDefaultPublishingStrategy.

  • pkg/operator/controller/ingress/controller.go (setDefaultPublishingStrategy): Use a deep copy of ic.Spec.EndpointPublishingStrategy.
  • pkg/operator/controller/ingress/controller_test.go (TestSetDefaultDomain, TestSetDefaultPublishingStrategySetsPlatformDefaults, TestSetDefaultPublishingStrategyHandlesUpdates): New tests.

Miciah Masters added 2 commits May 11, 2022 18:05
Refactor the update logic in setDefaultPublishingStrategy.

* pkg/operator/controller/ingress/controller.go
(setDefaultPublishingStrategy): Use a switch statement for the update logic
so that the logic only looks at parameters related to the selected endpoint
publishing strategy type.
Fix the update logic in setDefaultPublishingStrategy so that updates are
properly handled when status.endpointPublishingStrategy.hostNetwork or
status.endpointPublishingStrategy.nodePort is null.

Before OpenShift 4.8, the IngressController API did not have any fields
under the status.endpointPublishingStrategy.hostNetwork and
status.endpointPublishingStrategy.nodePort fields.  As result, these fields
could be null even if the spec.endpointPublishingStrategy.type field was
set to "HostNetwork" or "NodePortService".

OpenShift 4.8 added status.endpointPublishingStrategy.hostNetwork.protocol
and status.endpointPublishingStrategy.nodePort.protocol fields, and the
operator now sets default values for these fields when the operator admits
or re-admits an ingresscontroller that specifies the "HostNetwork" or
"NodePortService" strategy type, respectively.

However, a cluster that was upgraded from a version of OpenShift before 4.8
could have an already admitted ingresscontroller with null values for
status.endpointPublishingStrategy.hostNetwork and
status.endpointPublishingStrategy.nodePort even when ingresscontroller
specifies the "HostNetwork" or "NodePortService" strategy type.

In this case, the operator ignored updates to the
spec.endpointPublishingStrategy.hostNetwork.protocol or
spec.endpointPublishingStrategy.nodePort.protocol fields.

This commit fixes the update logic so that it correctly updates the
status.endpointPublishingStrategy.hostNetwork.protocol or
status.endpointPublishingStrategy.nodePort.protocol field when
status.endpointPublishingStrategy.hostNetwork or
status.endpointPublishingStrategy.nodePort is null, the
spec.endpointPublishingStrategy.hostNetwork.protocol or
spec.endpointPublishingStrategy.nodePort.protocol field is set, and the
strategy type is "HostNetwork" or "NodePortService", respectively.

This commit fixes bug 1997226.

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

* pkg/operator/controller/ingress/controller.go
(setDefaultPublishingStrategy): Fix logic to properly handle null values
for status.endpointPublishingStrategy.hostNetwork or
status.endpointPublishingStrategy.nodePort.
@openshift-ci openshift-ci bot added bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels May 11, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 11, 2022

@Miciah: This pull request references Bugzilla bug 2084337, which is invalid:

  • expected dependent Bugzilla bug 2084336 to be in one of the following states: VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), CLOSED (CURRENTRELEASE), but it is POST instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

[release-4.8] Bug 2084337: Fix enabling PROXY protocol on an upgraded cluster

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 openshift-ci bot requested review from knobunc and rfredette May 11, 2022 22:10
@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 11, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Miciah

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 11, 2022
@candita
Copy link
Contributor

candita commented May 12, 2022

/retest-required

Make a copy of spec.endpointPublishingStrategy to avoid mutating it, and
add unit tests for setDefaultDomain and setDefaultPublishingStrategy.

Follow-up to commit 4bfff11.

* pkg/operator/controller/ingress/controller.go
(setDefaultPublishingStrategy): Use a deep copy of
ic.Spec.EndpointPublishingStrategy.
* pkg/operator/controller/ingress/controller_test.go
(TestSetDefaultDomain)
(TestSetDefaultPublishingStrategySetsPlatformDefaults)
(TestSetDefaultPublishingStrategyHandlesUpdates): New tests.
@Miciah
Copy link
Contributor Author

Miciah commented Jun 3, 2022

Added #691 for the unit tests. After some discussion, we decided that the deepcopy that #691 adds is safe to backport.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 3, 2022

@Miciah: This pull request references Bugzilla bug 2084337, which is invalid:

  • expected dependent Bugzilla bug 2084336 to be in one of the following states: VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), CLOSED (CURRENTRELEASE), but it is POST instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

[release-4.8] Bug 2084337: Fix enabling PROXY protocol on an upgraded cluster

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 Miciah added the backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. label Jun 3, 2022
@candita
Copy link
Contributor

candita commented Jul 6, 2022

/assign candace

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 6, 2022

@candita: GitHub didn't allow me to assign the following users: candace.

Note that only openshift members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

Details

In response to this:

/assign candace

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.

@candita
Copy link
Contributor

candita commented Jul 6, 2022

/assign candita

@candita
Copy link
Contributor

candita commented Jul 6, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 6, 2022
@openshift-bot
Copy link
Contributor

/bugzilla refresh

Recalculating validity in case the underlying Bugzilla bug has changed.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 7, 2022

@openshift-bot: This pull request references Bugzilla bug 2084337, which is invalid:

  • expected dependent Bugzilla bug 2084336 to be in one of the following states: VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), CLOSED (CURRENTRELEASE), but it is POST instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/bugzilla refresh

Recalculating validity in case the underlying Bugzilla bug has changed.

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.

@candita
Copy link
Contributor

candita commented Jul 7, 2022

failed: (4m10s) 2022-06-03T16:31:23 "[sig-node] Probing container should not be restarted with a non-local redirect http liveness probe [Suite:openshift/conformance/parallel] [Suite:k8s]"
/test e2e-aws-single-node

@candita
Copy link
Contributor

candita commented Jul 7, 2022

/test e2e-aws-single-node

@openshift-bot
Copy link
Contributor

/bugzilla refresh

Recalculating validity in case the underlying Bugzilla bug has changed.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 8, 2022

@openshift-bot: This pull request references Bugzilla bug 2084337, which is invalid:

  • expected dependent Bugzilla bug 2084336 to be in one of the following states: VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), CLOSED (CURRENTRELEASE), but it is ON_QA instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/bugzilla refresh

Recalculating validity in case the underlying Bugzilla bug has changed.

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

/bugzilla refresh

Recalculating validity in case the underlying Bugzilla bug has changed.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 9, 2022

@openshift-bot: This pull request references Bugzilla bug 2084337, which is invalid:

  • expected dependent Bugzilla bug 2084336 to be in one of the following states: VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), CLOSED (CURRENTRELEASE), but it is ON_QA instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/bugzilla refresh

Recalculating validity in case the underlying Bugzilla bug has changed.

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

/bugzilla refresh

Recalculating validity in case the underlying Bugzilla bug has changed.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 10, 2022

@openshift-bot: This pull request references Bugzilla bug 2084337, which is invalid:

  • expected dependent Bugzilla bug 2084336 to be in one of the following states: VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), CLOSED (CURRENTRELEASE), but it is ON_QA instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/bugzilla refresh

Recalculating validity in case the underlying Bugzilla bug has changed.

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

/bugzilla refresh

Recalculating validity in case the underlying Bugzilla bug has changed.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 11, 2022

@openshift-bot: This pull request references Bugzilla bug 2084337, which is invalid:

  • expected dependent Bugzilla bug 2084336 to be in one of the following states: VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), CLOSED (CURRENTRELEASE), but it is ON_QA instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/bugzilla refresh

Recalculating validity in case the underlying Bugzilla bug has changed.

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

/bugzilla refresh

Recalculating validity in case the underlying Bugzilla bug has changed.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 12, 2022

@openshift-bot: This pull request references Bugzilla bug 2084337, which is invalid:

  • expected dependent Bugzilla bug 2084336 to be in one of the following states: VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), CLOSED (CURRENTRELEASE), but it is ON_QA instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/bugzilla refresh

Recalculating validity in case the underlying Bugzilla bug has changed.

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

/bugzilla refresh

Recalculating validity in case the underlying Bugzilla bug has changed.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 13, 2022

@openshift-bot: This pull request references Bugzilla bug 2084337, which is invalid:

  • expected dependent Bugzilla bug 2084336 to be in one of the following states: VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), CLOSED (CURRENTRELEASE), but it is ON_QA instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/bugzilla refresh

Recalculating validity in case the underlying Bugzilla bug has changed.

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

/bugzilla refresh

Recalculating validity in case the underlying Bugzilla bug has changed.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 14, 2022

@openshift-bot: This pull request references Bugzilla bug 2084337, which is invalid:

  • expected dependent Bugzilla bug 2084336 to be in one of the following states: VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), CLOSED (CURRENTRELEASE), but it is ON_QA instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/bugzilla refresh

Recalculating validity in case the underlying Bugzilla bug has changed.

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

/bugzilla refresh

Recalculating validity in case the underlying Bugzilla bug has changed.

@openshift-ci openshift-ci bot added bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Jul 15, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 15, 2022

@openshift-bot: This pull request references Bugzilla bug 2084337, 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.

6 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.8.z) matches configured target release for branch (4.8.z)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)
  • dependent bug Bugzilla bug 2084336 is in the state VERIFIED, which is one of the valid states (VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), CLOSED (CURRENTRELEASE))
  • dependent Bugzilla bug 2084336 targets the "4.9.z" release, which is one of the valid target releases: 4.9.0, 4.9.z
  • bug has dependents

Requesting review from QA contact:
/cc @quarterpin

Details

In response to this:

/bugzilla refresh

Recalculating validity in case the underlying Bugzilla bug has changed.

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 openshift-ci bot requested a review from quarterpin July 15, 2022 01:02
@quarterpin
Copy link

/label qe-approved
This PR has been verified via pre-merge workflow. More details can be found in : https://bugzilla.redhat.com/show_bug.cgi?id=2084337#c1

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Jul 19, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 18, 2022

@Miciah: all tests passed!

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@lihongan
Copy link
Contributor

lihongan commented Sep 9, 2022

/label cherry-pick-approved

@openshift-ci openshift-ci bot added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label Sep 9, 2022
@openshift-merge-robot openshift-merge-robot merged commit 7163d38 into openshift:release-4.8 Sep 9, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 9, 2022

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

Bugzilla bug 2084337 has been moved to the MODIFIED state.

Details

In response to this:

[release-4.8] Bug 2084337: Fix enabling PROXY protocol on an upgraded cluster

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

[ART PR BUILD NOTIFIER]

This PR has been included in build ose-cluster-ingress-operator-container-v4.8.0-202311261141.p0.g7163d38.assembly.stream for distgit ose-cluster-ingress-operator.
All builds following this will include this PR.

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. backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. bugzilla/severity-high Referenced Bugzilla bug's severity is high 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. cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. lgtm Indicates that a PR is ready to be merged. qe-approved Signifies that QE has signed off on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants