| // Copyright 2020 The Monogon Project Authors. |
| // |
| // SPDX-License-Identifier: Apache-2.0 |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| package main |
| |
| import ( |
| "context" |
| |
| "git.monogon.dev/source/nexantic.git/core/internal/cluster" |
| "git.monogon.dev/source/nexantic.git/core/internal/containerd" |
| "git.monogon.dev/source/nexantic.git/core/internal/kubernetes" |
| apb "git.monogon.dev/source/nexantic.git/core/proto/api" |
| |
| "google.golang.org/grpc/codes" |
| "google.golang.org/grpc/status" |
| ) |
| |
| // debugService implements the Smalltown node debug API. |
| // TODO(q3k): this should probably be implemented somewhere else way once we have a better |
| // supervision introspection/status API. |
| type debugService struct { |
| cluster *cluster.Manager |
| kubernetes *kubernetes.Service |
| containerd *containerd.Service |
| } |
| |
| func (s *debugService) GetDebugKubeconfig(ctx context.Context, req *apb.GetDebugKubeconfigRequest) (*apb.GetDebugKubeconfigResponse, error) { |
| return s.kubernetes.GetDebugKubeconfig(ctx, req) |
| } |
| |
| // 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) { |
| return nil, status.Error(codes.Unimplemented, "unimplemented") |
| } |