From 2f1cf5acdc9f5c0ee844364c25613bf44ce9964b Mon Sep 17 00:00:00 2001 From: LordMathis Date: Tue, 7 Oct 2025 19:57:21 +0200 Subject: [PATCH] Refactor CreateRemoteInstance and UpdateRemoteInstance to directly use options parameter in API requests --- pkg/manager/remote_ops.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pkg/manager/remote_ops.go b/pkg/manager/remote_ops.go index 5050737..e7b3dbb 100644 --- a/pkg/manager/remote_ops.go +++ b/pkg/manager/remote_ops.go @@ -83,11 +83,8 @@ func (im *instanceManager) ListRemoteInstances(nodeConfig *config.NodeConfig) ([ // CreateRemoteInstance creates a new instance on the remote node func (im *instanceManager) CreateRemoteInstance(nodeConfig *config.NodeConfig, name string, options *instance.CreateInstanceOptions) (*instance.Process, error) { path := fmt.Sprintf("/api/v1/instances/%s/", name) - payload := map[string]any{ - "options": options, - } - resp, err := im.makeRemoteRequest(nodeConfig, "POST", path, payload) + resp, err := im.makeRemoteRequest(nodeConfig, "POST", path, options) if err != nil { return nil, err } @@ -119,11 +116,8 @@ func (im *instanceManager) GetRemoteInstance(nodeConfig *config.NodeConfig, name // UpdateRemoteInstance updates an existing instance on the remote node func (im *instanceManager) UpdateRemoteInstance(nodeConfig *config.NodeConfig, name string, options *instance.CreateInstanceOptions) (*instance.Process, error) { path := fmt.Sprintf("/api/v1/instances/%s/", name) - payload := map[string]any{ - "options": options, - } - resp, err := im.makeRemoteRequest(nodeConfig, "PUT", path, payload) + resp, err := im.makeRemoteRequest(nodeConfig, "PUT", path, options) if err != nil { return nil, err }