diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2019-05-18 08:41:05 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2019-05-18 08:41:48 +0200 |
| commit | 5a4461b07fc2095228b71922606e4a1875852995 (patch) | |
| tree | d7fa7ac1b2c94412dd94bf0e8165e235c1c2f85c /pkg/instance | |
| parent | 40046286a4e35f44d4bbb04bd461da7677145510 (diff) | |
pkg/instance: fix types in OverrideVMCount
vmConfig value is interface{}, not string.
So compare with nil and assign int.
Diffstat (limited to 'pkg/instance')
| -rw-r--r-- | pkg/instance/instance.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go index c2556bcd9..960272245 100644 --- a/pkg/instance/instance.go +++ b/pkg/instance/instance.go @@ -136,10 +136,10 @@ func OverrideVMCount(cfg *mgrconfig.Config, n int) error { if err := json.Unmarshal(cfg.VM, &vmConfig); err != nil { return fmt.Errorf("failed to parse VM config: %v", err) } - if vmConfig["count"] == "" || !vm.AllowsOvercommit(cfg.Type) { + if vmConfig["count"] == nil || !vm.AllowsOvercommit(cfg.Type) { return nil } - vmConfig["count"] = fmt.Sprint(n) + vmConfig["count"] = n vmCfg, err := json.Marshal(vmConfig) if err != nil { return fmt.Errorf("failed to serialize VM config: %v", err) |
