kubernetes: k8s.io/kubernetes/pkg/kubectl/generate Index | Files | Directories

package generate

import "k8s.io/kubernetes/pkg/kubectl/generate"


Package Files


func AnnotateFlags Uses

func AnnotateFlags(cmd *cobra.Command, generators map[string]Generator)

AnnotateFlags annotates all flags that are used by generators.

func EnsureFlagsValid Uses

func EnsureFlagsValid(cmd *cobra.Command, generators map[string]Generator, generatorInUse string) error

EnsureFlagsValid ensures that no invalid flags are being used against a

func GetBool Uses

func GetBool(params map[string]string, key string, defValue bool) (bool, error)

func IsZero Uses

func IsZero(i interface{}) bool

func MakeLabels Uses

func MakeLabels(labels map[string]string) string

func MakeParams Uses

func MakeParams(cmd *cobra.Command, params []GeneratorParam) map[string]interface{}

MakeParams is a utility that creates generator parameters from a command line

func MakeProtocols Uses

func MakeProtocols(protocols map[string]string) string

func ParseLabels Uses

func ParseLabels(labelSpec interface{}) (map[string]string, error)

ParseLabels turns a string representation of a label set into a map[string]string

func ParseProtocols Uses

func ParseProtocols(protocols interface{}) (map[string]string, error)

func ValidateParams Uses

func ValidateParams(paramSpec []GeneratorParam, params map[string]interface{}) error

ValidateParams ensures that all required params are present in the params map

type Generator Uses

type Generator interface {
    // Generate creates an API object given a set of parameters
    Generate(params map[string]interface{}) (runtime.Object, error)
    // ParamNames returns the list of parameters that this generator uses
    ParamNames() []GeneratorParam

Generator is an interface for things that can generate API objects from input parameters. One example is the "expose" generator that is capable of exposing new replication controllers and services, among other things.

type GeneratorFunc Uses

type GeneratorFunc func(cmdName string) map[string]Generator

GeneratorFunc returns the generators for the provided command

type GeneratorParam Uses

type GeneratorParam struct {
    Name     string
    Required bool

GeneratorParam is a parameter for a generator TODO: facilitate structured json generator input schemes

type StructuredGenerator Uses

type StructuredGenerator interface {
    // StructuredGenerator creates an API object using pre-configured parameters
    StructuredGenerate() (runtime.Object, error)

StructuredGenerator is an interface for things that can generate API objects not using parameter injection



Package generate imports 8 packages (graph) and is imported by 48 packages. Updated 2019-06-27. Refresh now. Tools for package owners.