Serge Bazanski | 1ebd1e1 | 2020-07-13 19:17:16 +0200 | [diff] [blame] | 1 | // 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 | |
| 17 | package main |
| 18 | |
| 19 | import ( |
| 20 | "context" |
Serge Bazanski | 1ebd1e1 | 2020-07-13 19:17:16 +0200 | [diff] [blame] | 21 | |
| 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. |
| 34 | type debugService struct { |
| 35 | cluster *cluster.Manager |
| 36 | kubernetes *kubernetes.Service |
| 37 | containerd *containerd.Service |
| 38 | } |
| 39 | |
| 40 | func (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. |
| 46 | func (s *debugService) GetComponentLogs(ctx context.Context, req *apb.GetComponentLogsRequest) (*apb.GetComponentLogsResponse, error) { |
Serge Bazanski | 967be21 | 2020-11-02 11:26:59 +0100 | [diff] [blame^] | 47 | return nil, status.Error(codes.Unimplemented, "unimplemented") |
Serge Bazanski | 1ebd1e1 | 2020-07-13 19:17:16 +0200 | [diff] [blame] | 48 | } |