fake

package
v0.5.1-0...-faa3f61 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

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

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

Variables

This section is empty.

Functions

func NewClient

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

NewClient returns a fake Kubernetes clientset.

Types

type Factory

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

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

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

Jump to

Keyboard shortcuts

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