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

USHIFT-2261 USHIFT-2459: Add namespace ownership support for router #3075

Merged
merged 11 commits into from
Mar 7, 2024

Conversation

pacevedom
Copy link
Contributor

Which issue(s) this PR addresses:

Closes #

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 28, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 28, 2024

@pacevedom: This pull request references USHIFT-2459 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.16.0" version, but no target version was set.

In response to this:

Which issue(s) this PR addresses:

Closes #

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-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 28, 2024
@pacevedom
Copy link
Contributor Author

/hold

@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 Feb 28, 2024
@pacevedom
Copy link
Contributor Author

wait until #3066 is merged

@dhellmann
Copy link
Contributor

It looks like this PR includes the contents of #3066, is that right? If so, that's good, I'd like to land the code change and tests at the same time. Maybe we can close the other PR?

@pacevedom
Copy link
Contributor Author

It looks like this PR includes the contents of #3066, is that right? If so, that's good, I'd like to land the code change and tests at the same time. Maybe we can close the other PR?

Yes, I was hoping for a quick review of the implementation (as its simple) and then land the tests later (which are more complex). To have them pass the tests I included all the other commits here too and planned to remove them once #3066 merged.

@pacevedom
Copy link
Contributor Author

/test microshift-metal-tests

@pacevedom pacevedom changed the title USHIFT-2459: e2e tests for router namespace ownership USHIFT-2261 USHIFT-2459: Add namespace ownership support for router Feb 29, 2024
@pacevedom
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 29, 2024

@pacevedom: This pull request references USHIFT-2459 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.16.0" version, but no target version was set.

In response to this:

/jira refresh

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.

@pacevedom
Copy link
Contributor Author

/unhold

@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 Feb 29, 2024
@ShudiLi
Copy link
Member

ShudiLi commented Mar 1, 2024

The function worked well: By default, the ROUTER_DISABLE_NAMESPACE_OWNERSHIP_CHECK in the router deployment was "true", two route with same host names but with different path were admitted and could curl the routes successfully.
Changed it to "false", one route was admitted, the other wasn't.

% oc -n openshift-ingress get deployment -oyaml | grep -A1 ROUTER_DISABLE_NAMESPACE_OWNERSHIP_CHECK
- name: ROUTER_DISABLE_NAMESPACE_OWNERSHIP_CHECK
value: "true"
2.
% oc -n test2 get route
NAME HOST ADMITTED SERVICE TLS
route1 test-route1.apps.example.com True unsec-apach2

% oc -n test get route
NAME HOST ADMITTED SERVICE TLS
route1 test-route1.apps.example.com True unsec-apach2
% oc -n test get route route1 -oyaml | grep -A2 spec:
spec:
host: test-route1.apps.example.com
path: /srv/docs

  1. curl the two routes
    sh-4.4# curl http://test-route1.apps.example.com --resolve test-route1.apps.example.com:80:10.42.0.16
    this a test!
    sh-4.4# curl http://test-route1.apps.example.com/srv/docs/book.txt --resolve test-route1.apps.example.com:80:10.42.0.16
    11111ss
    sh-4.4#

  2. Changed it to "false", one route was admitted, the other wasn't.
    % oc -n test get route | grep route1
    route1 test-route1.apps.example.com False unsec-apach2
    % oc -n test2 get route | grep route1
    route1 test-route1.apps.example.com True unsec-apach2

  3. also checked for edge route and reencrypt route

@ShudiLi
Copy link
Member

ShudiLi commented Mar 1, 2024

/label qe-approved
thanks

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Mar 1, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 1, 2024

@pacevedom: This pull request references USHIFT-2459 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.16.0" version, but no target version was set.

In response to this:

Which issue(s) this PR addresses:

Closes #

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.

@@ -69,6 +70,26 @@
}
}
},
"ingress": {
Copy link
Member

Choose a reason for hiding this comment

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

In your EP, you said you intended to expose this via:

router:
  routerAdmissionPolicy:
    namespaceOwnership: <Strict|InterNamespaceAllowed> # Defaults to InterNamespaceAllowed.

here, you're exposing it via ingress.routerAdmissionPolicy.namespaceOwnership - if the implementation is what we want, you should probably go back and fixup the EP.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, will update it right away.

@jerpeter1
Copy link
Member

You might consider adding a test case which checks that the default (unconfigured) code path works as expected. Maybe another one for invalid configuration, but I wouldn't consider either test a blocker for merging this.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 7, 2024
Copy link
Contributor

openshift-ci bot commented Mar 7, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jerpeter1, pacevedom

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:
  • OWNERS [jerpeter1,pacevedom]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

openshift-ci bot commented Mar 7, 2024

@pacevedom: 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 d39dd14 into openshift:main Mar 7, 2024
10 checks passed
@pacevedom
Copy link
Contributor Author

You might consider adding a test case which checks that the default (unconfigured) code path works as expected. Maybe another one for invalid configuration, but I wouldn't consider either test a blocker for merging this.

/lgtm

Will add them in a separate PR. Thanks!

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

None yet

5 participants