testing

package
v0.0.0-...-20d7626 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

+k8s:deepcopy-gen=package +groupName=pkg.knative.dev

Index

Constants

This section is empty.

Variables

View Source
var (
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: "pkg.knative.dev", Version: "v2"}

SchemeGroupVersion is group version used to register these objects

Functions

func WithValue

func WithValue(ctx context.Context, val string) context.Context

WithValue returns a WithContext for attaching an OnContext with the given value.

Types

type InlinedPtrStruct

type InlinedPtrStruct struct {
	// Deprecated: This field is deprecated.
	DeprecatedField string `json:"fieldB,omitempty"`
}

func (*InlinedPtrStruct) DeepCopy

func (in *InlinedPtrStruct) DeepCopy() *InlinedPtrStruct

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

func (*InlinedPtrStruct) DeepCopyInto

func (in *InlinedPtrStruct) DeepCopyInto(out *InlinedPtrStruct)

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

type InlinedStruct

type InlinedStruct struct {
	// Deprecated: This field is deprecated.
	DeprecatedField   string `json:"fieldA,omitempty"`
	*InlinedPtrStruct `json:",inline"`
}

func (*InlinedStruct) DeepCopy

func (in *InlinedStruct) DeepCopy() *InlinedStruct

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

func (*InlinedStruct) DeepCopyInto

func (in *InlinedStruct) DeepCopyInto(out *InlinedStruct)

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

type InnerDefaultResource

type InnerDefaultResource struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Note that this does _not_ have omitempty. So when JSON is round tripped through the Golang
	// type, `spec: {}` will automatically be injected.
	Spec InnerDefaultSpec `json:"spec"`

	// Status is a simple status.
	Status InnerDefaultStatus `json:"status,omitempty"`
}

InnerDefaultResource is a simple resource that's compatible with our webhook. It differs from Resource by not omitting empty `spec`, so can change when it round trips JSON -> Golang type -> JSON.

func (*InnerDefaultResource) DeepCopy

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

func (*InnerDefaultResource) DeepCopyInto

func (in *InnerDefaultResource) DeepCopyInto(out *InnerDefaultResource)

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

func (*InnerDefaultResource) DeepCopyObject

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

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

func (*InnerDefaultResource) SetDefaults

func (i *InnerDefaultResource) SetDefaults(ctx context.Context)

SetDefaults sets default values.

func (*InnerDefaultResource) Validate

Validate validates the resource.

type InnerDefaultSpec

type InnerDefaultSpec struct {
	Generation int64 `json:"generation,omitempty"`

	FieldWithDefault string `json:"fieldWithDefault,omitempty"`

	// Deprecated: This field is deprecated.
	DeprecatedField string `json:"field,omitempty"`

	SubFields *InnerDefaultSubSpec `json:"subfields,omitempty"`
}

InnerDefaultSpec is the spec for InnerDefaultResource.

func (*InnerDefaultSpec) DeepCopy

func (in *InnerDefaultSpec) DeepCopy() *InnerDefaultSpec

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

func (*InnerDefaultSpec) DeepCopyInto

func (in *InnerDefaultSpec) DeepCopyInto(out *InnerDefaultSpec)

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

func (*InnerDefaultSpec) SetDefaults

func (cs *InnerDefaultSpec) SetDefaults(ctx context.Context)

SetDefaults sets default values.

type InnerDefaultStatus

type InnerDefaultStatus struct {
	FieldAsString string `json:"fieldAsString,omitempty"`
}

InnerDefaultStatus is the status for InnerDefaultResource.

func (*InnerDefaultStatus) DeepCopy

func (in *InnerDefaultStatus) DeepCopy() *InnerDefaultStatus

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

func (*InnerDefaultStatus) DeepCopyInto

func (in *InnerDefaultStatus) DeepCopyInto(out *InnerDefaultStatus)

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

type InnerDefaultStruct

type InnerDefaultStruct struct {
	FieldAsString string `json:"fieldAsString,omitempty"`

	// Deprecated: This field is deprecated.
	DeprecatedField string `json:"field,omitempty"`
}

Adding complication helper.

func (*InnerDefaultStruct) DeepCopy

func (in *InnerDefaultStruct) DeepCopy() *InnerDefaultStruct

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

func (*InnerDefaultStruct) DeepCopyInto

func (in *InnerDefaultStruct) DeepCopyInto(out *InnerDefaultStruct)

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

type InnerDefaultSubSpec

