kubernetesk8s.io/kubernetes/test/utils/crd Index | Files

package crd

import "k8s.io/kubernetes/test/utils/crd"

Index

Types

type CleanCrdFn

type CleanCrdFn func() error

CleanCrdFn declares the clean up function needed to remove the CRD

type TestCrd

type TestCrd struct {
	Name               string
	Kind               string
	APIGroup           string
	Versions           []apiextensionsv1beta1.CustomResourceDefinitionVersion
	APIExtensionClient *crdclientset.Clientset
	Crd                *apiextensionsv1beta1.CustomResourceDefinition
	DynamicClients     map[string]dynamic.ResourceInterface
	CleanUp            CleanCrdFn
}

TestCrd holds all the pieces needed to test with the CRD

func CreateMultiVersionTestCRD

func CreateMultiVersionTestCRD(f *framework.Framework, group string, apiVersions []apiextensionsv1beta1.CustomResourceDefinitionVersion, conversionWebhook *apiextensionsv1beta1.WebhookClientConfig) (*TestCrd, error)

CreateMultiVersionTestCRD creates a new CRD specifically for the calling test.

func CreateMultiVersionTestCRDWithV1Storage

func CreateMultiVersionTestCRDWithV1Storage(f *framework.Framework) (*TestCrd, error)

CreateMultiVersionTestCRDWithV1Storage creates a new CRD specifically for the calling test.

func CreateTestCRD

func CreateTestCRD(f *framework.Framework) (*TestCrd, error)

CreateTestCRD creates a new CRD specifically for the calling test.

func (*TestCrd) GetAPIVersions

func (c *TestCrd) GetAPIVersions() []string

GetAPIVersions returns the API versions served by the CRD.

func (*TestCrd) GetListName

func (c *TestCrd) GetListName() string

GetListName returns the name for the CRD list resources

func (*TestCrd) GetMetaName

func (c *TestCrd) GetMetaName() string

GetMetaName returns the metaname for the CRD.

func (*TestCrd) GetPluralName

func (c *TestCrd) GetPluralName() string

GetPluralName returns the plural form of the CRD name

func (*TestCrd) GetV1DynamicClient

func (c *TestCrd) GetV1DynamicClient() dynamic.ResourceInterface

GetV1DynamicClient returns the dynamic client for v1.

func (*TestCrd) PatchSchema

func (c *TestCrd) PatchSchema(schema []byte) error

PatchSchema takes validation schema in YAML and patches it to given CRD

Source Files

crd_util.go

Version
v1.14.10
Published
Dec 11, 2019
Platform
js/wasm
Imports
10 packages
Last checked
13 seconds ago

Tools for package owners.