testk8s

package
v19.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package testk8s provides a fake Kubernetes cluster API for tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TransportTo

func TransportTo(base *url.URL) func(agentID int64) http.RoundTripper

TransportTo is Transport for a server this package did not start.

Types

type ClusterAPI

type ClusterAPI struct {
	// contains filtered or unexported fields
}

ClusterAPI is a fake cluster API server. It answers discovery for core v1 and delegates every other path to the handler it was built with.

func NewClusterAPI

func NewClusterAPI(t *testing.T, objectHandler http.Handler) *ClusterAPI

NewClusterAPI starts a fake cluster API, stopped when the test ends.

func (*ClusterAPI) Served

func (c *ClusterAPI) Served() []string

Served returns the paths requested so far, in order.

func (*ClusterAPI) Transport

func (c *ClusterAPI) Transport() func(agentID int64) http.RoundTripper

Jump to

Keyboard shortcuts

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