Introduces set_context and get_context operations

Each of these include an option for --current-context that set or retrieves
the curret context

This patchset mainly creates the cmd/config and pkg/config require additions

Also includes a fync getCurrentContext(<CLUSTERTYPE>)  in the config pkg
that other modules should rely on.

Introduces new  ErrMissingConfig and  ErrConfigFailed types been used by
set-context, will decimate through get/ and set/get cluster after this is
reviewed.

Change-Id: I501483a9db99f33f860eaf329a65bb0209b2aaff
This commit is contained in:
Rodolfo Pacheco
2019-12-04 17:19:06 -05:00
parent 8dd721830b
commit a480527808
25 changed files with 968 additions and 35 deletions

View File

@@ -5,9 +5,11 @@ Usage:
config [command]
Available Commands:
get-cluster Display a specific cluster
get-cluster Display a specific cluster or all defined clusters if no name is provided
get-context Display a specific context, the current-context or all defined contexts if no name is provided
help Help about any command
set-cluster Sets a cluster entry in the airshipctl config
set-context Sets a context entry or updates current-context in the airshipctl config
Flags:
-h, --help help for config

View File

@@ -5,9 +5,11 @@ Usage:
config [command]
Available Commands:
get-cluster Display a specific cluster
get-cluster Display a specific cluster or all defined clusters if no name is provided
get-context Display a specific context, the current-context or all defined contexts if no name is provided
help Help about any command
set-cluster Sets a cluster entry in the airshipctl config
set-context Sets a context entry or updates current-context in the airshipctl config
Flags:
-h, --help help for config