core: replace logbuffer with logtree
Test Plan: Component logs are currently untested?
X-Origin-Diff: phab/D643
GitOrigin-RevId: 44ace0a1937aee9ba6a49db6e862907ec24d6ea3
diff --git a/core/cmd/init/debug_service.go b/core/cmd/init/debug_service.go
index ef940d9..faa0135 100644
--- a/core/cmd/init/debug_service.go
+++ b/core/cmd/init/debug_service.go
@@ -18,7 +18,6 @@
import (
"context"
- "math"
"git.monogon.dev/source/nexantic.git/core/internal/cluster"
"git.monogon.dev/source/nexantic.git/core/internal/containerd"
@@ -45,32 +44,5 @@
// GetComponentLogs gets various logbuffers from binaries we call. This function just deals with the first path component,
// delegating the rest to the service-specific handlers.
func (s *debugService) GetComponentLogs(ctx context.Context, req *apb.GetComponentLogsRequest) (*apb.GetComponentLogsResponse, error) {
- if len(req.ComponentPath) < 1 {
- return nil, status.Error(codes.InvalidArgument, "component_path needs to contain at least one part")
- }
- linesToRead := int(req.TailLines)
- if linesToRead == 0 {
- linesToRead = math.MaxInt32
- }
- var lines []string
- var err error
- switch req.ComponentPath[0] {
- case "containerd":
- if len(req.ComponentPath) < 2 {
- lines = s.containerd.Log.ReadLinesTruncated(linesToRead, "...")
- } else if req.ComponentPath[1] == "runsc" {
- lines = s.containerd.RunscLog.ReadLinesTruncated(linesToRead, "...")
- }
- case "kube":
- if len(req.ComponentPath) < 2 {
- return nil, status.Error(codes.NotFound, "Component not found")
- }
- lines, err = s.kubernetes.GetComponentLogs(req.ComponentPath[1], linesToRead)
- if err != nil {
- return nil, status.Error(codes.NotFound, "Component not found")
- }
- default:
- return nil, status.Error(codes.NotFound, "component not found")
- }
- return &apb.GetComponentLogsResponse{Line: lines}, nil
+ return nil, status.Error(codes.Unimplemented, "unimplemented")
}