public

package
v18.9.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2018 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	K8sClientSubsystemName     = "kubernetes"
	K8sClientCheckDescription  = "control plane can talk to Kubernetes"
	PromClientSubsystemName    = "prometheus"
	PromClientCheckDescription = "control plane can talk to Prometheus"
)

Variables

This section is empty.

Functions

func GenStatSummaryResponse

func GenStatSummaryResponse(resName, resType, resNs string, counts *PodCounts) pb.StatSummaryResponse

func NewExternalClient

func NewExternalClient(controlPlaneNamespace string, kubeAPI *k8s.KubernetesAPI) (pb.ApiClient, error)

func NewInternalClient

func NewInternalClient(controlPlaneNamespace string, kubeAPIHost string) (pb.ApiClient, error)

func NewServer

func NewServer(
	addr string,
	prometheusClient promApi.Client,
	tapClient tapPb.TapClient,
	k8sAPI *k8s.API,
	controllerNamespace string,
	ignoredNamespaces []string,
) *http.Server

Types

type MockApiClient

type MockApiClient struct {
	ErrorToReturn                   error
	VersionInfoToReturn             *pb.VersionInfo
	ListPodsResponseToReturn        *pb.ListPodsResponse
	StatSummaryResponseToReturn     *pb.StatSummaryResponse
	SelfCheckResponseToReturn       *healthcheckPb.SelfCheckResponse
	Api_TapClientToReturn           pb.Api_TapClient
	Api_TapByResourceClientToReturn pb.Api_TapByResourceClient
}

func (*MockApiClient) ListPods

func (*MockApiClient) StatSummary

func (*MockApiClient) Tap

func (*MockApiClient) TapByResource

func (*MockApiClient) Version

func (c *MockApiClient) Version(ctx context.Context, in *pb.Empty, opts ...grpc.CallOption) (*pb.VersionInfo, error)

type MockApi_TapByResourceClient

type MockApi_TapByResourceClient struct {
	TapEventsToReturn []pb.TapEvent
	ErrorsToReturn    []error
	grpc.ClientStream
}

func (*MockApi_TapByResourceClient) Recv

type MockApi_TapClient

type MockApi_TapClient struct {
	TapEventsToReturn []pb.TapEvent
	ErrorsToReturn    []error
	grpc.ClientStream
}

func (*MockApi_TapClient) Recv

func (a *MockApi_TapClient) Recv() (*pb.TapEvent, error)

type MockProm

type MockProm struct {
	Res             model.Value
	QueriesExecuted []string // expose the queries our Mock Prometheus receives, to test query generation
	// contains filtered or unexported fields
}

func (*MockProm) LabelValues

func (m *MockProm) LabelValues(ctx context.Context, label string) (model.LabelValues, error)

func (*MockProm) Query

func (m *MockProm) Query(ctx context.Context, query string, ts time.Time) (model.Value, error)

satisfies v1.API

func (*MockProm) QueryRange

func (m *MockProm) QueryRange(ctx context.Context, query string, r v1.Range) (model.Value, error)

func (*MockProm) Series

func (m *MockProm) Series(ctx context.Context, matches []string, startTime time.Time, endTime time.Time) ([]model.LabelSet, error)

type PodCounts

type PodCounts struct {
	MeshedPods  uint64
	RunningPods uint64
	FailedPods  uint64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL