[go: up one dir, main page]

Skip to content

Use of .Hostname() strips port number in repo.go

Checklist

  • I'm using the latest version of the extension (Run glab --version)
    • Extension version: Put your extension version here
  • Operating system and version: Put your version here
  • Gitlab.com or self-managed instance? gitlab.com/self-managed instance/both
  • GitLab version (if self-managed) GitLab version here (Use the version endpoint, like this: gitlab.my-company.com/api/v4/version)
  • I have performed glab auth status to check for authentication issues
  • Run the command in debug mode (like DEBUG=true glab mr list) and attach any useful output

Summary

When connecting to a host using a non-standard port, the port number is lost as we currently use .Hostname() instead of .Host .

https://gitlab.com/gitlab-org/cli/-/blob/a461af98cf903165a4da90f5b93c6d58840e4cb6/internal/glrepo/repo.go#L203

Environment

  • OS:
  • SHELL:
  • TERM:
  • GLAB:

Other:

Steps to reproduce

What is the current bug behavior?

➜  gdk git:(main) glab cluster agent update-kubeconfig -a 1 -R https://gdk.test:3443/root/agents         
          
   ERROR  
          
  Get "https://gdk.test/api/v4/metadata": dial tcp <ip>:443: connect: connection refused.                     

What is the expected correct behavior?

➜  gdk git:(main) glab cluster agent update-kubeconfig -a 1 -R https://gdk.test:3443/root/agents 
Updated context gdk_test:3443-root_agents-agent1.

Relevant logs and/or screenshots

Possible fixes

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information