fakekubeapi

package
v0.0.0-...-f938a04 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package fakekubeapi supports integration testing of kms-plugin by faking K8S kube-apiserver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server fakes kube-apiserver.

func New

func New(namespaces corev1.NamespaceList, secrets map[string][]corev1.Secret, port int, kmsClient *kmspluginclient.Client, timeout time.Duration) (*Server, error)

New constructs kube-apiserver fake. It is the responsibility of the caller to call Close.

func (*Server) Client

func (f *Server) Client() *http.Client

Client returns *http.Client for the fake.

func (*Server) Close

func (f *Server) Close()

Close closes the underlying httptest.Server.

func (*Server) ListSecretsRequestsEquals

func (f *Server) ListSecretsRequestsEquals(r []corev1.Secret) error

ListSecretsRequestsEquals validates that the supplied Secrets are equal to all secrets processed by the server via http.Get.

func (*Server) PutSecretsEquals

func (f *Server) PutSecretsEquals(r []corev1.Secret) error

PutSecretsEquals validates that the supplied Secrets are equal to all secrets processed by the server via http.Put.

func (*Server) URL

func (f *Server) URL() string

URL returns URL on which the fake is expecting requests.

Jump to

Keyboard shortcuts

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