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
The command "airshipctl config get-context" will display the name of the contexts as well as the current context name.
Relates-To: #475
Change-Id: I8234d74f6b98869e27e4974a54b68230d8be8565
We don't use clustertype anymore, so all the related functions must
be deleted or adjusted as well as appropriate config fields.
Change-Id: I3931fdc71d4318e916f8bbc2d94e062c9df5f641
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #349
All the config commands was refactored for usage with new config
factory. Config object now is being initialized in pkg module on demand,
which provides more flexibility and cleaner code.
Change-Id: Ibad0985e30c16efa96109a49edf2840c60305df8
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
This changes the `get-credentials` command to `get-credential` to be
uniform with the other config commads. It then adds pluralized aliases
to `get-credential`, `get-cluster`, and `get-context`
Change-Id: Icb5a308f591589f5b68a8ad1c172c3b99ef3a4f1
This commit cleans up the command constructors in an attempt to make the
codebase more uniform and approachable. This includes several refactors:
* Removed the FlagConstants - this makes the help messages and examples
significantly more readable without needed to compile and run
airshipctl
* Long help messages and examples are now constant
* Short, Long, and Examples all begin with a capitol letter
* Flag descriptions begin with a lowercase letter. This matches the flag
description for the builtin "help" flag, making formatting uniform for
all flags
* Removed redundant unit tests on non-leaf commands
This change also updates the documentation for the affected commands.
Change-Id: I8b9dcbfd9846b3deaab06dec17f80643dae78de9
* moving cli helper functions to the respective packages with _helper.
* removed cmds.go within pkg/ dir and added config_helper.go
* In the first commit(https://review.opendev.org/#/c/707216/) commit CLI helper
functions were moved from the cmd/config package to the pkg/config package
* Now we are trying to move the CLI helper functions within their respective packages instead of a command cmds.go.
* Creating and implementing this convention will help us better distinguish library code and CLI helper code
* Added MaxNArgs as 1 for get-credentials and updated test cases
Relates-To: #43
Change-Id: Ibb8139102bd98c6c7596bd97377cf83381cbeb00
This change removes the getters and setters for the following attributes
of pkg/environment.AirshipCTLSettings:
* airshipConfigPath
* kubeConfigPath
* config
The above attributes have been exported to account for the removal of
these methods.
Change-Id: I4e7d38bf6771f7521179a2fe2990475b936b5d95
Fixes possible name collisions between variable names and package names
Remove redundant import naming
Use nil slices for slice declarations instead of empty slices
Use make for slices of fixed lengths
Remove redundant parentheses
Replace deprecated `SetOutput` method with `SetOut`
Fix swapped actual/expected arguments on assertEqualGolden
Change-Id: Ia39ef44372c3e44948e5440575125bdb470898df
This fixes an issue where `airshipctl config get-context` would provide
no output when there were no contexts in the configuration.
Change-Id: I8eaafff8ecee7878f80d22867b0420feba1bf376
This change causes the linter to be a bit more complainy. The hope is
that this will cut down on some of the more pedantic issues being caught
in code reviews, and thus reduce the overall time a change spends in the
review process.
This change includes various changes to the codebase to bring it up to
the new standards.
Change-Id: I570d304bca5554404354f972d8a2743279a0171b
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