login

package
v3.9.0-alpha.3+incompa... Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2018 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdLogin

func NewCmdLogin(fullName string, f *osclientcmd.Factory, reader io.Reader, out, errOut 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 RunLogin

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

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

Types

type LoginOptions

type LoginOptions struct {
	Server      string
	CAFile      string
	InsecureTLS bool

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

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

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

	Token string

	PathOptions *kclientcmd.PathOptions

	CommandName    string
	RequestTimeout time.Duration
}

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, commandName 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             *restclient.Config
	Out                io.Writer

	PathOptions *kclientcmd.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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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