crc-org / crc

CRC is a tool to help you run containers. It manages a local OpenShift 4.x cluster, Microshift or a Podman VM optimized for testing and development purposes
https://crc.dev
Apache License 2.0
1.26k stars 242 forks source link

kubeconfig.write: update the issuer with ingressPort #4183

Closed vyasgun closed 5 months ago

vyasgun commented 5 months ago

Fixes: Issue #4124

Relates to: Issue #4177 (Maybe)

Solution/Idea

This is a workaround to explicitly set the ingressPortNumber in the Issuer field when requesting token. By default, the OpenShift library uses the URL from /.well-known/oauth-authorization-server without including the custom port set by the user on CRC. This omission causes errors when writing new contexts to kubeconfig, as the token request fails due to the missing port number. Since users configure this custom port for their CRC instance, this commit ensures the issuer field includes the ingress-https-port before making the token request.

Proposed changes

List main as well as consequential changes you introduced or had to introduce.

  1. Wrote a new equivalent local function to perform the port setting.

Testing

  1. crc config set ingress-https-port 7443
  2. crc setup
  3. crc start
praveenkumar commented 5 months ago

Can you put more info in the commit logs why it was not working without this PR and what this PR adds to make it work?

vyasgun commented 5 months ago

Thanks @praveenkumar. Just added more info to the commit log.

openshift-ci[bot] commented 5 months ago

@vyasgun: The following tests 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-crc ee48b763ed33cccb3f4a4a751feb28a0fa7a00b6 link true /test e2e-crc
ci/prow/security d4f7279eb0ef0074b16e7e642a69176c0f3942bd link false /test security
ci/prow/integration-crc d4f7279eb0ef0074b16e7e642a69176c0f3942bd link true /test integration-crc

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
openshift-ci[bot] commented 5 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gbraad

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](https://github.com/crc-org/crc/blob/main/OWNERS)~~ [gbraad] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment