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-34373: Bump library-go to fix routes/custom-host permission for externalCertificate #459

Merged
merged 2 commits into from
Nov 15, 2024

Conversation

chiragkyal
Copy link
Member

@chiragkyal chiragkyal commented Nov 7, 2024

  • Bumps openshift/library-go@0064ad7 and fixes the routes/custom-host permission for externalCertificate
  • Removes ValidateHostExternalCertificate from route admission

Fixes # https://issues.redhat.com/browse/OCPBUGS-34373

@openshift-ci-robot openshift-ci-robot added the jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. label Nov 7, 2024
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 7, 2024
@openshift-ci-robot openshift-ci-robot added 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 Nov 7, 2024
@openshift-ci-robot
Copy link

@chiragkyal: This pull request references Jira Issue OCPBUGS-34373, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.18.0) matches configured target version for branch (4.18.0)
  • bug is in the state POST, 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:

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.

@chiragkyal
Copy link
Member Author

Blocked by #458

go get -u github.com/openshift/library-go
go mod tidy && go mod vendor
make update

Signed-off-by: chiragkyal <ckyal@redhat.com>
Signed-off-by: chiragkyal <ckyal@redhat.com>
@chiragkyal chiragkyal changed the title [wip] OCPBUGS-34373: Bump library-go to fix routes/custom-host permission for externalCertificate OCPBUGS-34373: Bump library-go to fix routes/custom-host permission for externalCertificate Nov 13, 2024
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 13, 2024
@chiragkyal
Copy link
Member Author

/assign @Miciah
for lgtm

@chiragkyal
Copy link
Member Author

/assign @p0lyn0mial
for approval

@chiragkyal
Copy link
Member Author

/cc @lihongan

@chiragkyal
Copy link
Member Author

chiragkyal commented Nov 14, 2024

/test e2e-aws-ovn

1 similar comment
@chiragkyal
Copy link
Member Author

/test e2e-aws-ovn

Copy link
Contributor

openshift-ci bot commented Nov 14, 2024

@chiragkyal: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-ovn-cmd 2209289 link false /test e2e-aws-ovn-cmd

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

@Miciah
Copy link
Contributor

Miciah commented Nov 14, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 14, 2024
@@ -47,21 +47,3 @@ func ValidateHostUpdate(ctx context.Context, route, oldRoute *routeinternal.Rout

return hostassignment.ValidateHostUpdate(ctx, &external, &oldExternal, sarClient, opts)
}

func ValidateHostExternalCertificate(ctx context.Context, route, oldRoute *routeinternal.Route, sarClient routecommon.SubjectAccessReviewCreator, opts routecommon.RouteValidationOptions) field.ErrorList {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may I know why we are removing the admission?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have removed the ValidateHostExternalCertificate function from library-go openshift/library-go#1754

To summarize: To make the custom-host permission requirement consistent between spec.tls.externalCertificate and spec.tls.certificate for route.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, okay. On some platforms, the Route API is served as a CRD, and the validation logic is common and defined in library-go.

@lihongan
Copy link

/label qe-approved
The pre-merged test passed

$ oc get clusterversion
NAME      VERSION                                                AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.18.0-0.test-2024-11-14-100343-ci-ln-zxfcfjb-latest   True        False         55m     Cluster version is 4.18.0-0.test-2024-11-14-100343-ci-ln-zxfcfjb-latest

$ oc whoami 
testuser-47

$ oc patch route myedge -p '{"spec":{"tls":{"externalCertificate":{"name":"mytls"}}}}'
route.route.openshift.io/myedge patched

// change to another secret
$ oc patch route myedge -p '{"spec":{"tls":{"externalCertificate":{"name":"newtls"}}}}'
route.route.openshift.io/myedge patched

$ oc patch route myreen -p '{"spec":{"tls":{"externalCertificate":{"name":"newtls"}}}}'
route.route.openshift.io/myreen patched

$ oc patch route myedge -p '{"spec":{"tls":{"externalCertificate":null}}}'
route.route.openshift.io/myedge patched
$ oc get route myedge -oyaml | yq .spec.tls
termination: edge

$ oc patch route myedge -p '{"spec":{"tls":{"externalCertificate":{"name":"mytls"}}}}'
route.route.openshift.io/myedge patched
$ oc get route myedge -oyaml | yq .spec.tls
externalCertificate:
  name: mytls
termination: edge

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Nov 15, 2024
@p0lyn0mial
Copy link
Contributor

/approve

Copy link
Contributor

openshift-ci bot commented Nov 15, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chiragkyal, Miciah, p0lyn0mial

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 Nov 15, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit ca5030f into openshift:master Nov 15, 2024
9 of 10 checks passed
@openshift-ci-robot
Copy link

@chiragkyal: Jira Issue OCPBUGS-34373: All pull requests linked via external trackers have merged:

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

In response to this:

  • Bumps openshift/library-go@0064ad7 and fixes the routes/custom-host permission for externalCertificate
  • Removes ValidateHostExternalCertificate from route admission

Fixes # https://issues.redhat.com/browse/OCPBUGS-34373

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.

@chiragkyal chiragkyal deleted the custom-host branch November 15, 2024 08:08
@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

Distgit: ose-openshift-apiserver
This PR has been included in build ose-openshift-apiserver-container-v4.18.0-202411151139.p0.gca5030f.assembly.stream.el9.
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. jira/severity-important Referenced Jira bug's severity is important 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. qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants