create

package
v1.11.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2018 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NameFromCommandArgs

func NameFromCommandArgs(cmd *cobra.Command, args []string) (string, error)

NameFromCommandArgs is a utility function for commands that assume the first argument is a resource name

func NewCmdCreate

func NewCmdCreate(f cmdutil.Factory, out, errOut io.Writer) *cobra.Command

func NewCmdCreateClusterRole

func NewCmdCreateClusterRole(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command

ClusterRole is a command to ease creating ClusterRoles.

func NewCmdCreateClusterRoleBinding

func NewCmdCreateClusterRoleBinding(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command

ClusterRoleBinding is a command to ease creating ClusterRoleBindings.

func NewCmdCreateConfigMap

func NewCmdCreateConfigMap(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command

ConfigMap is a command to ease creating ConfigMaps.

func NewCmdCreateDeployment

func NewCmdCreateDeployment(f cmdutil.Factory, cmdOut, cmdErr io.Writer) *cobra.Command

NewCmdCreateDeployment is a macro command to create a new deployment. This command is better known to users as `kubectl create deployment`. Note that this command overlaps significantly with the `kubectl run` command.

func NewCmdCreateJob

func NewCmdCreateJob(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command

NewCmdCreateJob is a command to ease creating Jobs from CronJobs.

func NewCmdCreateNamespace

func NewCmdCreateNamespace(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command

NewCmdCreateNamespace is a macro command to create a new namespace

func NewCmdCreatePodDisruptionBudget

func NewCmdCreatePodDisruptionBudget(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command

NewCmdCreatePodDisruptionBudget is a macro command to create a new pod disruption budget.

func NewCmdCreatePriorityClass

func NewCmdCreatePriorityClass(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command

NewCmdCreatePriorityClass is a macro command to create a new priorityClass.

func NewCmdCreateQuota

func NewCmdCreateQuota(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command

NewCmdCreateQuota is a macro command to create a new quota

func NewCmdCreateRole

func NewCmdCreateRole(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command

Role is a command to ease creating Roles.

func NewCmdCreateRoleBinding

func NewCmdCreateRoleBinding(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command

RoleBinding is a command to ease creating RoleBindings.

func NewCmdCreateSecret

func NewCmdCreateSecret(f cmdutil.Factory, cmdOut, errOut io.Writer) *cobra.Command

NewCmdCreateSecret groups subcommands to create various types of secrets

func NewCmdCreateSecretDockerRegistry

func NewCmdCreateSecretDockerRegistry(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command

NewCmdCreateSecretDockerRegistry is a macro command for creating secrets to work with Docker registries

func NewCmdCreateSecretGeneric

func NewCmdCreateSecretGeneric(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command

NewCmdCreateSecretGeneric is a command to create generic secrets from files, directories, or literal values

func NewCmdCreateSecretTLS

func NewCmdCreateSecretTLS(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command

NewCmdCreateSecretTLS is a macro command for creating secrets to work with Docker registries

func NewCmdCreateService

func NewCmdCreateService(f cmdutil.Factory, cmdOut, errOut io.Writer) *cobra.Command

NewCmdCreateService is a macro command to create a new service

func NewCmdCreateServiceAccount

func NewCmdCreateServiceAccount(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command

NewCmdCreateServiceAccount is a macro command to create a new service account

func NewCmdCreateServiceClusterIP

func NewCmdCreateServiceClusterIP(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command

NewCmdCreateServiceClusterIP is a command to create a ClusterIP service

func NewCmdCreateServiceExternalName

func NewCmdCreateServiceExternalName(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command

NewCmdCreateServiceExternalName is a macro command for creating an ExternalName service

func NewCmdCreateServiceLoadBalancer

func NewCmdCreateServiceLoadBalancer(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command

NewCmdCreateServiceLoadBalancer is a macro command for creating a LoadBalancer service

func NewCmdCreateServiceNodePort

func NewCmdCreateServiceNodePort(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command

NewCmdCreateServiceNodePort is a macro command for creating a NodePort service

func RunCreateSubcommand

func RunCreateSubcommand(f cmdutil.Factory, options *CreateSubcommandOptions) error

TODO(juanvallejo): remove dependency on factory here. Complete necessary bits from it in the Complete() method. RunCreateSubcommand executes a create subcommand using the specified options

func RunEditOnCreate

func RunEditOnCreate(f cmdutil.Factory, recordFlags *genericclioptions.RecordFlags, out, errOut io.Writer, cmd *cobra.Command, options *resource.FilenameOptions) error

Types

type ClusterRoleBindingOpts

type ClusterRoleBindingOpts struct {
	CreateSubcommandOptions *CreateSubcommandOptions
}

func (*ClusterRoleBindingOpts) Complete

func (o *ClusterRoleBindingOpts) Complete(cmd *cobra.Command, args []string) error

func (*ClusterRoleBindingOpts) Run

CreateClusterRoleBinding is the implementation of the create clusterrolebinding command.

type ConfigMapOpts

type ConfigMapOpts struct {
	CreateSubcommandOptions *CreateSubcommandOptions
}

func (*ConfigMapOpts) Complete

func (o *ConfigMapOpts) Complete(cmd *cobra.Command, args []string) error

func (*ConfigMapOpts) Run

func (o *ConfigMapOpts) Run(f cmdutil.Factory) error

CreateConfigMap is the implementation of the create configmap command.

type CreateClusterRoleOptions

type CreateClusterRoleOptions struct {
	*CreateRoleOptions
	NonResourceURLs []string
}

func (*CreateClusterRoleOptions) Complete

func (c *CreateClusterRoleOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error

func (*CreateClusterRoleOptions) RunCreateRole

func (c *CreateClusterRoleOptions) RunCreateRole() error

func (*CreateClusterRoleOptions) Validate

func (c *CreateClusterRoleOptions) Validate() error

type CreateJobOptions

type CreateJobOptions struct {
	PrintFlags *PrintFlags

	PrintObj func(obj runtime.Object) error

	Name string
	From string

	Namespace    string
	OutputFormat string
	Client       clientbatchv1.BatchV1Interface
	Out          io.Writer
	DryRun       bool
	Builder      *resource.Builder
	Cmd          *cobra.Command
}

func (*CreateJobOptions) Complete

func (c *CreateJobOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) (err error)

func (*CreateJobOptions) RunCreateJob

func (c *CreateJobOptions) RunCreateJob() error

type CreateOptions

type CreateOptions struct {
	PrintFlags  *PrintFlags
	RecordFlags *genericclioptions.RecordFlags

	DryRun bool

	FilenameOptions  resource.FilenameOptions
	Selector         string
	EditBeforeCreate bool
	Raw              string
	Out              io.Writer
	ErrOut           io.Writer

	Recorder genericclioptions.Recorder
	PrintObj func(obj kruntime.Object) error
}

func NewCreateOptions

func NewCreateOptions(out, errOut io.Writer) *CreateOptions

func (*CreateOptions) Complete

func (o *CreateOptions) Complete(f cmdutil.Factory, cmd *cobra.Command) error

func (*CreateOptions) RunCreate

func (o *CreateOptions) RunCreate(f cmdutil.Factory, cmd *cobra.Command) error

func (*CreateOptions) ValidateArgs

func (o *CreateOptions) ValidateArgs(cmd *cobra.Command, args []string) error

type CreateRoleOptions

type CreateRoleOptions struct {
	PrintFlags *PrintFlags

	Name          string
	Verbs         []string
	Resources     []ResourceOptions
	ResourceNames []string

	DryRun       bool
	OutputFormat string
	Namespace    string
	Client       clientgorbacv1.RbacV1Interface
	Mapper       meta.RESTMapper
	Out          io.Writer
	PrintObj     func(obj runtime.Object) error
}

func (*CreateRoleOptions) Complete

func (c *CreateRoleOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error

func (*CreateRoleOptions) RunCreateRole

func (c *CreateRoleOptions) RunCreateRole() error

func (*CreateRoleOptions) Validate

func (c *CreateRoleOptions) Validate() error

type CreateSubcommandOptions

type CreateSubcommandOptions struct {
	// PrintFlags holds options necessary for obtaining a printer
	PrintFlags *PrintFlags
	// Name of resource being created
	Name string
	// StructuredGenerator is the resource generator for the object being created
	StructuredGenerator kubectl.StructuredGenerator
	// DryRun is true if the command should be simulated but not run against the server
	DryRun           bool
	CreateAnnotation bool

	PrintObj func(obj kruntime.Object) error

	CmdOut io.Writer
	CmdErr io.Writer
}

CreateSubcommandOptions is an options struct to support create subcommands

func (*CreateSubcommandOptions) Complete

func (o *CreateSubcommandOptions) Complete(cmd *cobra.Command, args []string, generator kubectl.StructuredGenerator) error

type DeploymentOpts

type DeploymentOpts struct {
	CreateSubcommandOptions *CreateSubcommandOptions
}

func (*DeploymentOpts) Complete

func (o *DeploymentOpts) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error

func (*DeploymentOpts) Run

func (o *DeploymentOpts) Run(f cmdutil.Factory) error

createDeployment 1. Reads user config values from Cobra. 2. Sets up the correct Generator object. 3. Calls RunCreateSubcommand.

type NamespaceOpts

type NamespaceOpts struct {
	CreateSubcommandOptions *CreateSubcommandOptions
}

func (*NamespaceOpts) Complete

func (o *NamespaceOpts) Complete(cmd *cobra.Command, args []string) error

func (*NamespaceOpts) Run

func (o *NamespaceOpts) Run(f cmdutil.Factory) error

CreateNamespace implements the behavior to run the create namespace command

type PodDisruptionBudgetOpts

type PodDisruptionBudgetOpts struct {
	CreateSubcommandOptions *CreateSubcommandOptions
}

func (*PodDisruptionBudgetOpts) Complete

func (o *PodDisruptionBudgetOpts) Complete(cmd *cobra.Command, args []string) error

func (*PodDisruptionBudgetOpts) Run

CreatePodDisruptionBudget implements the behavior to run the create pdb command.

type PrintFlags

type PrintFlags struct {
	JSONYamlPrintFlags *printers.JSONYamlPrintFlags
	NamePrintFlags     *printers.NamePrintFlags
	TemplateFlags      *printers.KubeTemplatePrintFlags

	OutputFormat *string
}

PrintFlags composes common printer flag structs used across all create commands, and provides a method of retrieving a known printer based on flag values provided.

func NewPrintFlags

func NewPrintFlags(operation string) *PrintFlags

func (*PrintFlags) AddFlags

func (f *PrintFlags) AddFlags(cmd *cobra.Command)

func (*PrintFlags) Complete

func (f *PrintFlags) Complete(successTemplate string) error

func (*PrintFlags) ToPrinter

func (f *PrintFlags) ToPrinter() (printers.ResourcePrinter, error)

type PriorityClassOpts

type PriorityClassOpts struct {
	CreateSubcommandOptions *CreateSubcommandOptions
}

func (*PriorityClassOpts) Complete

func (o *PriorityClassOpts) Complete(cmd *cobra.Command, args []string) error

func (*PriorityClassOpts) Run

CreatePriorityClass implements the behavior to run the create priorityClass command.

type QuotaOpts

type QuotaOpts struct {
	CreateSubcommandOptions *CreateSubcommandOptions
}

func (*QuotaOpts) Complete

func (o *QuotaOpts) Complete(cmd *cobra.Command, args []string) error

func (*QuotaOpts) Run

func (o *QuotaOpts) Run(f cmdutil.Factory) error

CreateQuota implements the behavior to run the create quota command

type ResourceOptions

type ResourceOptions struct {
	Group       string
	Resource    string
	SubResource string
}

type RoleBindingOpts

type RoleBindingOpts struct {
	CreateSubcommandOptions *CreateSubcommandOptions
}

func (*RoleBindingOpts) Complete

func (o *RoleBindingOpts) Complete(cmd *cobra.Command, args []string) error

func (*RoleBindingOpts) Run

type SecretDockerRegistryOpts

type SecretDockerRegistryOpts struct {
	CreateSubcommandOptions *CreateSubcommandOptions
}

func (*SecretDockerRegistryOpts) Complete

func (o *SecretDockerRegistryOpts) Complete(cmd *cobra.Command, args []string) error

func (*SecretDockerRegistryOpts) Run

CreateSecretDockerRegistry is the implementation of the create secret docker-registry command

type SecretGenericOpts

type SecretGenericOpts struct {
	CreateSubcommandOptions *CreateSubcommandOptions
}

func (*SecretGenericOpts) Complete

func (o *SecretGenericOpts) Complete(cmd *cobra.Command, args []string) error

func (*SecretGenericOpts) Run

CreateSecretGeneric is the implementation of the create secret generic command

type SecretTLSOpts

type SecretTLSOpts struct {
	CreateSubcommandOptions *CreateSubcommandOptions
}

func (*SecretTLSOpts) Complete

func (o *SecretTLSOpts) Complete(cmd *cobra.Command, args []string) error

func (*SecretTLSOpts) Run

func (o *SecretTLSOpts) Run(f cmdutil.Factory) error

CreateSecretTLS is the implementation of the create secret tls command

type ServiceAccountOpts

type ServiceAccountOpts struct {
	CreateSubcommandOptions *CreateSubcommandOptions
}

func (*ServiceAccountOpts) Complete

func (o *ServiceAccountOpts) Complete(cmd *cobra.Command, args []string) error

func (*ServiceAccountOpts) Run

CreateServiceAccount implements the behavior to run the create service account command

type ServiceClusterIPOpts

type ServiceClusterIPOpts struct {
	CreateSubcommandOptions *CreateSubcommandOptions
}

func (*ServiceClusterIPOpts) Complete

func (o *ServiceClusterIPOpts) Complete(cmd *cobra.Command, args []string) error

func (*ServiceClusterIPOpts) Run

CreateServiceClusterIP is the implementation of the create service clusterip command

type ServiceExternalNameOpts

type ServiceExternalNameOpts struct {
	CreateSubcommandOptions *CreateSubcommandOptions
}

func (*ServiceExternalNameOpts) Complete

func (o *ServiceExternalNameOpts) Complete(cmd *cobra.Command, args []string) error

func (*ServiceExternalNameOpts) Run

CreateExternalNameService is the implementation of the create service externalname command

type ServiceLoadBalancerOpts

type ServiceLoadBalancerOpts struct {
	CreateSubcommandOptions *CreateSubcommandOptions
}

func (*ServiceLoadBalancerOpts) Complete

func (o *ServiceLoadBalancerOpts) Complete(cmd *cobra.Command, args []string) error

func (*ServiceLoadBalancerOpts) Run

CreateServiceLoadBalancer is the implementation of the create service loadbalancer command

type ServiceNodePortOpts

type ServiceNodePortOpts struct {
	CreateSubcommandOptions *CreateSubcommandOptions
}

func (*ServiceNodePortOpts) Complete

func (o *ServiceNodePortOpts) Complete(cmd *cobra.Command, args []string) error

func (*ServiceNodePortOpts) Run

CreateServiceNodePort is the implementation of the create service nodeport command

Jump to

Keyboard shortcuts

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