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