Config- updating cmd files for documentation

The description and examples are updated for the airshipctl
commands, which will be inturn used for generating documentation.
Please ignore the .md file changes in this PS. They are added for zuul
gates to pass. Here is the PS with generated documention
files https://review.opendev.org/c/airship/airshipctl/+/789250

Relates-To: #280
Change-Id: If3ec175e2f582919296576a4bff6ae64871a7333
This commit is contained in:
Sirisha Gopigiri 2021-05-06 14:46:42 +05:30
parent 1f5dbf8645
commit 3274b41151
34 changed files with 350 additions and 359 deletions

View File

@ -20,12 +20,17 @@ import (
"opendev.org/airship/airshipctl/pkg/config" "opendev.org/airship/airshipctl/pkg/config"
) )
const configLong = `
Provides commands which can be used to manage the airshipctl config file.
`
// NewConfigCommand creates a command for interacting with the airshipctl configuration. // NewConfigCommand creates a command for interacting with the airshipctl configuration.
func NewConfigCommand(cfgFactory config.Factory) *cobra.Command { func NewConfigCommand(cfgFactory config.Factory) *cobra.Command {
configRootCmd := &cobra.Command{ configRootCmd := &cobra.Command{
Use: "config", Use: "config",
DisableFlagsInUseLine: true, DisableFlagsInUseLine: true,
Short: "Manage the airshipctl config file", Short: "Airshipctl command to manage airshipctl config file",
Long: configLong,
} }
configRootCmd.AddCommand(NewGetContextCommand(cfgFactory)) configRootCmd.AddCommand(NewGetContextCommand(cfgFactory))

View File

@ -24,18 +24,19 @@ import (
const ( const (
getContextLong = ` getContextLong = `
Display information about contexts such as associated manifests, users, and clusters. Displays information about contexts such as associated manifests, users, and clusters. It would display a specific
context information, or all defined context information if no name is provided.
` `
getContextExample = ` getContextExample = `
# List all contexts List all contexts
airshipctl config get-contexts # airshipctl config get-contexts
# Display the current context Display the current context
airshipctl config get-context --current # airshipctl config get-context --current
# Display a specific context Display a specific context
airshipctl config get-context exampleContext # airshipctl config get-context exampleContext
` `
) )
@ -45,10 +46,9 @@ func NewGetContextCommand(cfgFactory config.Factory) *cobra.Command {
o := &config.ContextOptions{} o := &config.ContextOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "get-context CONTEXT_NAME", Use: "get-context CONTEXT_NAME",
Short: "Get context information from the airshipctl config", Short: "Airshipctl command to get context(s) information from the airshipctl config",
Long: getContextLong[1:], Long: getContextLong[1:],
Example: getContextExample, Example: getContextExample,
// Adding a maximum args cap for documentation purpose
Args: cobra.MaximumNArgs(1), Args: cobra.MaximumNArgs(1),
Aliases: []string{"get-contexts"}, Aliases: []string{"get-contexts"},
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
@ -76,15 +76,7 @@ func NewGetContextCommand(cfgFactory config.Factory) *cobra.Command {
func addGetContextFlags(o *config.ContextOptions, cmd *cobra.Command) { func addGetContextFlags(o *config.ContextOptions, cmd *cobra.Command) {
flags := cmd.Flags() flags := cmd.Flags()
flags.BoolVar( flags.BoolVar(&o.CurrentContext, "current", false, "get the current context")
&o.CurrentContext, flags.StringVar(&o.Format, "format", "yaml",
"current", "supported output format `yaml` or `table`, default is `yaml`")
false,
"get the current context")
flags.StringVar(
&o.Format,
"format",
"yaml",
"choose between `yaml` or `table`, default is `yaml`")
} }

View File

@ -23,19 +23,27 @@ import (
"opendev.org/airship/airshipctl/pkg/config" "opendev.org/airship/airshipctl/pkg/config"
) )
const getManagementConfigExample = ` const (
# View all defined management configurations getManagementConfigLong = `
airshipctl config get-management-configs Displays a specific management config information, or all defined management configs if no name is provided.
The information relates to reboot-delays and retry in seconds along with management-type that has to be used.
# View a specific management configuration named "default"
airshipctl config get-management-config default
` `
getManagementConfigExample = `
View all management configurations
# airshipctl config get-management-configs
View a specific management configuration named "default"
# airshipctl config get-management-config default
`
)
// NewGetManagementConfigCommand creates a command that enables printing a management configuration to stdout. // NewGetManagementConfigCommand creates a command that enables printing a management configuration to stdout.
func NewGetManagementConfigCommand(cfgFactory config.Factory) *cobra.Command { func NewGetManagementConfigCommand(cfgFactory config.Factory) *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "get-management-config [NAME]", Use: "get-management-config MGMT_CONFIG_NAME",
Short: "View a management config or all management configs defined in the airshipctl config", Short: "Airshipctl command to view management config(s) defined in the airshipctl config",
Long: getManagementConfigLong,
Example: getManagementConfigExample, Example: getManagementConfigExample,
Args: cobra.MaximumNArgs(1), Args: cobra.MaximumNArgs(1),
Aliases: []string{"get-management-configs"}, Aliases: []string{"get-management-configs"},

View File

@ -22,15 +22,16 @@ import (
const ( const (
getManifestsLong = ` getManifestsLong = `
Display a specific manifest information, or all defined manifests if no name is provided. Displays a specific manifest information, or all defined manifests if no name is provided. The information
includes the repository details related to site manifest along with the local targetPath for them.
` `
getManifestsExample = ` getManifestsExample = `
# List all the manifests airshipctl knows about List all the manifests
airshipctl config get-manifests # airshipctl config get-manifests
# Display a specific manifest Display a specific manifest
airshipctl config get-manifest e2e # airshipctl config get-manifest e2e
` `
) )
@ -39,8 +40,8 @@ airshipctl config get-manifest e2e
func NewGetManifestCommand(cfgFactory config.Factory) *cobra.Command { func NewGetManifestCommand(cfgFactory config.Factory) *cobra.Command {
var manifestName string var manifestName string
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "get-manifest NAME", Use: "get-manifest MANIFEST_NAME",
Short: "Get a manifest(s) information from the airshipctl config", Short: "Airshipctl command to get a specific or all manifest(s) information from the airshipctl config",
Long: getManifestsLong[1:], Long: getManifestsLong[1:],
Example: getManifestsExample, Example: getManifestsExample,
Args: GetManifestNArgs(&manifestName), Args: GetManifestNArgs(&manifestName),

View File

@ -22,20 +22,20 @@ import (
const ( const (
initLong = ` initLong = `
Generate an airshipctl config file. This file by default will be written to the $HOME/.airship directory, Generates airshipctl config file. This file by default will be written to the $HOME/.airship directory,
and will contain default configuration. In case if flag --airshipconf provided - the file will be and will contain default configuration. In case if flag --airshipconf provided - the default configuration
written to the specified location instead. If a configuration file already exists at the specified path, will be written to the file in the specified location instead. If a configuration file already exists
an error will be thrown; to overwrite it, specify the --overwrite flag. at the specified path, an error will be thrown; to overwrite it, specify the --overwrite flag.
` `
initExample = ` initExample = `
# Create new airshipctl config file at the default location To create new airshipctl config file at the default location
airshipctl config init # airshipctl config init
# Create new airshipctl config file at the custom location To create new airshipctl config file at the custom location
airshipctl config init --airshipconf path/to/config # airshipctl config init --airshipconf path/to/config
# Create new airshipctl config file at custom location and overwrite it To create new airshipctl config file at the custom location and overwrite it
airshipctl config init --overwrite --airshipconf path/to/config # airshipctl config init --overwrite --airshipconf path/to/config
` `
) )
@ -44,7 +44,7 @@ func NewInitCommand() *cobra.Command {
var overwrite bool var overwrite bool
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "init", Use: "init",
Short: "Generate initial configuration file for airshipctl", Short: "Airshipctl command to generate initial configuration file for airshipctl",
Long: initLong[1:], Long: initLong[1:],
Example: initExample, Example: initExample,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {

View File

@ -23,18 +23,16 @@ import (
const ( const (
setContextLong = ` setContextLong = `
Create or modify a context in the airshipctl config files. Creates or modifies context in the airshipctl config file based on the CONTEXT_NAME passed or for the current context
if --current flag is specified. It accepts optional flags which include manifest name and management-config name.
` `
setContextExample = ` setContextExample = `
# Create a new context named "exampleContext" To create a new context named "exampleContext"
airshipctl config set-context exampleContext \ # airshipctl config set-context exampleContext --manifest=exampleManifest
--manifest=exampleManifest \
# Update the manifest of the current-context To update the manifest of the current-context
airshipctl config set-context \ # airshipctl config set-context --current --manifest=exampleManifest
--current \
--manifest=exampleManifest
` `
setContextManifestFlag = "manifest" setContextManifestFlag = "manifest"
@ -47,8 +45,8 @@ airshipctl config set-context \
func NewSetContextCommand(cfgFactory config.Factory) *cobra.Command { func NewSetContextCommand(cfgFactory config.Factory) *cobra.Command {
o := &config.ContextOptions{} o := &config.ContextOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "set-context NAME", Use: "set-context CONTEXT_NAME",
Short: "Manage contexts", Short: "Airshipctl command to create/modify context in airshipctl config file",
Long: setContextLong[1:], Long: setContextLong[1:],
Example: setContextExample, Example: setContextExample,
Args: cobra.MaximumNArgs(1), Args: cobra.MaximumNArgs(1),
@ -62,22 +60,11 @@ func NewSetContextCommand(cfgFactory config.Factory) *cobra.Command {
func addSetContextFlags(cmd *cobra.Command, o *config.ContextOptions) { func addSetContextFlags(cmd *cobra.Command, o *config.ContextOptions) {
flags := cmd.Flags() flags := cmd.Flags()
flags.StringVar( flags.StringVar(&o.Manifest, setContextManifestFlag, "",
&o.Manifest,
setContextManifestFlag,
"",
"set the manifest for the specified context") "set the manifest for the specified context")
flags.StringVar(&o.ManagementConfiguration, setContextManagementConfigFlag, "",
flags.StringVar(
&o.ManagementConfiguration,
setContextManagementConfigFlag,
"",
"set the management config for the specified context") "set the management config for the specified context")
flags.BoolVar(&o.Current, setContextCurrentFlag, false,
flags.BoolVar(
&o.Current,
setContextCurrentFlag,
false,
"update the current context") "update the current context")
} }

View File

@ -23,20 +23,36 @@ import (
) )
const ( const (
setManagementConfigLong = `
Creates or modifies management config information based on the MGMT_CONFIG_NAME passed. The allowed set
of optional flags are management-type, system-action-retries and system-reboot-delay. Use --use-proxy
and --insecure to enable proxy and insecure options respectively.
`
setManagementConfigExample = `
Create management configuration
# airshipctl config set-management-config default
Create or update management configuration named "default" with retry and to enable insecure options
# airshipctl config set-management-config default --insecure --system-action-retries 40
Enable proxy for "test" management configuration
# airshipctl config set-management-config test --use-proxy
`
flagInsecure = "insecure" flagInsecure = "insecure"
flagInsecureDescription = "Ignore SSL certificate verification on out-of-band management requests" flagInsecureDescription = "ignore SSL certificate verification on out-of-band management requests"
flagManagementType = "management-type" flagManagementType = "management-type"
flagManagementTypeDescription = "Set the out-of-band management type" flagManagementTypeDescription = "set the out-of-band management type"
flagUseProxy = "use-proxy" flagUseProxy = "use-proxy"
flagUseProxyDescription = "Use the proxy configuration specified in the local environment" flagUseProxyDescription = "use the proxy configuration specified in the local environment"
flagSystemActionRetries = "system-action-retries" flagSystemActionRetries = "system-action-retries"
flagSystemActionRetriesDescription = "Set the number of attempts to poll a host for a status" flagSystemActionRetriesDescription = "set the number of attempts to poll a host for a status"
flagSystemRebootDelay = "system-reboot-delay" flagSystemRebootDelay = "system-reboot-delay"
flagSystemRebootDelayDescription = "Set the number of seconds to wait between power actions (e.g. shutdown, startup)" flagSystemRebootDelayDescription = "set the number of seconds to wait between power actions (e.g. shutdown, startup)"
) )
// NewSetManagementConfigCommand creates a command for creating and modifying clusters // NewSetManagementConfigCommand creates a command for creating and modifying clusters
@ -44,8 +60,10 @@ const (
func NewSetManagementConfigCommand(cfgFactory config.Factory) *cobra.Command { func NewSetManagementConfigCommand(cfgFactory config.Factory) *cobra.Command {
o := &config.ManagementConfiguration{} o := &config.ManagementConfiguration{}
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "set-management-config NAME", Use: "set-management-config MGMT_CONFIG_NAME",
Short: "Modify an out-of-band management configuration", Short: "Airshipctl command to create/modify out-of-band management configuration in airshipctl config file",
Long: setManagementConfigLong,
Example: setManagementConfigExample,
Args: cobra.ExactArgs(1), Args: cobra.ExactArgs(1),
RunE: setManagementConfigRunE(cfgFactory, o), RunE: setManagementConfigRunE(cfgFactory, o),
} }

View File

@ -25,26 +25,22 @@ import (
const ( const (
setManifestsLong = ` setManifestsLong = `
Create or modify a manifests in the airshipctl config file. Creates or modifies a manifests in the airshipctl config file based on the MANIFEST_NAME argument passed.
The optional flags that can be passed to the command are repo name, url, branch name, tag name, commit hash,
target-path and metadata-path. Use --force flag to enable force checkout of the repo. And use --phase flag
to enable phase repository.
` `
setManifestsExample = ` setManifestsExample = `
# Create a new manifest Create a new manifest
airshipctl config set-manifest exampleManifest \ # airshipctl config set-manifest exampleManifest --repo exampleRepo --url https://github.com/site \
--repo exampleRepo \ --branch master --phase --target-path exampleTargetpath
--url https://github.com/site \
--branch master \
--phase \
--target-path exampleTargetpath
# Change the phase repo for manifest Change the phase repo for manifest
airshipctl config set-manifest e2e \ # airshipctl config set-manifest e2e --repo exampleRepo --phase
--repo exampleRepo \
--phase
# Change the target-path for manifest Change the target-path for manifest
airshipctl config set-manifest e2e \ # airshipctl config set-manifest e2e --target-path /tmp/e2e
--target-path /tmp/e2e
` `
) )
@ -53,8 +49,8 @@ airshipctl config set-manifest e2e \
func NewSetManifestCommand(cfgFactory config.Factory) *cobra.Command { func NewSetManifestCommand(cfgFactory config.Factory) *cobra.Command {
o := &config.ManifestOptions{} o := &config.ManifestOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "set-manifest NAME", Use: "set-manifest MANIFEST_NAME",
Short: "Manage manifests in airship config", Short: "Airshipctl command to create/modify manifests in airship config",
Long: setManifestsLong[1:], Long: setManifestsLong[1:],
Example: setManifestsExample, Example: setManifestsExample,
Args: cobra.ExactArgs(1), Args: cobra.ExactArgs(1),
@ -88,57 +84,22 @@ func NewSetManifestCommand(cfgFactory config.Factory) *cobra.Command {
func addSetManifestFlags(o *config.ManifestOptions, cmd *cobra.Command) { func addSetManifestFlags(o *config.ManifestOptions, cmd *cobra.Command) {
flags := cmd.Flags() flags := cmd.Flags()
flags.StringVar( flags.StringVar(&o.RepoName, "repo", "",
&o.RepoName,
"repo",
"",
"the name of the repository to be associated with this manifest") "the name of the repository to be associated with this manifest")
flags.StringVar(&o.URL, "url", "",
flags.StringVar(
&o.URL,
"url",
"",
"the repository url to be associated with this manifest") "the repository url to be associated with this manifest")
flags.StringVar(&o.Branch, "branch", "",
flags.StringVar(
&o.Branch,
"branch",
"",
"the branch to be associated with repository in this manifest") "the branch to be associated with repository in this manifest")
flags.StringVar(&o.CommitHash, "commithash", "",
flags.StringVar(
&o.CommitHash,
"commithash",
"",
"the commit hash to be associated with repository in this manifest") "the commit hash to be associated with repository in this manifest")
flags.StringVar(&o.Tag, "tag", "",
flags.StringVar(
&o.Tag,
"tag",
"",
"the tag to be associated with repository in this manifest") "the tag to be associated with repository in this manifest")
flags.BoolVar(&o.Force, "force", false,
flags.BoolVar(
&o.Force,
"force",
false,
"if set, enable force checkout in repository with this manifest") "if set, enable force checkout in repository with this manifest")
flags.StringVar(&o.TargetPath, "target-path", "",
flags.BoolVar(
&o.IsPhase,
"phase",
false,
"if set, enable this repository as phase repository to be used with this manifest")
flags.StringVar(
&o.TargetPath,
"target-path",
"",
"the target path to be set for this manifest") "the target path to be set for this manifest")
flags.StringVar(&o.MetadataPath, "metadata-path", "",
flags.StringVar(
&o.MetadataPath,
"metadata-path",
"",
"the metadata path to be set for this manifest") "the metadata path to be set for this manifest")
flags.BoolVar(&o.IsPhase, "phase", false,
"if set, enable this repository as phase repository to be used with this manifest")
} }

View File

@ -1,18 +1,19 @@
Manage the airshipctl config file
Provides commands which can be used to manage the airshipctl config file.
Usage: Usage:
config [command] config [command]
Available Commands: Available Commands:
get-context Get context information from the airshipctl config get-context Airshipctl command to get context(s) information from the airshipctl config
get-management-config View a management config or all management configs defined in the airshipctl config get-management-config Airshipctl command to view management config(s) defined in the airshipctl config
get-manifest Get a manifest(s) information from the airshipctl config get-manifest Airshipctl command to get a specific or all manifest(s) information from the airshipctl config
help Help about any command help Help about any command
init Generate initial configuration file for airshipctl init Airshipctl command to generate initial configuration file for airshipctl
set-context Manage contexts set-context Airshipctl command to create/modify context in airshipctl config file
set-management-config Modify an out-of-band management configuration set-management-config Airshipctl command to create/modify out-of-band management configuration in airshipctl config file
set-manifest Manage manifests in airship config set-manifest Airshipctl command to create/modify manifests in airship config
use-context Switch to a different context use-context Airshipctl command to switch to a different context
Flags: Flags:
-h, --help help for config -h, --help help for config

View File

@ -1,21 +1,21 @@
Generate an airshipctl config file. This file by default will be written to the $HOME/.airship directory, Generates airshipctl config file. This file by default will be written to the $HOME/.airship directory,
and will contain default configuration. In case if flag --airshipconf provided - the file will be and will contain default configuration. In case if flag --airshipconf provided - the default configuration
written to the specified location instead. If a configuration file already exists at the specified path, will be written to the file in the specified location instead. If a configuration file already exists
an error will be thrown; to overwrite it, specify the --overwrite flag. at the specified path, an error will be thrown; to overwrite it, specify the --overwrite flag.
Usage: Usage:
init [flags] init [flags]
Examples: Examples:
# Create new airshipctl config file at the default location To create new airshipctl config file at the default location
airshipctl config init # airshipctl config init
# Create new airshipctl config file at the custom location To create new airshipctl config file at the custom location
airshipctl config init --airshipconf path/to/config # airshipctl config init --airshipconf path/to/config
# Create new airshipctl config file at custom location and overwrite it To create new airshipctl config file at the custom location and overwrite it
airshipctl config init --overwrite --airshipconf path/to/config # airshipctl config init --overwrite --airshipconf path/to/config
Flags: Flags:

View File

@ -1,18 +1,16 @@
Create or modify a context in the airshipctl config files. Creates or modifies context in the airshipctl config file based on the CONTEXT_NAME passed or for the current context
if --current flag is specified. It accepts optional flags which include manifest name and management-config name.
Usage: Usage:
set-context NAME [flags] set-context CONTEXT_NAME [flags]
Examples: Examples:
# Create a new context named "exampleContext" To create a new context named "exampleContext"
airshipctl config set-context exampleContext \ # airshipctl config set-context exampleContext --manifest=exampleManifest
--manifest=exampleManifest \
# Update the manifest of the current-context To update the manifest of the current-context
airshipctl config set-context \ # airshipctl config set-context --current --manifest=exampleManifest
--current \
--manifest=exampleManifest
Flags: Flags:

View File

@ -1,12 +1,27 @@
Modify an out-of-band management configuration
Creates or modifies management config information based on the MGMT_CONFIG_NAME passed. The allowed set
of optional flags are management-type, system-action-retries and system-reboot-delay. Use --use-proxy
and --insecure to enable proxy and insecure options respectively.
Usage: Usage:
set-management-config NAME [flags] set-management-config MGMT_CONFIG_NAME [flags]
Examples:
Create management configuration
# airshipctl config set-management-config default
Create or update management configuration named "default" with retry and to enable insecure options
# airshipctl config set-management-config default --insecure --system-action-retries 40
Enable proxy for "test" management configuration
# airshipctl config set-management-config test --use-proxy
Flags: Flags:
-h, --help help for set-management-config -h, --help help for set-management-config
--insecure Ignore SSL certificate verification on out-of-band management requests --insecure ignore SSL certificate verification on out-of-band management requests
--management-type string Set the out-of-band management type (default "redfish") --management-type string set the out-of-band management type (default "redfish")
--system-action-retries int Set the number of attempts to poll a host for a status (default 30) --system-action-retries int set the number of attempts to poll a host for a status (default 30)
--system-reboot-delay int Set the number of seconds to wait between power actions (e.g. shutdown, startup) (default 30) --system-reboot-delay int set the number of seconds to wait between power actions (e.g. shutdown, startup) (default 30)
--use-proxy Use the proxy configuration specified in the local environment (default true) --use-proxy use the proxy configuration specified in the local environment (default true)

View File

@ -1,25 +1,18 @@
Error: accepts 1 arg(s), received 0 Error: accepts 1 arg(s), received 0
Usage: Usage:
set-manifest NAME [flags] set-manifest MANIFEST_NAME [flags]
Examples: Examples:
# Create a new manifest Create a new manifest
airshipctl config set-manifest exampleManifest \ # airshipctl config set-manifest exampleManifest --repo exampleRepo --url https://github.com/site \
--repo exampleRepo \ --branch master --phase --target-path exampleTargetpath
--url https://github.com/site \
--branch master \
--phase \
--target-path exampleTargetpath
# Change the phase repo for manifest Change the phase repo for manifest
airshipctl config set-manifest e2e \ # airshipctl config set-manifest e2e --repo exampleRepo --phase
--repo exampleRepo \
--phase
# Change the target-path for manifest Change the target-path for manifest
airshipctl config set-manifest e2e \ # airshipctl config set-manifest e2e --target-path /tmp/e2e
--target-path /tmp/e2e
Flags: Flags:

View File

@ -1,25 +1,18 @@
Error: accepts 1 arg(s), received 2 Error: accepts 1 arg(s), received 2
Usage: Usage:
set-manifest NAME [flags] set-manifest MANIFEST_NAME [flags]
Examples: Examples:
# Create a new manifest Create a new manifest
airshipctl config set-manifest exampleManifest \ # airshipctl config set-manifest exampleManifest --repo exampleRepo --url https://github.com/site \
--repo exampleRepo \ --branch master --phase --target-path exampleTargetpath
--url https://github.com/site \
--branch master \
--phase \
--target-path exampleTargetpath
# Change the phase repo for manifest Change the phase repo for manifest
airshipctl config set-manifest e2e \ # airshipctl config set-manifest e2e --repo exampleRepo --phase
--repo exampleRepo \
--phase
# Change the target-path for manifest Change the target-path for manifest
airshipctl config set-manifest e2e \ # airshipctl config set-manifest e2e --target-path /tmp/e2e
--target-path /tmp/e2e
Flags: Flags:

View File

@ -1,26 +1,22 @@
Create or modify a manifests in the airshipctl config file. Creates or modifies a manifests in the airshipctl config file based on the MANIFEST_NAME argument passed.
The optional flags that can be passed to the command are repo name, url, branch name, tag name, commit hash,
target-path and metadata-path. Use --force flag to enable force checkout of the repo. And use --phase flag
to enable phase repository.
Usage: Usage:
set-manifest NAME [flags] set-manifest MANIFEST_NAME [flags]
Examples: Examples:
# Create a new manifest Create a new manifest
airshipctl config set-manifest exampleManifest \ # airshipctl config set-manifest exampleManifest --repo exampleRepo --url https://github.com/site \
--repo exampleRepo \ --branch master --phase --target-path exampleTargetpath
--url https://github.com/site \
--branch master \
--phase \
--target-path exampleTargetpath
# Change the phase repo for manifest Change the phase repo for manifest
airshipctl config set-manifest e2e \ # airshipctl config set-manifest e2e --repo exampleRepo --phase
--repo exampleRepo \
--phase
# Change the target-path for manifest Change the target-path for manifest
airshipctl config set-manifest e2e \ # airshipctl config set-manifest e2e --target-path /tmp/e2e
--target-path /tmp/e2e
Flags: Flags:

View File

@ -1,11 +1,11 @@
Error: missing configuration: context with name 'foo' Error: missing configuration: context with name 'foo'
Usage: Usage:
use-context NAME [flags] use-context CONTEXT_NAME [flags]
Examples: Examples:
# Switch to a context named "exampleContext" in airshipctl config file Switch to a context named "exampleContext" in airshipctl config file
airshipctl config use-context exampleContext # airshipctl config use-context exampleContext
Flags: Flags:

View File

@ -1,11 +1,11 @@
Error: accepts 1 arg(s), received 0 Error: accepts 1 arg(s), received 0
Usage: Usage:
use-context NAME [flags] use-context CONTEXT_NAME [flags]
Examples: Examples:
# Switch to a context named "exampleContext" in airshipctl config file Switch to a context named "exampleContext" in airshipctl config file
airshipctl config use-context exampleContext # airshipctl config use-context exampleContext
Flags: Flags:

View File

@ -7,18 +7,18 @@ Aliases:
Examples: Examples:
# List all contexts List all contexts
airshipctl config get-contexts # airshipctl config get-contexts
# Display the current context Display the current context
airshipctl config get-context --current # airshipctl config get-context --current
# Display a specific context Display a specific context
airshipctl config get-context exampleContext # airshipctl config get-context exampleContext
Flags: Flags:
--current get the current context --current get the current context
--format yaml choose between yaml or `table`, default is `yaml` (default "yaml") --format yaml supported output format yaml or `table`, default is `yaml` (default "yaml")
-h, --help help for get-context -h, --help help for get-context

View File

@ -7,18 +7,18 @@ Aliases:
Examples: Examples:
# List all contexts List all contexts
airshipctl config get-contexts # airshipctl config get-contexts
# Display the current context Display the current context
airshipctl config get-context --current # airshipctl config get-context --current
# Display a specific context Display a specific context
airshipctl config get-context exampleContext # airshipctl config get-context exampleContext
Flags: Flags:
--current get the current context --current get the current context
--format yaml choose between yaml or `table`, default is `yaml` (default "yaml") --format yaml supported output format yaml or `table`, default is `yaml` (default "yaml")
-h, --help help for get-context -h, --help help for get-context

View File

@ -1,17 +1,17 @@
Error: Unknown management configuration 'foo'. Error: Unknown management configuration 'foo'.
Usage: Usage:
get-management-config [NAME] [flags] get-management-config MGMT_CONFIG_NAME [flags]
Aliases: Aliases:
get-management-config, get-management-configs get-management-config, get-management-configs
Examples: Examples:
# View all defined management configurations View all management configurations
airshipctl config get-management-configs # airshipctl config get-management-configs
# View a specific management configuration named "default" View a specific management configuration named "default"
airshipctl config get-management-config default # airshipctl config get-management-config default
Flags: Flags:

View File

@ -1,18 +1,20 @@
View a management config or all management configs defined in the airshipctl config
Displays a specific management config information, or all defined management configs if no name is provided.
The information relates to reboot-delays and retry in seconds along with management-type that has to be used.
Usage: Usage:
get-management-config [NAME] [flags] get-management-config MGMT_CONFIG_NAME [flags]
Aliases: Aliases:
get-management-config, get-management-configs get-management-config, get-management-configs
Examples: Examples:
# View all defined management configurations View all management configurations
airshipctl config get-management-configs # airshipctl config get-management-configs
# View a specific management configuration named "default" View a specific management configuration named "default"
airshipctl config get-management-config default # airshipctl config get-management-config default
Flags: Flags:

View File

@ -1,18 +1,19 @@
Display a specific manifest information, or all defined manifests if no name is provided. Displays a specific manifest information, or all defined manifests if no name is provided. The information
includes the repository details related to site manifest along with the local targetPath for them.
Usage: Usage:
get-manifest NAME [flags] get-manifest MANIFEST_NAME [flags]
Aliases: Aliases:
get-manifest, get-manifests get-manifest, get-manifests
Examples: Examples:
# List all the manifests airshipctl knows about List all the manifests
airshipctl config get-manifests # airshipctl config get-manifests
# Display a specific manifest Display a specific manifest
airshipctl config get-manifest e2e # airshipctl config get-manifest e2e
Flags: Flags:

View File

@ -25,20 +25,20 @@ import (
const ( const (
useContextLong = ` useContextLong = `
Switch to a different context defined in the airshipctl config file. Switch to a different context defined in the airshipctl config file.
This command doesn't change a context for the kubeconfig file. This command doesn't change the context for the kubeconfig file.
` `
useContextExample = ` useContextExample = `
# Switch to a context named "exampleContext" in airshipctl config file Switch to a context named "exampleContext" in airshipctl config file
airshipctl config use-context exampleContext # airshipctl config use-context exampleContext
` `
) )
// NewUseContextCommand creates a command for switching to a defined airshipctl context. // NewUseContextCommand creates a command for switching to a defined airshipctl context.
func NewUseContextCommand(cfgFactory config.Factory) *cobra.Command { func NewUseContextCommand(cfgFactory config.Factory) *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "use-context NAME", Use: "use-context CONTEXT_NAME",
Short: "Switch to a different context", Short: "Airshipctl command to switch to a different context",
Long: useContextLong[1:], Long: useContextLong[1:],
Example: useContextExample, Example: useContextExample,
Args: cobra.ExactArgs(1), Args: cobra.ExactArgs(1),

View File

@ -9,7 +9,7 @@ Available Commands:
baremetal Airshipctl command to manage bare metal host(s) baremetal Airshipctl command to manage bare metal host(s)
cluster Airshipctl command to manage kubernetes clusters cluster Airshipctl command to manage kubernetes clusters
completion Generate completion script for the specified shell (bash or zsh) completion Generate completion script for the specified shell (bash or zsh)
config Manage the airshipctl config file config Airshipctl command to manage airshipctl config file
document Manage deployment documents document Manage deployment documents
help Help about any command help Help about any command
phase Manage phases phase Manage phases

View File

@ -22,7 +22,7 @@ A unified entrypoint to various airship components
* [airshipctl baremetal](airshipctl_baremetal.md) - Airshipctl command to manage bare metal host(s) * [airshipctl baremetal](airshipctl_baremetal.md) - Airshipctl command to manage bare metal host(s)
* [airshipctl cluster](airshipctl_cluster.md) - Airshipctl command to manage kubernetes clusters * [airshipctl cluster](airshipctl_cluster.md) - Airshipctl command to manage kubernetes clusters
* [airshipctl completion](airshipctl_completion.md) - Generate completion script for the specified shell (bash or zsh) * [airshipctl completion](airshipctl_completion.md) - Generate completion script for the specified shell (bash or zsh)
* [airshipctl config](airshipctl_config.md) - Manage the airshipctl config file * [airshipctl config](airshipctl_config.md) - Airshipctl command to manage airshipctl config file
* [airshipctl document](airshipctl_document.md) - Manage deployment documents * [airshipctl document](airshipctl_document.md) - Manage deployment documents
* [airshipctl phase](airshipctl_phase.md) - Manage phases * [airshipctl phase](airshipctl_phase.md) - Manage phases
* [airshipctl plan](airshipctl_plan.md) - Manage plans * [airshipctl plan](airshipctl_plan.md) - Manage plans

View File

@ -1,10 +1,12 @@
## airshipctl config ## airshipctl config
Manage the airshipctl config file Airshipctl command to manage airshipctl config file
### Synopsis ### Synopsis
Manage the airshipctl config file
Provides commands which can be used to manage the airshipctl config file.
### Options ### Options
@ -22,12 +24,12 @@ Manage the airshipctl config file
### SEE ALSO ### SEE ALSO
* [airshipctl](airshipctl.md) - A unified entrypoint to various airship components * [airshipctl](airshipctl.md) - A unified entrypoint to various airship components
* [airshipctl config get-context](airshipctl_config_get-context.md) - Get context information from the airshipctl config * [airshipctl config get-context](airshipctl_config_get-context.md) - Airshipctl command to get context(s) information from the airshipctl config
* [airshipctl config get-management-config](airshipctl_config_get-management-config.md) - View a management config or all management configs defined in the airshipctl config * [airshipctl config get-management-config](airshipctl_config_get-management-config.md) - Airshipctl command to view management config(s) defined in the airshipctl config
* [airshipctl config get-manifest](airshipctl_config_get-manifest.md) - Get a manifest(s) information from the airshipctl config * [airshipctl config get-manifest](airshipctl_config_get-manifest.md) - Airshipctl command to get a specific or all manifest(s) information from the airshipctl config
* [airshipctl config init](airshipctl_config_init.md) - Generate initial configuration file for airshipctl * [airshipctl config init](airshipctl_config_init.md) - Airshipctl command to generate initial configuration file for airshipctl
* [airshipctl config set-context](airshipctl_config_set-context.md) - Manage contexts * [airshipctl config set-context](airshipctl_config_set-context.md) - Airshipctl command to create/modify context in airshipctl config file
* [airshipctl config set-management-config](airshipctl_config_set-management-config.md) - Modify an out-of-band management configuration * [airshipctl config set-management-config](airshipctl_config_set-management-config.md) - Airshipctl command to create/modify out-of-band management configuration in airshipctl config file
* [airshipctl config set-manifest](airshipctl_config_set-manifest.md) - Manage manifests in airship config * [airshipctl config set-manifest](airshipctl_config_set-manifest.md) - Airshipctl command to create/modify manifests in airship config
* [airshipctl config use-context](airshipctl_config_use-context.md) - Switch to a different context * [airshipctl config use-context](airshipctl_config_use-context.md) - Airshipctl command to switch to a different context

View File

@ -1,10 +1,11 @@
## airshipctl config get-context ## airshipctl config get-context
Get context information from the airshipctl config Airshipctl command to get context(s) information from the airshipctl config
### Synopsis ### Synopsis
Display information about contexts such as associated manifests, users, and clusters. Displays information about contexts such as associated manifests, users, and clusters. It would display a specific
context information, or all defined context information if no name is provided.
``` ```
@ -15,14 +16,14 @@ airshipctl config get-context CONTEXT_NAME [flags]
``` ```
# List all contexts List all contexts
airshipctl config get-contexts # airshipctl config get-contexts
# Display the current context Display the current context
airshipctl config get-context --current # airshipctl config get-context --current
# Display a specific context Display a specific context
airshipctl config get-context exampleContext # airshipctl config get-context exampleContext
``` ```
@ -30,7 +31,7 @@ airshipctl config get-context exampleContext
``` ```
--current get the current context --current get the current context
--format yaml choose between yaml or `table`, default is `yaml` (default "yaml") --format yaml supported output format yaml or `table`, default is `yaml` (default "yaml")
-h, --help help for get-context -h, --help help for get-context
``` ```
@ -43,5 +44,5 @@ airshipctl config get-context exampleContext
### SEE ALSO ### SEE ALSO
* [airshipctl config](airshipctl_config.md) - Manage the airshipctl config file * [airshipctl config](airshipctl_config.md) - Airshipctl command to manage airshipctl config file

View File

@ -1,24 +1,27 @@
## airshipctl config get-management-config ## airshipctl config get-management-config
View a management config or all management configs defined in the airshipctl config Airshipctl command to view management config(s) defined in the airshipctl config
### Synopsis ### Synopsis
View a management config or all management configs defined in the airshipctl config
Displays a specific management config information, or all defined management configs if no name is provided.
The information relates to reboot-delays and retry in seconds along with management-type that has to be used.
``` ```
airshipctl config get-management-config [NAME] [flags] airshipctl config get-management-config MGMT_CONFIG_NAME [flags]
``` ```
### Examples ### Examples
``` ```
# View all defined management configurations View all management configurations
airshipctl config get-management-configs # airshipctl config get-management-configs
# View a specific management configuration named "default" View a specific management configuration named "default"
airshipctl config get-management-config default # airshipctl config get-management-config default
``` ```
@ -37,5 +40,5 @@ airshipctl config get-management-config default
### SEE ALSO ### SEE ALSO
* [airshipctl config](airshipctl_config.md) - Manage the airshipctl config file * [airshipctl config](airshipctl_config.md) - Airshipctl command to manage airshipctl config file

View File

@ -1,25 +1,26 @@
## airshipctl config get-manifest ## airshipctl config get-manifest
Get a manifest(s) information from the airshipctl config Airshipctl command to get a specific or all manifest(s) information from the airshipctl config
### Synopsis ### Synopsis
Display a specific manifest information, or all defined manifests if no name is provided. Displays a specific manifest information, or all defined manifests if no name is provided. The information
includes the repository details related to site manifest along with the local targetPath for them.
``` ```
airshipctl config get-manifest NAME [flags] airshipctl config get-manifest MANIFEST_NAME [flags]
``` ```
### Examples ### Examples
``` ```
# List all the manifests airshipctl knows about List all the manifests
airshipctl config get-manifests # airshipctl config get-manifests
# Display a specific manifest Display a specific manifest
airshipctl config get-manifest e2e # airshipctl config get-manifest e2e
``` ```
@ -38,5 +39,5 @@ airshipctl config get-manifest e2e
### SEE ALSO ### SEE ALSO
* [airshipctl config](airshipctl_config.md) - Manage the airshipctl config file * [airshipctl config](airshipctl_config.md) - Airshipctl command to manage airshipctl config file

View File

@ -1,13 +1,13 @@
## airshipctl config init ## airshipctl config init
Generate initial configuration file for airshipctl Airshipctl command to generate initial configuration file for airshipctl
### Synopsis ### Synopsis
Generate an airshipctl config file. This file by default will be written to the $HOME/.airship directory, Generates airshipctl config file. This file by default will be written to the $HOME/.airship directory,
and will contain default configuration. In case if flag --airshipconf provided - the file will be and will contain default configuration. In case if flag --airshipconf provided - the default configuration
written to the specified location instead. If a configuration file already exists at the specified path, will be written to the file in the specified location instead. If a configuration file already exists
an error will be thrown; to overwrite it, specify the --overwrite flag. at the specified path, an error will be thrown; to overwrite it, specify the --overwrite flag.
``` ```
@ -18,14 +18,14 @@ airshipctl config init [flags]
``` ```
# Create new airshipctl config file at the default location To create new airshipctl config file at the default location
airshipctl config init # airshipctl config init
# Create new airshipctl config file at the custom location To create new airshipctl config file at the custom location
airshipctl config init --airshipconf path/to/config # airshipctl config init --airshipconf path/to/config
# Create new airshipctl config file at custom location and overwrite it To create new airshipctl config file at the custom location and overwrite it
airshipctl config init --overwrite --airshipconf path/to/config # airshipctl config init --overwrite --airshipconf path/to/config
``` ```
@ -45,5 +45,5 @@ airshipctl config init --overwrite --airshipconf path/to/config
### SEE ALSO ### SEE ALSO
* [airshipctl config](airshipctl_config.md) - Manage the airshipctl config file * [airshipctl config](airshipctl_config.md) - Airshipctl command to manage airshipctl config file

View File

@ -1,28 +1,26 @@
## airshipctl config set-context ## airshipctl config set-context
Manage contexts Airshipctl command to create/modify context in airshipctl config file
### Synopsis ### Synopsis
Create or modify a context in the airshipctl config files. Creates or modifies context in the airshipctl config file based on the CONTEXT_NAME passed or for the current context
if --current flag is specified. It accepts optional flags which include manifest name and management-config name.
``` ```
airshipctl config set-context NAME [flags] airshipctl config set-context CONTEXT_NAME [flags]
``` ```
### Examples ### Examples
``` ```
# Create a new context named "exampleContext" To create a new context named "exampleContext"
airshipctl config set-context exampleContext \ # airshipctl config set-context exampleContext --manifest=exampleManifest
--manifest=exampleManifest \
# Update the manifest of the current-context To update the manifest of the current-context
airshipctl config set-context \ # airshipctl config set-context --current --manifest=exampleManifest
--current \
--manifest=exampleManifest
``` ```
@ -44,5 +42,5 @@ airshipctl config set-context \
### SEE ALSO ### SEE ALSO
* [airshipctl config](airshipctl_config.md) - Manage the airshipctl config file * [airshipctl config](airshipctl_config.md) - Airshipctl command to manage airshipctl config file

View File

@ -1,24 +1,43 @@
## airshipctl config set-management-config ## airshipctl config set-management-config
Modify an out-of-band management configuration Airshipctl command to create/modify out-of-band management configuration in airshipctl config file
### Synopsis ### Synopsis
Modify an out-of-band management configuration
Creates or modifies management config information based on the MGMT_CONFIG_NAME passed. The allowed set
of optional flags are management-type, system-action-retries and system-reboot-delay. Use --use-proxy
and --insecure to enable proxy and insecure options respectively.
``` ```
airshipctl config set-management-config NAME [flags] airshipctl config set-management-config MGMT_CONFIG_NAME [flags]
```
### Examples
```
Create management configuration
# airshipctl config set-management-config default
Create or update management configuration named "default" with retry and to enable insecure options
# airshipctl config set-management-config default --insecure --system-action-retries 40
Enable proxy for "test" management configuration
# airshipctl config set-management-config test --use-proxy
``` ```
### Options ### Options
``` ```
-h, --help help for set-management-config -h, --help help for set-management-config
--insecure Ignore SSL certificate verification on out-of-band management requests --insecure ignore SSL certificate verification on out-of-band management requests
--management-type string Set the out-of-band management type (default "redfish") --management-type string set the out-of-band management type (default "redfish")
--system-action-retries int Set the number of attempts to poll a host for a status (default 30) --system-action-retries int set the number of attempts to poll a host for a status (default 30)
--system-reboot-delay int Set the number of seconds to wait between power actions (e.g. shutdown, startup) (default 30) --system-reboot-delay int set the number of seconds to wait between power actions (e.g. shutdown, startup) (default 30)
--use-proxy Use the proxy configuration specified in the local environment (default true) --use-proxy use the proxy configuration specified in the local environment (default true)
``` ```
### Options inherited from parent commands ### Options inherited from parent commands
@ -30,5 +49,5 @@ airshipctl config set-management-config NAME [flags]
### SEE ALSO ### SEE ALSO
* [airshipctl config](airshipctl_config.md) - Manage the airshipctl config file * [airshipctl config](airshipctl_config.md) - Airshipctl command to manage airshipctl config file

View File

@ -1,36 +1,32 @@
## airshipctl config set-manifest ## airshipctl config set-manifest
Manage manifests in airship config Airshipctl command to create/modify manifests in airship config
### Synopsis ### Synopsis
Create or modify a manifests in the airshipctl config file. Creates or modifies a manifests in the airshipctl config file based on the MANIFEST_NAME argument passed.
The optional flags that can be passed to the command are repo name, url, branch name, tag name, commit hash,
target-path and metadata-path. Use --force flag to enable force checkout of the repo. And use --phase flag
to enable phase repository.
``` ```
airshipctl config set-manifest NAME [flags] airshipctl config set-manifest MANIFEST_NAME [flags]
``` ```
### Examples ### Examples
``` ```
# Create a new manifest Create a new manifest
airshipctl config set-manifest exampleManifest \ # airshipctl config set-manifest exampleManifest --repo exampleRepo --url https://github.com/site \
--repo exampleRepo \ --branch master --phase --target-path exampleTargetpath
--url https://github.com/site \
--branch master \
--phase \
--target-path exampleTargetpath
# Change the phase repo for manifest Change the phase repo for manifest
airshipctl config set-manifest e2e \ # airshipctl config set-manifest e2e --repo exampleRepo --phase
--repo exampleRepo \
--phase
# Change the target-path for manifest Change the target-path for manifest
airshipctl config set-manifest e2e \ # airshipctl config set-manifest e2e --target-path /tmp/e2e
--target-path /tmp/e2e
``` ```
@ -58,5 +54,5 @@ airshipctl config set-manifest e2e \
### SEE ALSO ### SEE ALSO
* [airshipctl config](airshipctl_config.md) - Manage the airshipctl config file * [airshipctl config](airshipctl_config.md) - Airshipctl command to manage airshipctl config file

View File

@ -1,23 +1,23 @@
## airshipctl config use-context ## airshipctl config use-context
Switch to a different context Airshipctl command to switch to a different context
### Synopsis ### Synopsis
Switch to a different context defined in the airshipctl config file. Switch to a different context defined in the airshipctl config file.
This command doesn't change a context for the kubeconfig file. This command doesn't change the context for the kubeconfig file.
``` ```
airshipctl config use-context NAME [flags] airshipctl config use-context CONTEXT_NAME [flags]
``` ```
### Examples ### Examples
``` ```
# Switch to a context named "exampleContext" in airshipctl config file Switch to a context named "exampleContext" in airshipctl config file
airshipctl config use-context exampleContext # airshipctl config use-context exampleContext
``` ```
@ -36,5 +36,5 @@ airshipctl config use-context exampleContext
### SEE ALSO ### SEE ALSO
* [airshipctl config](airshipctl_config.md) - Manage the airshipctl config file * [airshipctl config](airshipctl_config.md) - Airshipctl command to manage airshipctl config file