fix issue with pve group creation appending unused realm string
This commit is contained in:
@@ -9,7 +9,10 @@ type Pool struct {
|
||||
Templates Templates `json:"templates"`
|
||||
}
|
||||
|
||||
type Groupname struct { // proxmox typically formats as gid-realm for non pve realms
|
||||
// proxmox typically formats as gid-realm for non pve realms
|
||||
// proxmox realms are formatted without realm values
|
||||
// I assume that backends store groups by ID only and only proxmox will append the realm string
|
||||
type Groupname struct {
|
||||
GroupID string `json:"gid"`
|
||||
Realm string `json:"realm"`
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import (
|
||||
)
|
||||
|
||||
// returns an error if the groupname format was not correct
|
||||
// TODO: handle group names with x-y format where y is not a registered realm
|
||||
// TODO: handle group names with x-y-z-... format
|
||||
func ParseGroupname(groupname string) (Groupname, error) {
|
||||
g := Groupname{}
|
||||
x := strings.Split(groupname, "-")
|
||||
|
||||
Reference in New Issue
Block a user