Sitelet https://github.com/kubernetes/kops/pull/18698
Skip to content

aws: report the SSH user for Rocky Linux instances - #18698

Merged
kubernetes-prow[bot] merged 1 commit into
kubernetes:masterfrom
rifelpet:aws-dump-rocky-ssh-user
Aug 16, 2026
Merged

kubernetes-prow[bot] merged 1 commit into
kubernetes:masterfrom
rifelpet:aws-dump-rocky-ssh-user

Conversation

@rifelpet

Copy link
Copy Markdown
Member

guessSSHUser (pkg/resources/aws/aws.go) maps well-known image owner accounts to their default SSH user, and is what populates sshUser for each instance in kops toolbox dump. It handles Amazon Linux 2023, RHEL, Debian, Ubuntu, Flatcar and a centos name prefix — but never learned about Rocky Linux, so every Rocky instance dumps an empty sshUser.

kops already recognizes the account everywhere else: upup/pkg/fi/cloudup/awsup/aws_cloud.go:119 defines WellKnownAccountRockyLinux, and ResolveImageOwnerAlias maps both rocky and rockylinux to it. guessSSHUser is the only place that was missed.

Why it matters now

Beyond toolbox dump output being wrong for Rocky users today, this blocks work in flight. kubetest2-kops is moving toward deriving the SSH user from kops toolbox dump instead 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-user to ubuntu when it is not supplied, so an empty derived value silently degrades to ubuntu — which fails on Rocky.

That would regress the 154 AWS Rocky e2e jobs whose KUBE_SSH_USER is currently the correct rocky from aws_distros_ssh_user. Fixing the guess first keeps the derived value at least as good as the curated one.

Testing

New TestGuessSSHUser covers every owner the function knows about — ec2-user for Amazon Linux 2023 and RHEL, admin for Debian, ubuntu for Ubuntu, core for Flatcar, rocky for Rocky Linux — plus the centos name-prefix branch and the unrecognized-image fallback, so the next addition here is less likely to be forgotten.

go build ./..., go vet and go test ./pkg/resources/aws/... pass.

🤖 Generated with Claude Code

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.
@kubernetes-prow

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kubernetes-prow kubernetes-prow Bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 16, 2026
@kubernetes-prow
kubernetes-prow Bot requested review from hakman and zetaab August 16, 2026 13:16
@kubernetes-prow kubernetes-prow Bot added the area/provider/aws Issues or PRs related to aws provider label Aug 16, 2026
@rifelpet
rifelpet marked this pull request as ready for review August 16, 2026 13:18
@kubernetes-prow kubernetes-prow Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 16, 2026
@kubernetes-prow
kubernetes-prow Bot requested a review from olemarkus August 16, 2026 13:19
@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 16, 2026
@kubernetes-prow

Copy link
Copy Markdown
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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 16, 2026
@kubernetes-prow
kubernetes-prow Bot merged commit 0a25a9f into kubernetes:master Aug 16, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/provider/aws Issues or PRs related to aws provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants