Current modified go code, generates RsT files for each airshipctl
cmd and places them in a folder specific to the airshipctl subcommand.
It also generates the index.rst file for the specific airshipctl
subcommand folders. These generated rst files are appropriate to sphinx,
so that they can be easliy rendered in docs.airshipit.org
Steps to render the document locally
* Install sphinx: python3 -m pip install sphinx
* Clone airshipctl: git clone https://github.com/airshipit/airshipctl.git
* Download current PS: cd airshipctl; git fetch "https://review.opendev.org/airship/airshipctl" refs/changes/50/789250/2 && git checkout -b change-789250-1 FETCH_HEAD
* Build sphinx html pages: cd docs/source; sphinx-build -b html . _build
* Run local server: cd _build; python3 -m http.server
* Open URL to access the page: http://localhost:8000/ navigate to commands section access the document
Relates-To: #280
Change-Id: Ifa1dafc7b296014cc826072ac2c52f4488421352
This PS updates cmd related to root, completion, document and
version subcommands. It also updates minor details in other
subcommands.
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: I562c15c0d25b2e9731c0eb03854d1d348eb435f2
AirshipCTLSettings will no longer be used by any command, so this
patch removes it from root level.
Change-Id: I2aa1d80ab0785b498af1ac2c86334f9b0d9ff047
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
This command 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: Iff75eb66db2fee922e6db1bf2930892c02c3b601
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
As part of config refactoring process, we should remove debug field
from AirshipCTLSettings structure since debug variable is stored in
log module.
Change-Id: I02f3c7160ed0301605de32e0d0267be8524ccc12
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
AirshipCTLSettings are not used here, so it was removed.
Change-Id: If4bf64b9991b4ac05898632c79bacbacd7872635
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
This patch refactors some code and adds useful debug/info log output.
Change-Id: I590f6e5c300e5c91443af0a8fdb1073229602a67
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #278
Change 725820 [1] configured airshipctl to fail an airship config file
isn't present. The present change makes an exception to that behavior
for the document plugin subcommand, and moves the plugin loading from
the parent document command into the pull subcommand.
There are multiple reasons we don't want config enforcement in place for plugins:
- If a non-standard config file location is configured via an environment variable,
the plugin won't know about it (since it's invoked separately by kustomize), and it
would look for a potentially non-existant default config file, and fail.
- If a user is using the kustomize cli by hand along with airshipctl plugins
(as opposed to driving the process via airshipctl itself), then they do not
need the config anyway -- the plugin subcommand doesn't actually use it.
Forcing the user to create a config file seems awkward here.
[1]: https://review.opendev.org/#/c/725820/16
Change-Id: Ic1b652efb14439ed2757eb9fb0a86feb8b3ef21c
There are several commands which do not require to load config:
completion, help, secret, version. Hovewer, PersistentPreRun call
at root level forces airshipctl to load config anyway. Therefore,
we can observe unnecessary config load errors instead of actual result.
This patch moves config load to subcommand level where it is necessary.
Change-Id: I774a7d038c408e71688f7bf04f1cb87a2132a342
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
airship document plugin is intended to be executed as an exec plugin
for kustomize document model.
Environment variable is used to gather plugin configuration. Plugin to
execute is determined based on group-version-kind specified in plugin
configuration. Each airship plugin must implement plugin interface.
Relates-To: #173
Change-Id: I4f6c3b5be140c0d8fd7519f1cedd33de1cef662c
* added license templates for go, bash & yaml in tools dir
* added a script that will add license information for all
missing files. Type: go, yaml, yml, sh
* skip adding license for all files within testdata
* Syntax:
> ./tools/add_license.sh
* Skip license for manifests folder
* Added one extra line after licene for yaml files
* Added License after Hashbang for bash.
* Add an extra line after hashbang and before license
* Updated the go template to use multiline comments
New Files:
1. tools/add_license.sh
2. tools/license_go.txt
3. tools/license_yaml.txt
4. tools/license_bash.txt
Change-Id: Ia4da5b261e7cd518d446896b72c810421877472a
Realtes-To:#147
Future use of secrets will be clunky if it remains as a document
subcommand ex: airshipctl document secret generate materpassphrase
Refactoring so that secrets are now a top level command IE
airshipctl secret ...
Change-Id: I781ef5a4e32dc971f275f758d82d17cedd0f74af
Signed-off-by: Alexander Hughes <Alexander.Hughes@pm.me>
A number of items were identified by GoLand's code inspection as
being unused. These are being removed in this change.
Change-Id: I0c8c0b5f5c33f2e715f991a02ddd63174758c533
Signed-off-by: Alexander Hughes <Alexander.Hughes@pm.me>
Render command filters documents and prints them to user-defined
output in a form of multi-document YAML.
Sub-command receives following document filter flags:
* label
* annotation
* apiVersion (a.k.a group-version)
* kind
* filter
Related: #16
Change-Id: I7efb0a478e1070efd1791ab10d7c3946c8c28630
Adds `airshipctl document pull` command that will check the current
manifest specified by the config and download it to the config specified
target path.
Change-Id: I493564c056225ff1e19f5d1aecb8c187683529ec
This adds the "airshipctl document" tree of commands, as well as one of
its leaf commands, "generate masterpassphrase".
Change-Id: I2365ebe67b38ebbbe4873c6e1beb6407f0e000eb