cmd

package
v0.0.0-...-ea77a8b Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2016 License: Apache-2.0 Imports: 91 Imported by: 0

Documentation

Index

Constants

View Source
const LogsRecommendedName = "logs"

LogsRecommendedName is the recommended command name TODO: Probably move this pattern upstream?

View Source
const (
	RshRecommendedName = "rsh"
)
View Source
const (
	StatusRecommendedName = "status"
)
View Source
const WhoAmIRecommendedCommandName = "whoami"

Variables

View Source
var ErrExportOmit = fmt.Errorf("object is omitted")

Functions

func NewCmdAnnotate

func NewCmdAnnotate(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

NewCmdAnnotate is a wrapper for the Kubernetes cli annotate command

func NewCmdApply

func NewCmdApply(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

func NewCmdAttach

func NewCmdAttach(fullName string, f *clientcmd.Factory, in io.Reader, out, errout io.Writer) *cobra.Command

NewCmdAttach is a wrapper for the Kubernetes cli attach command

func NewCmdBuildLogs

func NewCmdBuildLogs(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

NewCmdBuildLogs implements the OpenShift cli build-logs command

func NewCmdCancelBuild

func NewCmdCancelBuild(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

NewCmdCancelBuild implements the OpenShift cli cancel-build command

func NewCmdConfig

func NewCmdConfig(parentName, name string) *cobra.Command

func NewCmdConvert

func NewCmdConvert(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

func NewCmdCreate

func NewCmdCreate(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

NewCmdCreate is a wrapper for the Kubernetes cli create command

func NewCmdDelete

func NewCmdDelete(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

NewCmdDelete is a wrapper for the Kubernetes cli delete command

func NewCmdDeploy

func NewCmdDeploy(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

NewCmdDeploy creates a new `deploy` command.

func NewCmdDescribe

func NewCmdDescribe(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

NewCmdDescribe is a wrapper for the Kubernetes cli describe command

func NewCmdEdit

func NewCmdEdit(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

NewCmdEdit implements the OpenShift cli edit command.

func NewCmdEnv

func NewCmdEnv(fullName string, f *clientcmd.Factory, in io.Reader, out io.Writer) *cobra.Command

NewCmdEnv implements the OpenShift cli env command

func NewCmdExec

func NewCmdExec(fullName string, f *clientcmd.Factory, cmdIn io.Reader, cmdOut, cmdErr io.Writer) *cobra.Command

NewCmdExec is a wrapper for the Kubernetes cli exec command

func NewCmdExplain

func NewCmdExplain(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

func NewCmdExport

func NewCmdExport(fullName string, f *clientcmd.Factory, in io.Reader, out io.Writer) *cobra.Command

func NewCmdExpose

func NewCmdExpose(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

NewCmdExpose is a wrapper for the Kubernetes cli expose command

func NewCmdGet

func NewCmdGet(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

NewCmdGet is a wrapper for the Kubernetes cli get command

func NewCmdImportImage

func NewCmdImportImage(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

NewCmdImportImage implements the OpenShift cli import-image command.

func NewCmdLabel

func NewCmdLabel(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

NewCmdLabel is a wrapper for the Kubernetes cli label command

func NewCmdLogin

func NewCmdLogin(fullName string, f *osclientcmd.Factory, reader io.Reader, out io.Writer) *cobra.Command

NewCmdLogin implements the OpenShift cli login command

func NewCmdLogout

func NewCmdLogout(name, fullName, ocLoginFullCommand string, f *osclientcmd.Factory, reader io.Reader, out io.Writer) *cobra.Command

NewCmdLogout implements the OpenShift cli logout command

func NewCmdLogs

func NewCmdLogs(name, parent string, f *clientcmd.Factory, out io.Writer) *cobra.Command

NewCmdLogs creates a new logs command that supports OpenShift resources.

func NewCmdNewApplication

func NewCmdNewApplication(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

NewCmdNewApplication implements the OpenShift cli new-app command

func NewCmdNewBuild

func NewCmdNewBuild(fullName string, f *clientcmd.Factory, in io.Reader, out io.Writer) *cobra.Command

NewCmdNewBuild implements the OpenShift cli new-build command

func NewCmdOptions

func NewCmdOptions(out io.Writer) *cobra.Command

NewCmdOptions implements the OpenShift cli options command

func NewCmdPatch

func NewCmdPatch(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

NewCmdPatch is a wrapper for the Kubernetes cli patch command

func NewCmdPortForward

func NewCmdPortForward(fullName string, f *clientcmd.Factory) *cobra.Command

NewCmdPortForward is a wrapper for the Kubernetes cli port-forward command

func NewCmdProcess

func NewCmdProcess(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

NewCmdProcess implements the OpenShift cli process command

func NewCmdProject

func NewCmdProject(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

NewCmdProject implements the OpenShift cli rollback command

func NewCmdProxy

func NewCmdProxy(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

NewCmdProxy is a wrapper for the Kubernetes cli proxy command

func NewCmdReplace

func NewCmdReplace(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

NewCmdReplace is a wrapper for the Kubernetes cli replace command

func NewCmdRequestProject

func NewCmdRequestProject(name, fullName, ocLoginName, ocProjectName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

func NewCmdRollback

func NewCmdRollback(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

NewCmdRollback creates a CLI rollback command.

func NewCmdRsh

func NewCmdRsh(name string, parent string, f *clientcmd.Factory, in io.Reader, out, err io.Writer) *cobra.Command

NewCmdRsh returns a command that attempts to open a shell session to the server.

func NewCmdRun

func NewCmdRun(fullName string, f *clientcmd.Factory, in io.Reader, out, errout io.Writer) *cobra.Command

NewCmdRun is a wrapper for the Kubernetes cli run command

func NewCmdScale

func NewCmdScale(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

NewCmdScale is a wrapper for the Kubernetes cli scale command

func NewCmdStartBuild

func NewCmdStartBuild(fullName string, f *clientcmd.Factory, in io.Reader, out io.Writer) *cobra.Command

NewCmdStartBuild implements the OpenShift cli start-build command

func NewCmdStatus

func NewCmdStatus(name, fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

NewCmdStatus implements the OpenShift cli status command

func NewCmdStop

func NewCmdStop(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

NewCmdStop is a wrapper for the Kubernetes cli stop command

func NewCmdTag

func NewCmdTag(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

NewCmdTag implements the OpenShift cli tag command.

func NewCmdTypes

func NewCmdTypes(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

func NewCmdVolume

func NewCmdVolume(fullName string, f *clientcmd.Factory, out, errOut io.Writer) *cobra.Command

func NewCmdWhoAmI

func NewCmdWhoAmI(name, fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command

func ParseEnv

func ParseEnv(spec []string, defaultReader io.Reader) ([]kapi.EnvVar, []string, error)

ParseEnv parses the list of environment variables into kubernetes EnvVar

func RunBuildLogs

func RunBuildLogs(fullName string, f *clientcmd.Factory, out io.Writer, cmd *cobra.Command, opts api.BuildLogOptions, args []string) error

RunBuildLogs contains all the necessary functionality for the OpenShift cli build-logs command

func RunCancelBuild

func RunCancelBuild(f *clientcmd.Factory, out io.Writer, cmd *cobra.Command, args []string) error

RunCancelBuild contains all the necessary functionality for the OpenShift cli cancel-build command

func RunEnv

func RunEnv(f *clientcmd.Factory, in io.Reader, out io.Writer, cmd *cobra.Command, args []string, envParams, filenames []string) error

RunEnv contains all the necessary functionality for the OpenShift cli env command

func RunExport

func RunExport(f *clientcmd.Factory, exporter Exporter, in io.Reader, out io.Writer, cmd *cobra.Command, args []string, filenames []string) error

func RunGraph

func RunGraph(f *clientcmd.Factory, out io.Writer) error

RunGraph contains all the necessary functionality for the OpenShift cli graph command

func RunImportImage

func RunImportImage(f *clientcmd.Factory, out io.Writer, cmd *cobra.Command, args []string) error

RunImportImage contains all the necessary functionality for the OpenShift cli import-image command.

func RunListBuildWebHooks

func RunListBuildWebHooks(f *clientcmd.Factory, out, errOut io.Writer, name, resource, webhookFilter string) error

RunListBuildWebHooks prints the webhooks for the provided build config.

func RunLogin

func RunLogin(cmd *cobra.Command, options *LoginOptions) error

RunLogin contains all the necessary functionality for the OpenShift cli login command

func RunNewApplication

func RunNewApplication(fullName string, f *clientcmd.Factory, out io.Writer, c *cobra.Command, args []string, config *newcmd.AppConfig) error

RunNewApplication contains all the necessary functionality for the OpenShift cli new-app command

func RunNewBuild

func RunNewBuild(fullName string, f *clientcmd.Factory, out io.Writer, in io.Reader, c *cobra.Command, args []string, config *newcmd.AppConfig) error

RunNewBuild contains all the necessary functionality for the OpenShift cli new-build command

func RunProcess

func RunProcess(f *clientcmd.Factory, out io.Writer, cmd *cobra.Command, args []string) error

RunProject contains all the necessary functionality for the OpenShift cli process command

func RunStartBuild

func RunStartBuild(f *clientcmd.Factory, in io.Reader, out io.Writer, cmd *cobra.Command, envParams []string, args []string, webhooks util.StringFlag) error

RunStartBuild contains all the necessary functionality for the OpenShift cli start-build command

func RunStartBuildWebHook

func RunStartBuildWebHook(f *clientcmd.Factory, out io.Writer, webhook string, path, postReceivePath string, repo git.Repository) error

RunStartBuildWebHook tries to trigger the provided webhook. It will attempt to utilize the current client configuration if the webhook has the same URL.

func RunStatus

func RunStatus(f *clientcmd.Factory, out io.Writer) error

RunStatus contains all the necessary functionality for the OpenShift cli status command

func RunWhoAmI

func RunWhoAmI(f *clientcmd.Factory, out io.Writer, cmd *cobra.Command, args []string, o *WhoAmIOptions) error

func WaitForBuildComplete

func WaitForBuildComplete(c osclient.BuildInterface, name string) error

WaitForBuildComplete waits for a build identified by the name to complete

Types

type AddVolumeOptions

type AddVolumeOptions struct {
	Type       string
	MountPath  string
	Overwrite  bool
	Path       string
	SecretName string
	Source     string

	CreateClaim bool
	ClaimName   string
	ClaimSize   string
	ClaimMode   string

	TypeChanged bool
}

func (*AddVolumeOptions) Validate

func (a *AddVolumeOptions) Validate(isAddOp bool) error

type DeployOptions

type DeployOptions struct {
	// contains filtered or unexported fields
}

DeployOptions holds all the options for the `deploy` command

func (*DeployOptions) Complete

func (o *DeployOptions) Complete(f *clientcmd.Factory, args []string, out io.Writer) error

func (DeployOptions) RunDeploy

func (o DeployOptions) RunDeploy() error

func (DeployOptions) Validate

func (o DeployOptions) Validate() error

type EditOptions

type EditOptions struct {
	// contains filtered or unexported fields
}

EditOptions is a struct that contains all variables needed for cli edit command.

func (*EditOptions) Complete

func (o *EditOptions) Complete(fullName string, f *clientcmd.Factory, out io.Writer, cmd *cobra.Command, args []string) error

Complete completes struct variables.

func (*EditOptions) RunEdit

func (o *EditOptions) RunEdit() error

RunEdit contains all the necessary functionality for the OpenShift cli edit command.

type Exporter

type Exporter interface {
	AddExportOptions(*pflag.FlagSet)
	Export(obj runtime.Object, exact bool) error
}

type LoginOptions

type LoginOptions struct {
	Server      string
	CAFile      string
	InsecureTLS bool
	APIVersion  string

	// flags and printing helpers
	Username string
	Password string
	Project  string

	// infra
	StartingKubeConfig *kclientcmdapi.Config
	DefaultNamespace   string
	Config             *kclient.Config
	Reader             io.Reader
	Out                io.Writer

	// cert data to be used when authenticating
	CertFile string
	KeyFile  string

	Token string

	PathOptions *kcmdconfig.PathOptions
}

LoginOptions is a helper for the login and setup process, gathers all information required for a successful login and eventual update of config files. Depending on the Reader present it can be interactive, asking for terminal input in case of any missing information. Notice that some methods mutate this object so it should not be reused. The Config provided as a pointer will also mutate (handle new auth tokens, etc).

func (*LoginOptions) Complete

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

func (*LoginOptions) GatherInfo

func (o *LoginOptions) GatherInfo() error

Gather all required information in a comprehensive order.

func (*LoginOptions) SaveConfig

func (o *LoginOptions) SaveConfig() (bool, error)

Save all the information present in this helper to a config file. An explicit config file path can be provided, if not use the established conventions about config loading rules. Will create a new config file if one can't be found at all. Will only succeed if all required info is present.

func (LoginOptions) Validate

func (o LoginOptions) Validate(args []string, serverFlag string) error

type LogoutOptions

type LogoutOptions struct {
	StartingKubeConfig *kclientcmdapi.Config
	Config             *kclient.Config
	Out                io.Writer

	PathOptions *kcmdconfig.PathOptions
}

func (*LogoutOptions) Complete

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

func (LogoutOptions) RunLogout

func (o LogoutOptions) RunLogout() error

func (LogoutOptions) Validate

func (o LogoutOptions) Validate(args []string) error

type NewProjectOptions

type NewProjectOptions struct {
	ProjectName string
	DisplayName string
	Description string

	Client client.Interface

	ProjectOptions *ProjectOptions
	Out            io.Writer
}

func (*NewProjectOptions) Run

func (o *NewProjectOptions) Run() error

type OpenShiftLogsOptions

type OpenShiftLogsOptions struct {
	// Options should hold our own *LogOptions objects.
	Options runtime.Object
	// KubeLogOptions contains all the necessary options for
	// running the upstream logs command.
	KubeLogOptions *kcmd.LogsOptions
}

OpenShiftLogsOptions holds all the necessary options for running oc logs.

func (*OpenShiftLogsOptions) Complete

func (o *OpenShiftLogsOptions) Complete(f *clientcmd.Factory, out io.Writer, cmd *cobra.Command, args []string) error

Complete calls the upstream Complete for the logs command and then resolves the resource a user requested to view its logs and creates the appropriate logOptions object for it.

func (OpenShiftLogsOptions) RunLog

func (o OpenShiftLogsOptions) RunLog() error

RunLog will run the upstream logs command and may use an OpenShift logOptions object.

func (OpenShiftLogsOptions) Validate

func (o OpenShiftLogsOptions) Validate() error

Validate runs the upstream validation for the logs command and then it will validate any OpenShift-specific log options.

type ProjectOptions

type ProjectOptions struct {
	Config       clientcmdapi.Config
	Client       *client.Client
	ClientConfig *kclient.Config
	Out          io.Writer
	PathOptions  *kubecmdconfig.PathOptions

	ProjectName  string
	ProjectOnly  bool
	DisplayShort bool

	// SkipAccessValidation means that if a specific name is requested, don't bother checking for access to the project
	SkipAccessValidation bool
}

func (*ProjectOptions) Complete

func (o *ProjectOptions) Complete(f *clientcmd.Factory, args []string, out io.Writer) error

func (ProjectOptions) RunProject

func (o ProjectOptions) RunProject() error

RunProject contains all the necessary functionality for the OpenShift cli project command

func (ProjectOptions) Validate

func (o ProjectOptions) Validate() error

type RollbackOptions

type RollbackOptions struct {
	Namespace              string
	TargetName             string
	DesiredVersion         int
	Format                 string
	Template               string
	DryRun                 bool
	IncludeTriggers        bool
	IncludeStrategy        bool
	IncludeScalingSettings bool
	// contains filtered or unexported fields
}

RollbackOptions contains all the necessary state to perform a rollback.

func (*RollbackOptions) Complete

func (o *RollbackOptions) Complete(f *clientcmd.Factory, args []string, out io.Writer) error

Complete turns a partially defined RollbackActions into a solvent structure which can be validated and used for a rollback.

func (*RollbackOptions) Run

func (o *RollbackOptions) Run() error

Run performs a rollback.

func (*RollbackOptions) Validate

func (o *RollbackOptions) Validate() error

Validate ensures that a RollbackOptions is valid and can be used to execute a rollback.

type RshOptions

type RshOptions struct {
	ForceTTY   bool
	DisableTTY bool
	Executable string
	*kubecmd.ExecOptions
}

RshOptions declare the arguments accepted by the Rsh command

func (*RshOptions) Complete

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

Complete applies the command environment to RshOptions

func (*RshOptions) Run

func (o *RshOptions) Run() error

Run starts a remote shell session on the server

func (*RshOptions) Validate

func (o *RshOptions) Validate() error

Validate ensures that RshOptions are valid

type TagOptions

type TagOptions struct {
	// contains filtered or unexported fields
}

TagOptions contains all the necessary options for the cli tag command.

func (*TagOptions) Complete

func (o *TagOptions) Complete(f *clientcmd.Factory, cmd *cobra.Command, args []string, out io.Writer) error

Complete completes all the required options for the tag command.

func (TagOptions) RunTag

func (o TagOptions) RunTag() error

RunTag contains all the necessary functionality for the OpenShift cli tag command.

func (TagOptions) Validate

func (o TagOptions) Validate() error

Validate validates all the required options for the tag command.

type VolumeOptions

type VolumeOptions struct {
	DefaultNamespace       string
	ExplicitNamespace      bool
	Out                    io.Writer
	Err                    io.Writer
	Mapper                 meta.RESTMapper
	Typer                  runtime.ObjectTyper
	RESTClientFactory      func(mapping *meta.RESTMapping) (resource.RESTClient, error)
	UpdatePodSpecForObject func(obj runtime.Object, fn func(*kapi.PodSpec) error) (bool, error)
	Client                 kclient.PersistentVolumeClaimsNamespacer

	// Resource selection
	Selector  string
	All       bool
	Filenames []string

	// Operations
	Add    bool
	Remove bool
	List   bool

	// Common optional params
	Name          string
	Containers    string
	Confirm       bool
	Output        string
	OutputVersion string

	// Add op params
	AddOpts *AddVolumeOptions
}

func (*VolumeOptions) Complete

func (v *VolumeOptions) Complete(f *clientcmd.Factory, cmd *cobra.Command, out, errOut io.Writer) error

func (*VolumeOptions) RunVolume

func (v *VolumeOptions) RunVolume(args []string) error

func (*VolumeOptions) Validate

func (v *VolumeOptions) Validate(args []string) error

type WhoAmIOptions

type WhoAmIOptions struct {
	UserInterface osclient.UserInterface

	Out io.Writer
}

func (WhoAmIOptions) WhoAmI

func (o WhoAmIOptions) WhoAmI() (*userapi.User, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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