Skip to content

Commit

Permalink
call underlying os.Hostname instead of the entire hostInfo gopsutil c…
Browse files Browse the repository at this point in the history
…all (#479)

* call underlying os.Hostname instad of the entire hostInfo gopsutil call
  • Loading branch information
oliveromahony authored Sep 21, 2023
1 parent d1f6013 commit 556e620
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
8 changes: 3 additions & 5 deletions src/core/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,12 @@ func getUnixName() string {
}

func (env *EnvironmentType) GetHostname() string {
ctx := context.Background()
defer ctx.Done()
hostInformation, err := host.InfoWithContext(ctx)
hostname, err := os.Hostname()
if err != nil {
log.Warnf("Unable to read hostname from dataplane, defaulting value. Error: %v", err)
return ""
hostname = ""
}
return hostInformation.Hostname
return hostname
}

func (env *EnvironmentType) GetSystemUUID() string {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 556e620

Please sign in to comment.