Documentation ¶
Index ¶
- func NewCmdLogin(fullName string, f *osclientcmd.Factory, reader io.Reader, out io.Writer) *cobra.Command
- func NewCmdLogout(name, fullName, ocLoginFullCommand string, f *osclientcmd.Factory, ...) *cobra.Command
- func RunLogin(cmd *cobra.Command, options *LoginOptions) error
- type LoginOptions
- type LogoutOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCmdLogin ¶
func NewCmdLogin(fullName string, f *osclientcmd.Factory, reader io.Reader, out io.Writer) *cobra.Command
NewCmdLogin implements the OpenShift cli login command
Types ¶
type LoginOptions ¶
type LoginOptions struct { Server string CAFile string InsecureTLS bool APIVersion schema.GroupVersion // 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 // 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.
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