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

Registry mirror configuration not validated resulting in cluster provisioning failure #4698

Open
Tracked by #5983
janeczku opened this issue Dec 3, 2021 · 0 comments

Comments

@janeczku
Copy link

janeczku commented Dec 3, 2021

Setup

  • Rancher version: 2.6.2

Describe the bug

Private registry configuration input is not validated causing the cluster provisioning to fail due to images not being pulled. Additionally, the user is instructed to enter the registry endpoint in the incorrect format (placeholder text).

To Reproduce

  1. Navigate to Cluster Management -> Clusters
  2. Toggle RKE2 and click to provision with any infrastructure provider
  3. Click Cluster Configuration -> Registries and select 3rd option (advanced)
  4. Enter the hostname of the private registry, e.g. nexus.acmegroup.com
  5. Click on Add Mirrors
  6. Enter an asterisk "*" in the field "registry hostname" (to overwrite the default registry)
  7. Observe the placeholder text in the empty "mirror endpoints" field, indicating to use hostname:port format
  8. Enter the hostname of the private registry in the field, e.g. nexus.acmegroup.com
  9. Create Cluster

Result

Cluster provisioning is kicked off but eventually fails because images can't be pulled

Dec 03 09:26:51 test rancher-system-agent[3747]: time="2021-12-03T09:26:51+01:00" level=info msg="Extracting image rancher/system-agent-installer-rke2:v1.21.6-rke2r1 to directory /var/lib/rancher/agent/work/20211203-092651-applied.plan/61ce39c3bee4e3baedd2ef4935e19588b1039527516787e0583ccdc91ef77e1d_0"
Dec 03 09:26:51 test rancher-system-agent[3747]: time="2021-12-03T09:26:51+01:00" level=info msg="Using private registry config file at /etc/rancher/agent/registries.yaml"
Dec 03 09:26:51 test rancher-system-agent[3747]: time="2021-12-03T09:26:51+01:00" level=info msg="Pulling image index.docker.io/rancher/system-agent-installer-rke2:v1.21.6-rke2r1"
Dec 03 09:26:51 test rancher-system-agent[3747]: time="2021-12-03T09:26:51+01:00" level=debug msg="Registry endpoint URL modified: https://index.docker.io/v2/ => nexus.acmegroup.net"
Dec 03 09:26:51 test rancher-system-agent[3747]: time="2021-12-03T09:26:51+01:00" level=error msg="error while staging: Get \"nexus.acmegroup.net\": unsupported scheme  in registry endpoint: failed to get image index.docker.io/rancher/system-agent-installer-rke2:v1.21.6-rke2r1"

Expected Result

RKE2 requires the mirror endpoint to be a URI, e.g. https://nexus.acmegroup.com and not a hostname, e.g. nexus.acmegroup.com. Hence:

  1. Input in the "mirror endpoints" field must be validated to be in the URI format with http/https scheme
  2. Placeholder help text in the "mirror endpoints" field must show the correct format

Screenshot 2021-12-03 at 10 08 51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants