From 87cd045ad0f4f597345e2f4888212e1df6387e9b Mon Sep 17 00:00:00 2001 From: Abdulrahman Elawady Date: Wed, 3 Dec 2025 12:32:01 +0200 Subject: [PATCH] fix: remove logs rmb call Signed-off-by: Abdulrahman Elawady --- .github/workflows/test.yaml | 4 ++-- client/node.go | 12 ------------ pkg/zos_api/logs.go | 24 ------------------------ pkg/zos_api/routes.go | 2 -- 4 files changed, 2 insertions(+), 40 deletions(-) delete mode 100644 pkg/zos_api/logs.go diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a81ad67d..62c24d94 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -6,10 +6,10 @@ jobs: name: Running Daemon Tests runs-on: ubuntu-latest steps: - - name: Set up Go 1.21 + - name: Set up Go 1.23 uses: actions/setup-go@v1 with: - go-version: 1.21 + go-version: 1.23 id: go - name: Prepare dependencies diff --git a/client/node.go b/client/node.go index 2d48753b..26be38c3 100644 --- a/client/node.go +++ b/client/node.go @@ -225,18 +225,6 @@ func (n *NodeClient) NetworkListPublicIPs(ctx context.Context) ([]string, error) return result, nil } -// NetworkListPublicIPs list taken public IPs on the node -func (n *NodeClient) GetVmLogs(ctx context.Context, path string) (string, error) { - const cmd = "zos.logs.vm" - var result string - - if err := n.bus.Call(ctx, n.nodeTwin, cmd, path, &result); err != nil { - return "", err - } - - return result, nil -} - // NetworkListPrivateIPs list private ips reserved for a network func (n *NodeClient) NetworkListPrivateIPs(ctx context.Context, networkName string) ([]string, error) { const cmd = "zos.network.list_private_ips" diff --git a/pkg/zos_api/logs.go b/pkg/zos_api/logs.go deleted file mode 100644 index 18d20bbc..00000000 --- a/pkg/zos_api/logs.go +++ /dev/null @@ -1,24 +0,0 @@ -package zosapi - -import ( - "context" - "encoding/json" - "fmt" - "os" - "path/filepath" -) - -func (g *ZosAPI) getVmLogsHandler(ctx context.Context, payload []byte) (interface{}, error) { - var fileName string - if err := json.Unmarshal(payload, &fileName); err != nil { - return nil, fmt.Errorf("failed to decode file name, expecting string: %w", err) - } - rootPath := "/var/cache/modules/vmd/" - fullPath := filepath.Join(rootPath, fileName) - content, err := os.ReadFile(fullPath) - if err != nil { - return nil, fmt.Errorf("failed to read file, path: %s, %w", fullPath, err) - } - return string(content), nil - -} diff --git a/pkg/zos_api/routes.go b/pkg/zos_api/routes.go index cde39c78..22976feb 100644 --- a/pkg/zos_api/routes.go +++ b/pkg/zos_api/routes.go @@ -52,6 +52,4 @@ func (g *ZosAPI) SetupRoutes(router *peer.Router) { location := root.SubRoute("location") location.WithHandler("get", g.locationGet) - logs := root.SubRoute("logs") - logs.WithHandler("vm", g.getVmLogsHandler) }