Skip to content

feature(cmx): add ability to set custom username #547

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

Merged
merged 2 commits into from
May 15, 2025

Conversation

squizzi
Copy link
Member

@squizzi squizzi commented May 15, 2025

This PR adds support for overriding the GitHubUsername value set in vendor-portal. It can be overridden in the event that the username cannot be obtained from portal either for reason of error or simply the fact that the username is not populated.

Testing

  • Added unit tests to the existing tests for vm_endpoints
  • Manual testing:

Removed github username from vendor-portal:

./bin/replicated vm ssh-endpoint squizzi-ubuntu
Error: no GitHub account associated with Vendor Portal user
Visit the Account Settings page in Vendor Portal to link your account
Alternatively, you can use the --username flag to specify a custom username for the endpoint

Usage:
  replicated vm ssh-endpoint VM_ID_OR_NAME [flags]

Example:
  # Get SSH endpoint for a specific VM by ID
  replicated vm ssh-endpoint aaaaa11

  # Get SSH endpoint for a specific VM by name
  replicated vm ssh-endpoint my-test-vm

  # Get SSH endpoint with a custom username
  replicated vm ssh-endpoint my-test-vm --username custom-user

Flags:
  -h, --help              help for ssh-endpoint
      --username string   Custom username to use in SSH endpoint instead of the GitHub username set in Vendor Portal

Global Flags:
      --app string     The app slug or app id to use in all calls
      --debug          Enable debug output
      --token string   The API token to use to access your app in the Vendor API

Use --username flag to override:

./bin/replicated vm ssh-endpoint squizzi-ubuntu --username "banana"
ssh://[email protected]:43157

./bin/replicated vm scp-endpoint squizzi-ubuntu --username "banana"
scp://[email protected]:43157

Readd username to portal:

./bin/replicated vm ssh-endpoint squizzi-ubuntu
ssh://[email protected]:43157

Signed-off-by: Kyle Squizzato <[email protected]>
@squizzi squizzi merged commit 786909d into main May 15, 2025
5 checks passed
@squizzi squizzi deleted the squizzi/sc-123604/ssh-endpoint-username branch May 15, 2025 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants