mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
29 lines
452 B
Go
29 lines
452 B
Go
package hns
|
|
|
|
type HNSGlobals struct {
|
|
Version HNSVersion `json:"Version"`
|
|
}
|
|
|
|
type HNSVersion struct {
|
|
Major int `json:"Major"`
|
|
Minor int `json:"Minor"`
|
|
}
|
|
|
|
var (
|
|
HNSVersion1803 = HNSVersion{Major: 7, Minor: 2}
|
|
)
|
|
|
|
func GetHNSGlobals() (*HNSGlobals, error) {
|
|
var version HNSVersion
|
|
err := hnsCall("GET", "/globals/version", "", &version)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
globals := &HNSGlobals{
|
|
Version: version,
|
|
}
|
|
|
|
return globals, nil
|
|
}
|