blob: faa01356afadca5627c16fed4956eff7c124bd90 [file] [log] [blame]
Serge Bazanski1ebd1e12020-07-13 19:17:16 +02001// Copyright 2020 The Monogon Project Authors.
2//
3// SPDX-License-Identifier: Apache-2.0
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions and
15// limitations under the License.
16
17package main
18
19import (
20 "context"
Serge Bazanski1ebd1e12020-07-13 19:17:16 +020021
22 "git.monogon.dev/source/nexantic.git/core/internal/cluster"
23 "git.monogon.dev/source/nexantic.git/core/internal/containerd"
24 "git.monogon.dev/source/nexantic.git/core/internal/kubernetes"
25 apb "git.monogon.dev/source/nexantic.git/core/proto/api"
26
27 "google.golang.org/grpc/codes"
28 "google.golang.org/grpc/status"
29)
30
31// debugService implements the Smalltown node debug API.
32// TODO(q3k): this should probably be implemented somewhere else way once we have a better
33// supervision introspection/status API.
34type debugService struct {
35 cluster *cluster.Manager
36 kubernetes *kubernetes.Service
37 containerd *containerd.Service
38}
39
40func (s *debugService) GetDebugKubeconfig(ctx context.Context, req *apb.GetDebugKubeconfigRequest) (*apb.GetDebugKubeconfigResponse, error) {
41 return s.kubernetes.GetDebugKubeconfig(ctx, req)
42}
43
44// GetComponentLogs gets various logbuffers from binaries we call. This function just deals with the first path component,
45// delegating the rest to the service-specific handlers.
46func (s *debugService) GetComponentLogs(ctx context.Context, req *apb.GetComponentLogsRequest) (*apb.GetComponentLogsResponse, error) {
Serge Bazanski967be212020-11-02 11:26:59 +010047 return nil, status.Error(codes.Unimplemented, "unimplemented")
Serge Bazanski1ebd1e12020-07-13 19:17:16 +020048}