Skip to content
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

[core] Hostname logic refactoring #2822

Merged
merged 1 commit into from Sep 8, 2016
Merged

[core] Hostname logic refactoring #2822

merged 1 commit into from Sep 8, 2016

Conversation

remh
Copy link
Contributor

@remh remh commented Sep 7, 2016

What does this PR do?

This PR:

  • Moves hostname logic in its own util module
  • Moves cloud metadata logic in its own util module
  • Add a new way to determine the hostname using the kubelet
  • Some code cleaning/consolidating

Motivation

Needed to have another way to find the hostname when running kubernetes but i realized that this logic could benefit from refactoring so i did.

@remh
Copy link
Contributor Author

remh commented Sep 7, 2016

Forgot to mention that it also switched the metadata collection from GCE and AWS to requests instead of urllib

@remh remh force-pushed the remh/hostname_logic branch 3 times, most recently from 73a5539 to ac1a1b0 Compare September 8, 2016 16:03
return config_hostname

# Try to get GCE instance name
if hostname is None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hostname will always be None

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ha good point, it was the old logic though that just got moved but yeah

@degemer
Copy link
Member

degemer commented Sep 8, 2016

It looks way better now ! 🍰

Only nitpicks, looks good otherwise.

This commit:
- Moves hostname logic in it’s own util module
- Moves cloud metadata logic in it’s own util module
- Add a new way to determine the hostname using the kubelet
- Some code cleaning/consolidating
@remh
Copy link
Contributor Author

remh commented Sep 8, 2016

Fixed the nitpicks

@remh
Copy link
Contributor Author

remh commented Sep 8, 2016

Tests are failing on the bad ES tests, merging.

@remh remh merged commit db02f28 into master Sep 8, 2016
@remh remh deleted the remh/hostname_logic branch September 8, 2016 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants