cloudapi/v2: tweak customizations

Fix verbiage of groups customization, fields which accept an array
should be plural.

Remove the sshkey customization, sshkeys are merged into user
customizations anyway, so users should use the "users" customization
instead.

Since these customizations aren't in use yet, this edit should be fine.

See #3716
This commit is contained in:
Sanne Raymaekers 2023-12-06 10:50:18 +01:00
parent 1afe7d20c8
commit bfad6d50e1
4 changed files with 120 additions and 178 deletions

View file

@ -272,20 +272,9 @@ func (request *ComposeRequest) GetBlueprintWithCustomizations() (blueprint.Bluep
bp.Customizations.Kernel = kernel
}
if request.Customizations.Sshkey != nil {
keys := []blueprint.SSHKeyCustomization{}
for _, key := range *request.Customizations.Sshkey {
keys = append(keys, blueprint.SSHKeyCustomization{
User: key.User,
Key: key.Key,
})
}
bp.Customizations.SSHKey = keys
}
if request.Customizations.Group != nil {
if request.Customizations.Groups != nil {
groups := []blueprint.GroupCustomization{}
for _, group := range *request.Customizations.Group {
for _, group := range *request.Customizations.Groups {
groups = append(groups, blueprint.GroupCustomization{
Name: group.Name,
GID: group.Gid,