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

OCPBUGS-32887: Allow operator to update Route spec.subdomain #1047

Conversation

Miciah
Copy link
Contributor

@Miciah Miciah commented Apr 24, 2024

Before this change, cluster-ingress-operator did not have permission to update spec.host or spec.subdomain on an existing route as the operator's serviceaccount did not have the necessary "routes/custom-host" permission. #965 added logic to the operator to clear spec.host and instead set spec.subdomain, but without the required permission, the update would fail with the following error message:

ERROR   operator.init   controller/controller.go:265    Reconciler error {"controller": "canary_controller", "object": {"name":"default","namespace":"openshift-ingress-operator"}, "namespace": "openshift-ingress-operator", "name": "default", "reconcileID": "463061e3-93a1-4067-802e-03e3f1f8cdd0", "error": "failed to ensure canary route: failed to update canary route openshift-ingress-canary/canary: Route.route.openshift.io \"canary\" is invalid: spec.subdomain: Invalid value: \"canary-openshift-ingress-canary\": field is immutable"}

This PR adds the needed permission to the clusterrole for the operator's serviceaccount so that the update can succeed.

Before this commit, cluster-ingress-operator did not have permission to
update spec.host or spec.subdomain on an existing route as the operator's
serviceaccount did not have the necessary "routes/custom-host" permission.
A previous change to the operator had added logic to clear spec.host and
instead set spec.subdomain, but without the required permission, the update
would fail with the following error message:

    ERROR   operator.init   controller/controller.go:265    Reconciler error
{"controller": "canary_controller", "object": {"name":"default","namespace":"openshift-ingress-operator"},
"namespace": "openshift-ingress-operator", "name": "default", "reconcileID": "463061e3-93a1-4067-802e-03e3f1f8cdd0",
"error": "failed to ensure canary route: failed to update canary route openshift-ingress-canary/canary:
Route.route.openshift.io \"canary\" is invalid: spec.subdomain: Invalid value: \"canary-openshift-ingress-canary\": field is immutable"}

This commit adds the needed permission to the clusterrole for the
operator's serviceaccount so that the update can succeed.

This commit fixes OCPBUGS-32887.

https://issues.redhat.com/browse/OCPBUGS-32887

Follow-up to commit 530d326.

* manifests/00-cluster-role.yaml: Add permission for routes/custom-host.
@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Apr 24, 2024
@openshift-ci-robot
Copy link
Contributor

@Miciah: This pull request references Jira Issue OCPBUGS-32887, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.16.0) matches configured target version for branch (4.16.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @lihongan

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

Before this change, cluster-ingress-operator did not have permission to update spec.host or spec.subdomain on an existing route as the operator's serviceaccount did not have the necessary "routes/custom-host" permission. #965 added logic to the operator to clear spec.host and instead set spec.subdomain, but without the required permission, the update would fail with the following error message:

ERROR operator.init controller/controller.go:265 Reconciler error {"controller": "canary_controller", "object": {"name":"default","namespace":"openshift-ingress-operator"}, "namespace": "openshift-ingress-operator", "name": "default", "reconcileID": "463061e3-93a1-4067-802e-03e3f1f8cdd0", "error": "failed to ensure canary route: failed to update canary route openshift-ingress-canary/canary: Route.route.openshift.io "canary" is invalid: spec.subdomain: Invalid value: "canary-openshift-ingress-canary": field is immutable"}

This PR adds the needed permission to the clusterrole for the operator's serviceaccount so that the update can succeed.

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 openshift-eng/jira-lifecycle-plugin repository.

@Miciah
Copy link
Contributor Author

Miciah commented Apr 24, 2024

The e2e-aws-operator, e2e-gcp-operator, and e2e-azure-operator jobs all failed on TestRouteAdmissionPolicy, but e2e-aws-operator passed in #1048, so I'm not sure whether we have a new flake, or an extremely rare old flake, or what.
/test e2e-aws-operator
/test e2e-azure-operator
/test e2e-gcp-operator

@Miciah
Copy link
Contributor Author

Miciah commented May 1, 2024

The TestRouteAdmissionPolicy failure is being tracked as part of OCPBUGS-26498.

@Miciah
Copy link
Contributor Author

Miciah commented May 1, 2024

ci/prow/e2e-azure-operator failed because these tests failed:

  • TestRouteAdmissionPolicy — this is OCPBUGS-26498.
  • TestManagedDNSToUnmanagedDNSIngressController — I see this failing on 1 other PR.
  • TestAllowedSourceRanges — failing on other PRs.
  • TestSourceRangesProgressingAndEvaluationConditionsDetectedStatuses — only failed on this PR; I'll watch for a re-occurrence of this failure.
  • TestAllowedSourceRangesStatus — only failed on this PR; I'll watch for this one too.
  • TestUnmanagedDNSToManagedDNSInternalIngressController — failing on other PRs.

/test e2e-azure-operator

@frobware
Copy link
Contributor

frobware commented May 1, 2024

/lgtm
/approve
/hold
Adding hold for the current CI failures.
Please feel free to remove the hold if the CI failures (clear up and) are unrelated to the change.

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 1, 2024
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 1, 2024
Copy link
Contributor

openshift-ci bot commented May 1, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: frobware

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

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

frobware commented May 1, 2024

/assign

1 similar comment
@candita
Copy link
Contributor

candita commented May 1, 2024

/assign

@candita
Copy link
Contributor

candita commented May 6, 2024

/retest-required

@frobware
Copy link
Contributor

frobware commented May 8, 2024

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 8, 2024
Copy link
Contributor

openshift-ci bot commented May 8, 2024

@Miciah: all tests passed!

Full PR test history. Your PR dashboard.

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.

@openshift-merge-bot openshift-merge-bot bot merged commit 5b4f628 into openshift:master May 8, 2024
15 checks passed
@openshift-ci-robot
Copy link
Contributor

@Miciah: Jira Issue OCPBUGS-32887: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-32887 has been moved to the MODIFIED state.

In response to this:

Before this change, cluster-ingress-operator did not have permission to update spec.host or spec.subdomain on an existing route as the operator's serviceaccount did not have the necessary "routes/custom-host" permission. #965 added logic to the operator to clear spec.host and instead set spec.subdomain, but without the required permission, the update would fail with the following error message:

ERROR operator.init controller/controller.go:265 Reconciler error {"controller": "canary_controller", "object": {"name":"default","namespace":"openshift-ingress-operator"}, "namespace": "openshift-ingress-operator", "name": "default", "reconcileID": "463061e3-93a1-4067-802e-03e3f1f8cdd0", "error": "failed to ensure canary route: failed to update canary route openshift-ingress-canary/canary: Route.route.openshift.io "canary" is invalid: spec.subdomain: Invalid value: "canary-openshift-ingress-canary": field is immutable"}

This PR adds the needed permission to the clusterrole for the operator's serviceaccount so that the update can succeed.

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

This PR has been included in build ose-cluster-ingress-operator-container-v4.16.0-202405100946.p0.g5b4f628.assembly.stream.el9 for distgit ose-cluster-ingress-operator.
All builds following this will include this PR.

@openshift-merge-robot
Copy link
Contributor

Fix included in accepted release 4.16.0-0.nightly-2024-05-14-095225

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. jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants