example

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package example is the internal version of the example.pingcap.com api group for e2e testing +k8s:deepcopy-gen=package,register +groupName=example.pingcap.com

Index

Constants

This section is empty.

Variables

View Source
var (
	ExamplePodStorage = builders.NewApiResource(
		InternalPod,
		func() runtime.Object { return &Pod{} },
		func() runtime.Object { return &PodList{} },
		&PodStrategy{builders.StorageStrategySingleton},
	)
	InternalPod = builders.NewInternalResource(
		"pods",
		"Pod",
		func() runtime.Object { return &Pod{} },
		func() runtime.Object { return &PodList{} },
	)
	InternalPodStatus = builders.NewInternalResourceStatus(
		"pods",
		"PodStatus",
		func() runtime.Object { return &Pod{} },
		func() runtime.Object { return &PodList{} },
	)
	// Registered resources and subresources
	ApiVersion = builders.NewApiGroup("example.pingcap.com").WithKinds(
		InternalPod,
		InternalPodStatus,
	)

	// Required by code generated by go2idl
	AddToScheme = (&runtime.SchemeBuilder{
		ApiVersion.SchemeBuilder.AddToScheme,
		RegisterDefaults,
	}).AddToScheme
	SchemeBuilder = ApiVersion.SchemeBuilder

	SchemeGroupVersion = ApiVersion.GroupVersion
)

Functions

func Kind

func Kind(kind string) schema.GroupKind

Required by code generated by go2idl Kind takes an unqualified kind and returns a Group qualified GroupKind

func RegisterDefaults

func RegisterDefaults(scheme *runtime.Scheme) error

RegisterDefaults adds defaulters functions to the given scheme. Public to allow building arbitrary schemes. All generated defaulters are covering - they call all nested defaulters.

func Resource

func Resource(resource string) schema.GroupResource

Required by code generated by go2idl Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type ContainerSpec

type ContainerSpec struct {
	Image           string
	ImagePullPolicy string
}

func (*ContainerSpec) DeepCopy

func (in *ContainerSpec) DeepCopy() *ContainerSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerSpec.

func (*ContainerSpec) DeepCopyInto

func (in *ContainerSpec) DeepCopyInto(out *ContainerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Pod

type Pod struct {
	metav1.TypeMeta
	metav1.ObjectMeta
	Spec   PodSpec
	Status PodStatus
}

func (*Pod) DeepCopy

func (in *Pod) DeepCopy() *Pod

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Pod.

func (*Pod) DeepCopyInto

func (in *Pod) DeepCopyInto(out *Pod)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Pod) DeepCopyObject

func (in *Pod) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (Pod) GetGeneration

func (pc Pod) GetGeneration() int64

func (*Pod) GetObjectMeta

func (pc *Pod) GetObjectMeta() *metav1.ObjectMeta

func (*Pod) GetSpec

func (pc *Pod) GetSpec() interface{}

func (*Pod) GetStatus

func (pc *Pod) GetStatus() interface{}

func (Pod) NewStatus

func (Pod) NewStatus() interface{}

func (*Pod) SetGeneration

func (pc *Pod) SetGeneration(generation int64)

func (*Pod) SetSpec

func (pc *Pod) SetSpec(s interface{})

func (*Pod) SetStatus

func (pc *Pod) SetStatus(s interface{})

type PodList

type PodList struct {
	metav1.TypeMeta
	metav1.ListMeta
	Items []Pod
}

func (*PodList) DeepCopy

func (in *PodList) DeepCopy() *PodList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodList.

func (*PodList) DeepCopyInto

func (in *PodList) DeepCopyInto(out *PodList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PodList) DeepCopyObject

func (in *PodList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PodRegistry

type PodRegistry interface {
	ListPods(ctx context.Context, options *internalversion.ListOptions) (*PodList, error)
	GetPod(ctx context.Context, id string, options *metav1.GetOptions) (*Pod, error)
	CreatePod(ctx context.Context, id *Pod) (*Pod, error)
	UpdatePod(ctx context.Context, id *Pod) (*Pod, error)
	DeletePod(ctx context.Context, id string) (bool, error)
}

Registry is an interface for things that know how to store Pod. +k8s:deepcopy-gen=false

func NewPodRegistry

func NewPodRegistry(sp builders.StandardStorageProvider) PodRegistry

NewRegistry returns a new Registry interface for the given Storage. Any mismatched types will panic.

type PodSpec

type PodSpec struct {
	// New field introduced in v1beta1 to store multiple containers
	Containers []ContainerSpec
	// In real case, we design the v1alpha1 API first, so we must keep this
	// field to be backward compatible with the objects written formerly
	Container    ContainerSpec
	NodeSelector map[string]string
	Tolerations  []string
	HostName     string

	// helper field to distinguish whether the .spec.tolerations is unset or empty
	HasTolerations bool
}

PodSpec is the internal version of pod spec

func (*PodSpec) DeepCopy

func (in *PodSpec) DeepCopy() *PodSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSpec.

func (*PodSpec) DeepCopyInto

func (in *PodSpec) DeepCopyInto(out *PodSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PodStatus

type PodStatus struct {
	Phase string
}

func (*PodStatus) DeepCopy

func (in *PodStatus) DeepCopy() *PodStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodStatus.

func (*PodStatus) DeepCopyInto

func (in *PodStatus) DeepCopyInto(out *PodStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PodStatusStrategy

type PodStatusStrategy struct {
	builders.DefaultStatusStorageStrategy
}

+k8s:deepcopy-gen=false

type PodStrategy

type PodStrategy struct {
	builders.DefaultStorageStrategy
}

Pod Functions and Structs

+k8s:deepcopy-gen=false

func (PodStrategy) PrepareForUpdate

func (p PodStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object)

func (PodStrategy) Validate

Validate checks that an instance of Pod is well formed

func (PodStrategy) ValidateUpdate

func (p PodStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList

ValidateUpdate checks if the update is valid

Directories

Path Synopsis
Package v1alpha1 the v1alpha1 version of the example.pingcap.com api group.
Package v1alpha1 the v1alpha1 version of the example.pingcap.com api group.
Package v1beta1 is the v1beta1 version of the example.pingcap.com api group.
Package v1beta1 is the v1beta1 version of the example.pingcap.com api group.

Jump to

Keyboard shortcuts

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