login

package
Version: v4.2.0-alpha.0+incompa... Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2019 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdLogin

func NewCmdLogin(fullName string, f kcmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

NewCmdLogin implements 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

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

	Token string

	PathOptions *kclientcmd.PathOptions

	CommandName    string
	RequestTimeout time.Duration

	genericclioptions.IOStreams
}

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 NewLoginOptions

func NewLoginOptions(streams genericclioptions.IOStreams) *LoginOptions

func (*LoginOptions) Complete

func (o *LoginOptions) Complete(f kcmdutil.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) Run

func (o LoginOptions) Run() error

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

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(cmd *cobra.Command, serverFlag string, args []string) error

Jump to

Keyboard shortcuts

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