kubernetes: k8s.io/kubernetes/pkg/kubectl/cmd/util/openapi/testing Index | Files

package testing

import "k8s.io/kubernetes/pkg/kubectl/cmd/util/openapi/testing"


Package Files


func CreateOpenAPISchemaFunc Uses

func CreateOpenAPISchemaFunc(path string) func() (openapi.Resources, error)

CreateOpenAPISchemaFunc returns a function useful for the TestFactory.

type EmptyResources Uses

type EmptyResources struct{}

EmptyResources implement a Resources that just doesn't have any resources.

func (EmptyResources) LookupResource Uses

func (f EmptyResources) LookupResource(gvk schema.GroupVersionKind) proto.Schema

LookupResource will always return nil. It doesn't have any resources.

type FakeResources Uses

type FakeResources struct {
    // contains filtered or unexported fields

FakeResources is a wrapper to directly load the openapi schema from a file, and get the schema for given GVK. This is only for test since it's assuming that the file is there and everything will go fine.

func NewFakeResources Uses

func NewFakeResources(path string) *FakeResources

NewFakeResources creates a new FakeResources.

func (*FakeResources) LookupResource Uses

func (f *FakeResources) LookupResource(gvk schema.GroupVersionKind) proto.Schema

LookupResource will read the schema, parse it and return the resources. It doesn't return errors and will panic instead.

Package testing imports 4 packages (graph) and is imported by 13 packages. Updated 2018-07-21. Refresh now. Tools for package owners.