-
Notifications
You must be signed in to change notification settings - Fork 281
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
[release-1.21] Use FQDN for node name if cloud provider is set to AWS #1622
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor nit on string trimming, but lgtm!
pkg/rke2/rke2_linux.go
Outdated
fqdn := b.String() | ||
fqdn = fqdn[:len(fqdn)-1] | ||
|
||
return fqdn, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fqdn := b.String() | |
fqdn = fqdn[:len(fqdn)-1] | |
return fqdn, nil | |
return strings.TrimSpace(b.String()), nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do this, then we don't need line 205.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
pkg/rke2/rke2_linux.go
Outdated
nodeName := clx.String("node-name") | ||
if nodeName == "" && cfg.CloudProviderName == "aws" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only appear to use the nodeName in the test; don't bother creating a variable for it?
nodeName := clx.String("node-name") | |
if nodeName == "" && cfg.CloudProviderName == "aws" { | |
if clx.String("node-name") == "" && cfg.CloudProviderName == "aws" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I think at some point we might want this function in a util package somewhere, but that doesn't have to happen now.
Proposed Changes
Use FQDN hostname for node name if
--node-name
is not set and--cloud-provider-name
is set to AWSYes we should mention that if the user didn't enter a specific node name and cloud provider is set to aws then node name will default to
hostname -f
Types of Changes
Bug Fix
Verification
Linked Issues
#1618
Further Comments