v12.12.0
This commit is contained in:
@@ -38,7 +38,7 @@ type UpdateRequest struct {
|
||||
|
||||
type wrapperUpdateRequest struct {
|
||||
UpdateRequest
|
||||
Config []string `url:"config,omitempty"`
|
||||
Config string `url:"config,omitempty"`
|
||||
}
|
||||
|
||||
// Update updates vfpool device
|
||||
@@ -48,21 +48,15 @@ func (v VFPool) Update(ctx context.Context, req UpdateRequest) (bool, error) {
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
var config []string
|
||||
var config string
|
||||
|
||||
if len(req.Config) != 0 {
|
||||
config = make([]string, 0, len(req.Config))
|
||||
|
||||
for c := range req.Config {
|
||||
b, err := json.Marshal(req.Config[c])
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
config = append(config, string(b))
|
||||
b, err := json.Marshal(req.Config)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
} else {
|
||||
config = []string{}
|
||||
|
||||
config = string(b)
|
||||
}
|
||||
|
||||
reqWrapped := wrapperUpdateRequest{
|
||||
|
||||
Reference in New Issue
Block a user