Documentation
¶
Index ¶
- Variables
- func AskForConfirmation(s string) bool
- func DebugMsg(messages ...string)
- func EditEnvFile(content string) (string, error)
- func ExecOcCmd(args []string, namespace string, selector string) *exec.Cmd
- func ExecPlainOcCmd(args []string) *exec.Cmd
- func RunCmd(cmd *exec.Cmd) (outBytes, errBytes []byte, err error)
- func VerboseMsg(messages ...string)
- type ClientProcessorExporter
- type CompareOptions
- type ExportOptions
- type GlobalOptions
- type NamespaceOptions
- type OcClient
- func (c *OcClient) CheckLoggedIn() (bool, error)
- func (c *OcClient) CheckProjectExists(p string) (bool, error)
- func (c *OcClient) Create(config string, selector string) ([]byte, error)
- func (c *OcClient) CurrentProject() (string, error)
- func (c *OcClient) Delete(kind string, name string) ([]byte, error)
- func (c *OcClient) Export(target string, label string) ([]byte, error)
- func (c *OcClient) Patch(target string, patches string) ([]byte, error)
- func (c *OcClient) Process(args []string) ([]byte, []byte, error)
- func (c *OcClient) Version() ([]byte, []byte, error)
- type OcClientCreator
- type OcClientDeleter
- type OcClientExporter
- type OcClientPatcher
- type OcClientProcessor
- type OcClientVersioner
- type SecretsOptions
Constants ¶
This section is empty.
Variables ¶
var PrintBluef func(format string, a ...interface{})
PrintBluef prints in blue.
var PrintGreenf func(format string, a ...interface{})
PrintGreenf prints in green.
var PrintRedf func(format string, a ...interface{})
PrintRedf prints in red.
var PrintYellowf func(format string, a ...interface{})
PrintYellowf prints in yellow.
Functions ¶
func AskForConfirmation ¶
AskForConfirmation asks the user for confirmation. A user must type in "yes" or "no" and then press enter. It has fuzzy matching, so "y", "Y", "yes", "YES", and "Yes" all count as confirmations. If the input is not recognized, it will ask again. The function does not return until it gets a valid response from the user.
func DebugMsg ¶
func DebugMsg(messages ...string)
DebugMsg prints given message when debug mode is on.
func EditEnvFile ¶
EditEnvFile opens content in EDITOR, and returns saved content.
func ExecPlainOcCmd ¶
ExecPlainOcCmd executes "oc" with given arguments applied.
func VerboseMsg ¶
func VerboseMsg(messages ...string)
VerboseMsg prints given message when verbose mode is on. Verbose mode is implicitly turned on when debug mode is on.
Types ¶
type ClientProcessorExporter ¶
type ClientProcessorExporter interface {
OcClientProcessor
OcClientExporter
}
ClientProcessorExporter allows to process templates and export resources.
type CompareOptions ¶
type CompareOptions struct {
*GlobalOptions
*NamespaceOptions
ContextDir string
Selector string
Exclude string
TemplateDir string
ParamDir string
PrivateKey string
Passphrase string
Labels string
Params []string
ParamFiles []string
Format string
PreservePaths []string
PreserveImmutableFields bool
IgnoreUnknownParameters bool
UpsertOnly bool
AllowRecreate bool
RevealSecrets bool
Resource string
}
CompareOptions are context-wide.
func NewCompareOptions ¶
func NewCompareOptions( globalOptions *GlobalOptions, contextDir string, namespaceFlag string, selectorFlag string, excludeFlag string, templateDirFlag string, paramDirFlag string, publicKeyDirFlag string, privateKeyFlag string, passphraseFlag string, labelsFlag string, paramFlag []string, paramFileFlag []string, formatFlag string, preserveFlag []string, preserveImmutableFieldsFlag bool, ignoreUnknownParametersFlag bool, upsertOnlyFlag bool, allowRecreateFlag bool, revealSecretsFlag bool, resourceArg string) (*CompareOptions, error)
NewCompareOptions returns new options for the diff/apply command based on file/flags.
func (*CompareOptions) PathsToPreserve ¶ added in v0.12.0
func (o *CompareOptions) PathsToPreserve() []string
func (*CompareOptions) ResolvedParamDir ¶
func (o *CompareOptions) ResolvedParamDir() string
ResolvedParamDir returns param dir prefixed by the context dir.
func (*CompareOptions) ResolvedParamFiles ¶ added in v0.10.4
func (o *CompareOptions) ResolvedParamFiles() []string
ResolvedParamFiles returns param files prefixed by the context dir.
func (*CompareOptions) ResolvedPrivateKey ¶ added in v0.10.4
func (o *CompareOptions) ResolvedPrivateKey() string
ResolvedPrivateKey returns private key prefixed by the context dir.
func (*CompareOptions) ResolvedTemplateDir ¶
func (o *CompareOptions) ResolvedTemplateDir() string
ResolvedTemplateDir returns template dir prefixed by the context dir.
type ExportOptions ¶
type ExportOptions struct {
*GlobalOptions
*NamespaceOptions
ContextDir string
Selector string
Exclude string
TemplateDir string
ParamDir string
WithAnnotations bool
Resource string
}
ExportOptions are context-wide.
func NewExportOptions ¶
func NewExportOptions( globalOptions *GlobalOptions, contextDir string, namespaceFlag string, selectorFlag string, excludeFlag string, templateDirFlag string, paramDirFlag string, withAnnotationsFlag bool, resourceArg string) (*ExportOptions, error)
NewExportOptions returns new options for the export command based on file/flags.
type GlobalOptions ¶
type GlobalOptions struct {
Verbose bool
Debug bool
NonInteractive bool
OcBinary string
File string
ContextDirs []string
Force bool
IsLoggedIn bool
}
GlobalOptions are app-wide that cannot be modified within a context.
func NewGlobalOptions ¶
func NewGlobalOptions( clusterRequired bool, fileFlag string, verboseFlag bool, debugFlag bool, nonInteractiveFlag bool, ocBinaryFlag string, contextDirFlag []string, forceFlag bool) (*GlobalOptions, error)
NewGlobalOptions returns new global options based on file/flags. Those options are shared across all commands.
type NamespaceOptions ¶
NamespaceOptions are context-wide.
type OcClient ¶
type OcClient struct {
// contains filtered or unexported fields
}
OcClient is a wrapper around the "oc" binary (client).
func (*OcClient) CheckLoggedIn ¶
CheckLoggedIn returns true if the given project (namespace) exists.
func (*OcClient) CheckProjectExists ¶
CheckProjectExists returns true if the given project (namespace) exists.
func (*OcClient) CurrentProject ¶
CurrentProject returns the currently active project name (namespace).
type OcClientCreator ¶
OcClientCreator allows to create a resource.
type OcClientDeleter ¶
OcClientDeleter allows to delete a resource.
type OcClientExporter ¶
OcClientExporter allows to export resources.
type OcClientPatcher ¶
OcClientPatcher allows to patch a resource.
type OcClientProcessor ¶
OcClientProcessor is a stop-gap solution only ... should have a better API.
type OcClientVersioner ¶
OcClientVersioner allows to retrieve the OpenShift version..
type SecretsOptions ¶
type SecretsOptions struct {
*GlobalOptions
ContextDir string
ParamDir string
PublicKeyDir string
PrivateKey string
Passphrase string
}
SecretsOptions are context-wide.
func NewSecretsOptions ¶
func NewSecretsOptions( globalOptions *GlobalOptions, paramDirFlag string, publicKeyDirFlag string, privateKeyFlag string, passphraseFlag string) (*SecretsOptions, error)
NewSecretsOptions returns new options for the secrets subcommand based on file/flags.
func (*SecretsOptions) ResolvedParamDir ¶
func (o *SecretsOptions) ResolvedParamDir() string
ResolvedParamDir returns param dir prefixed by the context dir.