type InnerDefaultSubSpec struct {
	// Deprecated: This field is deprecated.
	DeprecatedString string `json:"string,omitempty"`

	// Deprecated: This field is deprecated.
	DeprecatedStringPtr *string `json:"stringPtr,omitempty"`

	// Deprecated: This field is deprecated.
	DeprecatedInt int64 `json:"int,omitempty"`

	// Deprecated: This field is deprecated.
	DeprecatedIntPtr *int64 `json:"intPtr,omitempty"`

	// Deprecated: This field is deprecated.
	DeprecatedMap map[string]string `json:"map,omitempty"`

	// Deprecated: This field is deprecated.
	DeprecatedSlice []string `json:"slice,omitempty"`

	// Deprecated: This field is deprecated.
	DeprecatedStruct InnerDefaultStruct `json:"struct,omitempty"`

	// Deprecated: This field is deprecated.
	DeprecatedStructPtr *InnerDefaultStruct `json:"structPtr,omitempty"`

	InlinedStruct     `json:",inline"`
	*InlinedPtrStruct `json:",inline"`

	// Deprecated: This field is deprecated.
	DeprecatedNotJson string
}

InnerDefaultSubSpec is a helper to test strict deprecated validation.

func (*InnerDefaultSubSpec) DeepCopy

func (in *InnerDefaultSubSpec) DeepCopy() *InnerDefaultSubSpec

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

func (*InnerDefaultSubSpec) DeepCopyInto

func (in *InnerDefaultSubSpec) DeepCopyInto(out *InnerDefaultSubSpec)

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

type OnContext

type OnContext struct {
	Value string
}

OnContext is a struct for holding a value attached to a context.

func (*OnContext) DeepCopy

func (in *OnContext) DeepCopy() *OnContext

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

func (*OnContext) DeepCopyInto

func (in *OnContext) DeepCopyInto(out *OnContext)

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

type Resource

type Resource struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec ResourceSpec `json:"spec,omitempty"`
}

Resource is a simple resource that's compatible with our webhook

func (*Resource) CheckImmutableFields

func (current *Resource) CheckImmutableFields(ctx context.Context, og apis.Immutable) *apis.FieldError

func (*Resource) DeepCopy

func (in *Resource) DeepCopy() *Resource

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

func (*Resource) DeepCopyInto

func (in *Resource) DeepCopyInto(out *Resource)

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

func (*Resource) DeepCopyObject

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

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

func (*Resource) GetListType

func (r *Resource) GetListType() runtime.Object

GetListType implements apis.Listable

func (*Resource) GetUntypedSpec

func (r *Resource) GetUntypedSpec() interface{}

GetUntypedSpec returns the spec of the resource.

func (*Resource) SetDefaults

func (c *Resource) SetDefaults(ctx context.Context)

SetDefaults sets the defaults on the object.

func (*Resource) Validate

func (c *Resource) Validate(ctx context.Context) *apis.FieldError

type ResourceList

type ResourceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []Resource `json:"items"`
}

ResourceList is a list of Resource resources

func (*ResourceList) DeepCopy

func (in *ResourceList) DeepCopy() *ResourceList

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

func (*ResourceList) DeepCopyInto

func (in *ResourceList) DeepCopyInto(out *ResourceList)

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

func (*ResourceList) DeepCopyObject

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

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

type ResourceSpec

type ResourceSpec struct {
	FieldWithDefault               string `json:"fieldWithDefault,omitempty"`
	FieldWithContextDefault        string `json:"fieldWithContextDefault,omitempty"`
	FieldWithValidation            string `json:"fieldWithValidation,omitempty"`
	FieldThatsImmutable            string `json:"fieldThatsImmutable,omitempty"`
	FieldThatsImmutableWithDefault string `json:"fieldThatsImmutableWithDefault,omitempty"`
}

ResourceSpec represents test resource spec.

func (*ResourceSpec) DeepCopy

func (in *ResourceSpec) DeepCopy() *ResourceSpec

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

func (*ResourceSpec) DeepCopyInto

func (in *ResourceSpec) DeepCopyInto(out *ResourceSpec)

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

func (*ResourceSpec) SetDefaults

func (cs *ResourceSpec) SetDefaults(ctx context.Context)

SetDefaults sets the defaults on the spec.

func (*ResourceSpec) Validate

func (cs *ResourceSpec) Validate(ctx context.Context) *apis.FieldError

Jump to

Keyboard shortcuts

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