cloudapi/v2/compose: don't overwrite customizations struct
The customizations struct contains different kinds of customizations, such as users and filesystems. If both filesystems and users are configured, the current code overwrites the user configuration. Change this by unconditionally allocating the customizations struct when creating the empty blueprint, and ammending it for each customization we find. This means that the customizations will be non-nil, also when it is empty, which was not the case in the past. This should not change the behavior of the code.
This commit is contained in:
parent
351d06aecf
commit
bb486bcccb
1 changed files with 3 additions and 6 deletions
|
|
@ -173,6 +173,7 @@ func (h *apiHandlers) PostCompose(ctx echo.Context) error {
|
|||
if err != nil {
|
||||
return HTTPErrorWithInternal(ErrorFailedToInitializeBlueprint, err)
|
||||
}
|
||||
bp.Customizations = &blueprint.Customizations{}
|
||||
|
||||
// Set the blueprint customisation to take care of the user
|
||||
if request.Customizations != nil && request.Customizations.Users != nil {
|
||||
|
|
@ -192,9 +193,7 @@ func (h *apiHandlers) PostCompose(ctx echo.Context) error {
|
|||
},
|
||||
)
|
||||
}
|
||||
bp.Customizations = &blueprint.Customizations{
|
||||
User: userCustomizations,
|
||||
}
|
||||
bp.Customizations.User = userCustomizations
|
||||
}
|
||||
|
||||
if request.Customizations != nil && request.Customizations.Packages != nil {
|
||||
|
|
@ -216,9 +215,7 @@ func (h *apiHandlers) PostCompose(ctx echo.Context) error {
|
|||
},
|
||||
)
|
||||
}
|
||||
bp.Customizations = &blueprint.Customizations{
|
||||
Filesystem: fsCustomizations,
|
||||
}
|
||||
bp.Customizations.Filesystem = fsCustomizations
|
||||
}
|
||||
|
||||
// add the user-defined repositories only to the depsolve job for the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue