...

Package fake

import "github.com/linkerd/linkerd2/controller/proxy-injector/fake"
Overview
Index

Overview ▾

Constants

These constants provide default, fake strings for testing proxy-injector.

const (
    DefaultControllerNamespace = "linkerd"
    DefaultNamespace           = "default"
)

func NewClient

func NewClient(kubeconfig string, objs ...runtime.Object) kubernetes.Interface

NewClient returns a fake Kubernetes clientset.

type Factory

Factory is a factory that can convert in-file YAML content into Kubernetes API objects.

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

func NewFactory

func NewFactory(rootDir string) *Factory

NewFactory returns a new instance of Fixture.

func (*Factory) AdmissionReview

func (f *Factory) AdmissionReview(filename string) (*admissionv1beta1.AdmissionReview, error)

AdmissionReview returns the content of the specified file as an AdmissionReview type. An error will be returned if: i. the file doesn't exist in the 'fake/data' folder or, ii. the file content isn't a valid YAML structure that can be unmarshalled into AdmissionReview type

func (*Factory) ConfigMap

func (f *Factory) ConfigMap(filename string) (*corev1.ConfigMap, error)

ConfigMap returns the content of the specified file as a ConfigMap type. An error will be returned if: i. the file doesn't exist in the 'fake/data' folder or ii. the file content isn't a valid YAML structure that can be unmarshalled into ConfigMap type

func (*Factory) Container

func (f *Factory) Container(filename string) (*corev1.Container, error)

Container returns the content of the specified file as a Container type. An error will be returned if: i. the file doesn't exist in the 'fake/data' folder or ii. the file content isn't a valid YAML structure that can be unmarshalled into Container type

func (*Factory) Deployment

func (f *Factory) Deployment(filename string) (*appsv1.Deployment, error)

Deployment returns the content of the specified file as a Deployment type. An error will be returned if: i. the file doesn't exist in the 'fake/data' folder or ii. the file content isn't a valid YAML structure that can be unmarshalled into Deployment type

func (*Factory) FileContents

func (f *Factory) FileContents(filename string) ([]byte, error)

FileContents returns the content of the specified file as a slice of bytes. If the file doesn't exist in the 'fake/data' folder, an error will be returned.

func (*Factory) Namespace

func (f *Factory) Namespace(filename string) (*corev1.Namespace, error)

Namespace returns the content of the specified file as a Namespace type. An error will be returned if: i. the file doesn't exist in the 'fake/data' folder or ii. the file content isn't a valid YAML structure that can be unmarshalled into Namespace type

func (*Factory) Volume

func (f *Factory) Volume(filename string) (*corev1.Volume, error)

Volume returns the content of the specified file as a Volume type. An error will be returned if: i. the file doesn't exist in the 'fake/data' folder or ii. the file content isn't a valid YAML structure that can be unmarshalled into Volume type