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: Don't use JoinHostPort with URI #4242

Closed praveenkumar closed 5 months ago

praveenkumar commented 5 months ago

As part of 4f83f71654f84c9c9dafb85e0178139607f07dd4 we used JoinHostPort but o.Issuer is uri string not the hostname so when it is used with JoinHostPort it thinks it is a ipv6 and return the value as following

[https://oauth-openshift.apps-crc.testing]:443

This failed to parse so better to avoid it.

This would fix following error

INFO Adding crc-admin and crc-developer contexts to kubeconfig...
ERRO Cannot update kubeconfig: parse "[https://oauth-openshift.apps-crc.testing]:443": first path segment in URL cannot contain colon
Started the OpenShift cluster.
openshift-ci[bot] commented 5 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cfergeau

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)~~ [cfergeau] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
openshift-ci[bot] commented 5 months ago

@praveenkumar: 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/security 7c45a3cfe71095bf4eaecbbdd03e48b3c01448f2 link false /test security

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