osbuild: pass UID/GID as int
These were passed as strings, which is not what osbuild expects. Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
parent
50d469fe45
commit
8c7d8a442b
5 changed files with 13 additions and 46 deletions
|
|
@ -4,7 +4,6 @@ import (
|
|||
"encoding/json"
|
||||
"errors"
|
||||
"sort"
|
||||
"strconv"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/distro"
|
||||
"github.com/osbuild/osbuild-composer/internal/osbuild"
|
||||
|
|
@ -537,15 +536,8 @@ func (r *imageType) userStageOptions(users []blueprint.UserCustomization) (*osbu
|
|||
Key: c.Key,
|
||||
}
|
||||
|
||||
if c.UID != nil {
|
||||
uid := strconv.Itoa(*c.UID)
|
||||
user.UID = &uid
|
||||
}
|
||||
|
||||
if c.GID != nil {
|
||||
gid := strconv.Itoa(*c.GID)
|
||||
user.GID = &gid
|
||||
}
|
||||
user.UID = c.UID
|
||||
user.GID = c.GID
|
||||
|
||||
options.Users[c.Name] = user
|
||||
}
|
||||
|
|
@ -562,10 +554,7 @@ func (r *imageType) groupStageOptions(groups []blueprint.GroupCustomization) *os
|
|||
groupData := osbuild.GroupsStageOptionsGroup{
|
||||
Name: group.Name,
|
||||
}
|
||||
if group.GID != nil {
|
||||
gid := strconv.Itoa(*group.GID)
|
||||
groupData.GID = &gid
|
||||
}
|
||||
groupData.GID = group.GID
|
||||
|
||||
options.Groups[group.Name] = groupData
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strconv"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/distro"
|
||||
"github.com/osbuild/osbuild-composer/internal/osbuild"
|
||||
|
|
@ -350,15 +349,8 @@ func (t *imageType) userStageOptions(users []blueprint.UserCustomization) (*osbu
|
|||
Key: c.Key,
|
||||
}
|
||||
|
||||
if c.UID != nil {
|
||||
uid := strconv.Itoa(*c.UID)
|
||||
user.UID = &uid
|
||||
}
|
||||
|
||||
if c.GID != nil {
|
||||
gid := strconv.Itoa(*c.GID)
|
||||
user.GID = &gid
|
||||
}
|
||||
user.UID = c.UID
|
||||
user.GID = c.GID
|
||||
|
||||
options.Users[c.Name] = user
|
||||
}
|
||||
|
|
@ -375,10 +367,7 @@ func (t *imageType) groupStageOptions(groups []blueprint.GroupCustomization) *os
|
|||
groupData := osbuild.GroupsStageOptionsGroup{
|
||||
Name: group.Name,
|
||||
}
|
||||
if group.GID != nil {
|
||||
gid := strconv.Itoa(*group.GID)
|
||||
groupData.GID = &gid
|
||||
}
|
||||
groupData.GID = group.GID
|
||||
|
||||
options.Groups[group.Name] = groupData
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strconv"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/distro"
|
||||
"github.com/osbuild/osbuild-composer/internal/osbuild"
|
||||
|
|
@ -371,15 +370,8 @@ func (t *imageType) userStageOptions(users []blueprint.UserCustomization) (*osbu
|
|||
Key: c.Key,
|
||||
}
|
||||
|
||||
if c.UID != nil {
|
||||
uid := strconv.Itoa(*c.UID)
|
||||
user.UID = &uid
|
||||
}
|
||||
|
||||
if c.GID != nil {
|
||||
gid := strconv.Itoa(*c.GID)
|
||||
user.GID = &gid
|
||||
}
|
||||
user.UID = c.UID
|
||||
user.GID = c.GID
|
||||
|
||||
options.Users[c.Name] = user
|
||||
}
|
||||
|
|
@ -396,10 +388,7 @@ func (t *imageType) groupStageOptions(groups []blueprint.GroupCustomization) *os
|
|||
groupData := osbuild.GroupsStageOptionsGroup{
|
||||
Name: group.Name,
|
||||
}
|
||||
if group.GID != nil {
|
||||
gid := strconv.Itoa(*group.GID)
|
||||
groupData.GID = &gid
|
||||
}
|
||||
groupData.GID = group.GID
|
||||
|
||||
options.Groups[group.Name] = groupData
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ type GroupsStageOptions struct {
|
|||
func (GroupsStageOptions) isStageOptions() {}
|
||||
|
||||
type GroupsStageOptionsGroup struct {
|
||||
Name string `json:"name"`
|
||||
GID *string `json:"gid,omitempty"`
|
||||
Name string `json:"name"`
|
||||
GID *int `json:"gid,omitempty"`
|
||||
}
|
||||
|
||||
func NewGroupsStage(options *GroupsStageOptions) *Stage {
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ type UsersStageOptions struct {
|
|||
func (UsersStageOptions) isStageOptions() {}
|
||||
|
||||
type UsersStageOptionsUser struct {
|
||||
UID *string `json:"uid,omitempty"`
|
||||
GID *string `json:"gid,omitempty"`
|
||||
UID *int `json:"uid,omitempty"`
|
||||
GID *int `json:"gid,omitempty"`
|
||||
Groups []string `json:"groups,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
Home *string `json:"home,omitempty"`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue