-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
apiserver_nocompile.go
56 lines (45 loc) · 2.02 KB
/
apiserver_nocompile.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2020 Datadog, Inc.
// +build !kubeapiserver
package apiserver
import (
"errors"
apiv1 "github.com/DataDog/datadog-agent/pkg/clusteragent/api/v1"
"github.com/DataDog/datadog-agent/pkg/util/log"
)
var (
// ErrNotCompiled is returned if kubernetes apiserver support is not compiled in.
// User classes should handle that case as gracefully as possible.
ErrNotCompiled = errors.New("kubernetes apiserver support not compiled in")
)
// APIClient provides authenticated access to the
type APIClient struct {
Cl interface{}
}
// GetAPIClient returns the shared ApiClient instance.
func GetAPIClient() (*APIClient, error) {
log.Errorf("GetAPIClient not implemented %s", ErrNotCompiled.Error())
return &APIClient{}, nil
}
// GetPodMetadataNames is used when the API endpoint of the DCA to get the services of a pod is hit.
func GetPodMetadataNames(nodeName, ns, podName string) ([]string, error) {
log.Errorf("GetPodMetadataNames not implemented %s", ErrNotCompiled.Error())
return nil, nil
}
// GetMetadataMapBundleOnNode is used for the CLI svcmap command to output given a nodeName
func GetMetadataMapBundleOnNode(nodeName string) (*apiv1.MetadataResponse, error) {
log.Errorf("GetMetadataMapBundleOnNode not implemented %s", ErrNotCompiled.Error())
return nil, nil
}
// GetMetadataMapBundleOnAllNodes is used for the CLI svcmap command to run fetch the service map of all nodes.
func GetMetadataMapBundleOnAllNodes(_ *APIClient) (*apiv1.MetadataResponse, error) {
log.Errorf("GetMetadataMapBundleOnAllNodes not implemented %s", ErrNotCompiled.Error())
return nil, nil
}
// GetNodeLabels retrieves the labels of the queried node from the cache of the shared informer.
func GetNodeLabels(nodeName string) (map[string]string, error) {
log.Errorf("GetNodeLabels not implemented %s", ErrNotCompiled.Error())
return nil, nil
}