Documentation ¶
Index ¶
- Variables
- func AskForAction(question string, options []string, reader *bufio.Reader) string
- 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 ClientApplier
- type ClientModifier
- type ClientProcessorExporter
- type CompareOptions
- type ExportOptions
- type GlobalOptions
- type NamespaceOptions
- type OcClient
- func (c *OcClient) Apply(config string, selector string) ([]byte, error)
- func (c *OcClient) CheckLoggedIn() (bool, error)
- func (c *OcClient) CheckProjectExists(p string) (bool, 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) Process(args []string) ([]byte, []byte, error)
- func (c *OcClient) Version() ([]byte, []byte, error)
- type OcClientApplier
- type OcClientDeleter
- type OcClientExporter
- type OcClientProcessor
- type OcClientVersioner
- type SecretsOptions
Constants ¶
This section is empty.
Variables ¶
var FprintBluef func(w io.Writer, format string, a ...interface{})
FprintBluef prints in green to w.
var FprintGreenf func(w io.Writer, format string, a ...interface{})
FprintGreenf prints in green to w.
var FprintRedf func(w io.Writer, format string, a ...interface{})
FprintRedf prints in green to w.
var FprintYellowf func(w io.Writer, format string, a ...interface{})
FprintYellowf prints in green to w.
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 AskForAction ¶ added in v1.1.0
AskForAction asks the user the given question. A user must type in one of the presented options and then press enter.If the input is not recognized, it will ask again. The function does not return until it gets a valid response from the user. Options are of form "y=yes". The matching is fuzzy, which means allowed values are "y", "Y", "yes", "YES", "Yes" and so on. The returned value is always the "key" ("y" in this case), regardless if the input was "y" or "yes" etc.
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 ClientApplier ¶ added in v1.1.0
type ClientApplier interface { ClientProcessorExporter ClientModifier }
type ClientModifier ¶ added in v1.1.0
type ClientModifier interface { OcClientApplier OcClientDeleter }
ClientModifier allows to delete and create/update resources.
type ClientProcessorExporter ¶
type ClientProcessorExporter interface { OcClientProcessor OcClientExporter }
ClientProcessorExporter allows to process templates and export resources.
type CompareOptions ¶
type CompareOptions struct { *GlobalOptions *NamespaceOptions Selector string Excludes []string TemplateDir string ParamDir string PrivateKey string Passphrase string Labels string Params []string ParamFiles []string PreservePaths []string PreserveImmutableFields bool IgnoreUnknownParameters bool UpsertOnly bool AllowRecreate bool RevealSecrets bool Verify bool Resource string }
CompareOptions define how to compare desired and current state.
func NewCompareOptions ¶
func NewCompareOptions( globalOptions *GlobalOptions, namespaceFlag string, selectorFlag string, excludeFlag []string, templateDirFlag string, paramDirFlag string, publicKeyDirFlag string, privateKeyFlag string, passphraseFlag string, labelsFlag string, paramFlag []string, paramFileFlag []string, preserveFlag []string, preserveImmutableFieldsFlag bool, ignoreUnknownParametersFlag bool, upsertOnlyFlag bool, allowRecreateFlag bool, revealSecretsFlag bool, verifyFlag 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
type ExportOptions ¶
type ExportOptions struct { *GlobalOptions *NamespaceOptions Selector string Excludes []string TemplateDir string ParamDir string WithAnnotations bool WithHardcodedNamespace bool TrimAnnotations []string Resource string }
ExportOptions define how the export should be done.
func NewExportOptions ¶
func NewExportOptions( globalOptions *GlobalOptions, namespaceFlag string, selectorFlag string, excludeFlag []string, templateDirFlag string, paramDirFlag string, withAnnotationsFlag bool, withHardcodedNamespaceFlag bool, trimAnnotationsFlag []string, 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 Force bool IsLoggedIn bool ClusterRequired bool // contains filtered or unexported fields }
GlobalOptions are app-wide.
func InitGlobalOptions ¶ added in v0.13.0
func InitGlobalOptions(fs utils.FileStater) *GlobalOptions
InitGlobalOptions creates a new pointer to GlobalOptions with a given filesystem.
func NewGlobalOptions ¶
func NewGlobalOptions( clusterRequired bool, fileFlag string, verboseFlag bool, debugFlag bool, nonInteractiveFlag bool, ocBinaryFlag string, forceFlag bool) (*GlobalOptions, error)
NewGlobalOptions returns new global options based on file/flags. Those options are shared across all commands.
func (*GlobalOptions) FileExists ¶ added in v0.13.0
func (o *GlobalOptions) FileExists(file string) bool
FileExists checks whether given file exists.
type NamespaceOptions ¶
NamespaceOptions define which namespace Tailor works against.
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 OcClientApplier ¶ added in v0.13.0
OcClientApplier allows to create/update a resource.
type OcClientDeleter ¶
OcClientDeleter allows to delete a resource.
type OcClientExporter ¶
OcClientExporter allows to export resources.
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 ParamDir string PublicKeyDir string PrivateKey string Passphrase string }
SecretsOptions define how to work with encrypted files.
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.