-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new ${System Data/Runtime/Hostname} key to the registration data sent from the elemental-register command. Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
- Loading branch information
Showing
4 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package runtime | ||
|
||
import "os" | ||
|
||
type Info struct { | ||
Hostname string `json:"hostname"` | ||
} | ||
|
||
func New() (*Info, error) { | ||
name, err := os.Hostname() | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return &Info{ | ||
Hostname: name, | ||
}, nil | ||
} |
This file contains 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
This file contains 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