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

Bug 2078531: add an option expose all endpoints on plain HTTP port (#71) #74

Merged
merged 3 commits into from
May 6, 2022

Conversation

vrutkovs
Copy link
Member

@vrutkovs vrutkovs commented May 2, 2022

This re-introduces #71 with a few changes:

  • moved internal/services to pkg/services so that this could be reused in assisted-service
  • renamed Init in New
  • start http handler on httpsPort if no certs are passed and httpPort is not set
  • adds a middleware to make sure we serve just pxe-initrd via http in http+https mode

@vrutkovs
Copy link
Member Author

vrutkovs commented May 2, 2022

/test all

@openshift-ci openshift-ci bot added 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. labels May 2, 2022
@openshift-ci
Copy link

openshift-ci bot commented May 2, 2022

@vrutkovs: This pull request references Bugzilla bug 2078531, which is valid. 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 (rhacm-2.6) matches configured target release for branch (rhacm-2.6)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 2078531: add an option expose all endpoints on plain HTTP port (#71)

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 added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 2, 2022
@openshift-ci openshift-ci bot requested review from eliorerz and jakub-dzon May 2, 2022 06:57
@vrutkovs
Copy link
Member Author

vrutkovs commented May 2, 2022

This passes locally :/

/test test

@codecov
Copy link

codecov bot commented May 2, 2022

Codecov Report

Merging #74 (8444886) into main (95f275c) will increase coverage by 1.07%.
The diff coverage is 84.31%.

❗ Current head 8444886 differs from pull request most recent head 6ea164a. Consider uploading reports for the commit 6ea164a to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #74      +/-   ##
==========================================
+ Coverage   66.92%   68.00%   +1.07%     
==========================================
  Files          16       17       +1     
  Lines         774      825      +51     
==========================================
+ Hits          518      561      +43     
- Misses        160      165       +5     
- Partials       96       99       +3     
Impacted Files Coverage Δ
pkg/servers/servers.go 80.48% <80.48%> (ø)
internal/handlers/middleware.go 100.00% <100.00%> (ø)

@vrutkovs
Copy link
Member Author

vrutkovs commented May 2, 2022

/hold

until openshift/release#28257 adds subsystem-aws test

@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 2, 2022
@openshift-ci
Copy link

openshift-ci bot commented May 2, 2022

@vrutkovs: This pull request references Bugzilla bug 2078531, which is valid.

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

In response to this:

Bug 2078531: add an option expose all endpoints on plain HTTP port (#71)

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.

@vrutkovs vrutkovs force-pushed the ipxe-server-fixups branch 2 times, most recently from 8e71b17 to 1caf5ee Compare May 2, 2022 11:13
Copy link
Member

@carbonin carbonin left a comment

Choose a reason for hiding this comment

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

Can you also add a test case in servers_test.go for the behavior that prompted the revert? So "https" port provided, but no certs should start just the http server on the https port.

internal/handlers/middleware.go Show resolved Hide resolved
internal/handlers/middleware.go Outdated Show resolved Hide resolved
pkg/servers/servers.go Outdated Show resolved Hide resolved
main.go Show resolved Hide resolved
@vrutkovs vrutkovs force-pushed the ipxe-server-fixups branch 5 times, most recently from 76a38f4 to d0dbfe3 Compare May 2, 2022 13:39
main.go Show resolved Hide resolved
@vrutkovs
Copy link
Member Author

vrutkovs commented May 3, 2022

/refresh
/skip
/retest

@carbonin
Copy link
Member

carbonin commented May 4, 2022

Since we're not setting the certs, would it be more correct to also change LISTEN_PORT to HTTP_LISTEN_PORT in the template that deploys to the SaaS?

Ideally we'll make this change everywhere we're not explicitly using https and we should then be able to simplify the logic when we start the server, right?

@carbonin
Copy link
Member

carbonin commented May 4, 2022

Can you also update the configuration section of the README?

…penshift#71)

* main: add an option expose all endpoints on plain HTTP port

IPXE flow requires artifacts to be available via HTTP. This change would ensure that if `LISTEN_HTTP_PORT` env var is set and HTTPS cert/key are set, the same endpoints are exposed on plain HTTP port as well

* main: shutdown http/https servers gracefully

* main: move server handling into internal/servers
@openshift-ci
Copy link

openshift-ci bot commented May 5, 2022

@vrutkovs: 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/test d0dbfe3 link true /test test

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.

This lets users inject additional middleware conditionally
When both HTTPS and HTTP handlers are running only pxe-initrd can be fetched via HTTP
@vrutkovs
Copy link
Member Author

vrutkovs commented May 6, 2022

/test e2e-metal-assisted

@openshift-ci
Copy link

openshift-ci bot commented May 6, 2022

@vrutkovs: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test edge-e2e-metal-assisted-deploy-nodes
  • /test edge-images
  • /test edge-lint
  • /test edge-test
  • /test images

The following commands are available to trigger optional jobs:

  • /test edge-e2e-metal-assisted

Use /test all to run the following jobs that were automatically triggered:

  • pull-ci-openshift-assisted-image-service-main-edge-e2e-metal-assisted-deploy-nodes
  • pull-ci-openshift-assisted-image-service-main-edge-images
  • pull-ci-openshift-assisted-image-service-main-edge-lint
  • pull-ci-openshift-assisted-image-service-main-edge-test
  • pull-ci-openshift-assisted-image-service-main-images

In response to this:

/test e2e-metal-assisted

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.

@vrutkovs
Copy link
Member Author

vrutkovs commented May 6, 2022

/test edge-e2e-metal-assisted

@carbonin
Copy link
Member

carbonin commented May 6, 2022

/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 May 6, 2022
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 6, 2022
@openshift-ci
Copy link

openshift-ci bot commented May 6, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: carbonin, vrutkovs

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 6, 2022
@openshift-merge-robot openshift-merge-robot merged commit 2f689a1 into openshift:main May 6, 2022
@openshift-ci
Copy link

openshift-ci bot commented May 6, 2022

@vrutkovs: Some pull requests linked via external trackers have merged:

The following pull requests linked via external trackers have not merged:

These pull request must merge or be unlinked from the Bugzilla bug in order for it to move to the next state. Once unlinked, request a bug refresh with /bugzilla refresh.

Bugzilla bug 2078531 has not been moved to the MODIFIED state.

In response to this:

Bug 2078531: add an option expose all endpoints on plain HTTP port (#71)

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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants