cloudapi: add installer customizations to the API
Adding both as a traditional compose request customization and in the new blueprint customizations.
This commit is contained in:
parent
eccdcfcab0
commit
8f78171f83
4 changed files with 203 additions and 149 deletions
|
|
@ -413,6 +413,16 @@ func (request *ComposeRequest) GetCustomizationsFromBlueprintRequest() (*bluepri
|
|||
c.FIPS = rbpc.Fips
|
||||
}
|
||||
|
||||
if installer := rbpc.Installer; installer != nil {
|
||||
c.Installer = &blueprint.InstallerCustomization{}
|
||||
if installer.Unattended != nil {
|
||||
c.Installer.Unattended = *installer.Unattended
|
||||
}
|
||||
if installer.SudoNopasswd != nil {
|
||||
c.Installer.SudoNopasswd = *installer.SudoNopasswd
|
||||
}
|
||||
}
|
||||
|
||||
return c, nil
|
||||
}
|
||||
|
||||
|
|
@ -872,6 +882,17 @@ func (request *ComposeRequest) GetBlueprintFromCustomizations() (blueprint.Bluep
|
|||
bp.Customizations.FIPS = request.Customizations.Fips.Enabled
|
||||
}
|
||||
|
||||
if request.Customizations.Installer != nil {
|
||||
installer := &blueprint.InstallerCustomization{}
|
||||
if request.Customizations.Installer.Unattended != nil {
|
||||
installer.Unattended = *request.Customizations.Installer.Unattended
|
||||
}
|
||||
if request.Customizations.Installer.SudoNopasswd != nil {
|
||||
installer.SudoNopasswd = *request.Customizations.Installer.SudoNopasswd
|
||||
}
|
||||
bp.Customizations.Installer = installer
|
||||
}
|
||||
|
||||
// Did bp.Customizations get set at all? If not, set it back to nil
|
||||
if reflect.DeepEqual(*bp.Customizations, blueprint.Customizations{}) {
|
||||
bp.Customizations = nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue