aws: report the SSH user for Rocky Linux instances - #18698
Merged
kubernetes-prow[bot] merged 1 commit intoAug 16, 2026
Merged
Conversation
guessSSHUser maps a handful of well-known image owner accounts to their default SSH user, but it never learned about Rocky Linux, so every Rocky instance dumps an empty sshUser in "kops toolbox dump". kops already recognizes the account elsewhere: awsup defines WellKnownAccountRockyLinux and ResolveImageOwnerAlias maps both "rocky" and "rockylinux" to it, so this is the only place that was missed. Add the case, and a table test covering every owner guessSSHUser knows about plus the centos name-prefix path and the unrecognized fallback.
Contributor
|
Skipping CI for Draft Pull Request. |
rifelpet
marked this pull request as ready for review
August 16, 2026 13:18
hakman
approved these changes
Aug 16, 2026
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hakman The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
guessSSHUser(pkg/resources/aws/aws.go) maps well-known image owner accounts to their default SSH user, and is what populatessshUserfor each instance inkops toolbox dump. It handles Amazon Linux 2023, RHEL, Debian, Ubuntu, Flatcar and acentosname prefix — but never learned about Rocky Linux, so every Rocky instance dumps an emptysshUser.kops already recognizes the account everywhere else:
upup/pkg/fi/cloudup/awsup/aws_cloud.go:119definesWellKnownAccountRockyLinux, andResolveImageOwnerAliasmaps bothrockyandrockylinuxto it.guessSSHUseris the only place that was missed.Why it matters now
Beyond
toolbox dumpoutput being wrong for Rocky users today, this blocks work in flight.kubetest2-kopsis moving toward deriving the SSH user fromkops toolbox dumpinstead of taking it from a hardcoded per-distro table in the prow job config (the same direction as the ephemeral SSH keys in #18686). The kops CLI defaults--ssh-usertoubuntuwhen it is not supplied, so an empty derived value silently degrades toubuntu— which fails on Rocky.That would regress the 154 AWS Rocky e2e jobs whose
KUBE_SSH_USERis currently the correctrockyfromaws_distros_ssh_user. Fixing the guess first keeps the derived value at least as good as the curated one.Testing
New
TestGuessSSHUsercovers every owner the function knows about —ec2-userfor Amazon Linux 2023 and RHEL,adminfor Debian,ubuntufor Ubuntu,corefor Flatcar,rockyfor Rocky Linux — plus thecentosname-prefix branch and the unrecognized-image fallback, so the next addition here is less likely to be forgotten.go build ./...,go vetandgo test ./pkg/resources/aws/...pass.🤖 Generated with Claude Code