Now that --current-context is removed for set-context, removing all
references of --current-context for set-context in test cases.
Change-Id: Ib77a8dba4a245c61d1d6c057561b0f6983d80cd3
This commit adds the utility testing function TempDir, which provides a
tester with a temporary directory as well as a means of cleaning up that
directory. The new function is implemented everywhere that makes sense
throughout the code base.
This also cleans up the directories left behind by go-git's testing
fixtures.
Some light refactoring was also performed in this change.
Change-Id: I754484934660487140f57671bacb5463cf669e3e
This change adds the Airship logo to our documentation.
Change-Id: Ie3d068eea2e3545fa38f35f6f7a1e1869360ffac
Signed-off-by: Drew Walters <andrew.walters@att.com>
This change introduces a job to build airshipctl documentation and
publish a preview for each new PS.
Related #59
Change-Id: I741c59f2c1dc50e66bf3cacfc8cb385ec9ec223d
Signed-off-by: Drew Walters <andrew.walters@att.com>
OpenDev publishes Ansible roles that enable documentation previews.
These roles expect an html or pdf directory in the Sphinx build dir.
This change updates the documentation output directory to the
doc/build/html so documentation previews are available on each PS.
Related #59
Change-Id: I0853f603b6bc147e7fc33834b5d195c16f71d5ab
Signed-off-by: Drew Walters <andrew.walters@att.com>
Most systems have /usr/bin/python, the interpreter the airshipctl
Makefile uses to build documentation, linked to an end-of-life
interpreter. This change updates the Makefile to use the Python 3
interpreter.
Related #59
Change-Id: I19b4d623a5a76dc455184bac2f54d8bfe0947530
Signed-off-by: Drew Walters <andrew.walters@att.com>
Now document labeling would allow to have same document to be deployed
to different clusters, ephemeral or target at the same type.
Change-Id: Ia1bb618c322c19c4db3c47b3d19c630b61125f5c
Executing "airshipctl config set-context [NAME]" misleadingly prints a
message saying the context has been modified, but doesn't change to that
context or modify any context values. This change modifies the behavior
of context command to switch to a provided context when no flags are
specified. It also removes the current-context flag, which becomes
redundant with this change.
Change-Id: I2622fbf59539513feb1236f13b9090978aeb81ef
Signed-off-by: Drew Walters <andrew.walters@att.com>
This change introduces logic for the config init subcommand, which
generates an airshipctl configuration file with default values. The
default values are extracted from constants and change when the source
code is updated.
Closes #6
Change-Id: I452e26bc5a924f0cdcd3153a9b124d23e2e5b1f0
Signed-off-by: Drew Walters <andrew.walters@att.com>
Test directories in Airship have subdirectories now, so removing them
with os.Remove() will cause tests to fail. This change updates the
cleanup logic to use os.RemoveAll() for directories with children.
Change-Id: I1e03cd0335fc1a30610e06d50a701db2b1b571c9
Signed-off-by: Drew Walters <andrew.walters@att.com>
This changes the output of the get-cluster, get-context, and
get-credentials subcommands to be uniform across multiple runs of the
program. This allows for predictable output for users and a controlled
environment for testing.
Change-Id: If87ec50b9d65750565a204514d6b647be64bb30d
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
This change adds a voting job that builds the airshipctl docker image on
each patch set. The same job will be updated in a later commit to
publish the image to the quay.io/airshipit/airshipctl repository.
Related #33
Change-Id: I202da62c77ec277312518fead09f0f3ef32ccde8
Signed-off-by: Drew Walters <andrew.walters@att.com>
This change mainly solves an issue with module import dependency loop
which may happen if add "config" module import inside "document"
module. In other words:
before commit: config(config_test.go) -> testutil(testdatafs.go) ->
-> document (will lead to error if one imports config here)
now: config_test(config_test.go) -> testutil(testdatafs.go) ->
-> document
Closes: #47
Change-Id: Id7d1e0dceb268ff455eec6e2d9fb65a5ab4e54ff
Changes is needed because we can not make dependencies on PRs from
other repositories such as zuul-airship-roles, this would allow more
robust development in the stage we currently are in. When there will
be less activity on gating roles will be moved back to separate repo.
Change-Id: I85c9bdd47b5aaba90df5458b20c90ff5c912c05f
Adds a triage label by default to the issue templates for project
maintainers to identify new issues that still need to be evaluated,
labeled, and addressed.
Change-Id: I9508cce273e7834ccff5eb77c0dd6a1e028dc299
Changes links from Jira to GitHub Issues.
Adds additional information on GitHub Issue workflows, guidelines for
submitting changes, and links to review boards.
Change-Id: I9af8208807f2f0f084a65ca6882f8105f8bca0fa
Ideally, installing and using an external tool should not modify the
go.mod or go.sum files in anyway. Unfortunately, this may not be
completely possible until Go1.14
(https://github.com/golang/go/issues/30515). This change prevents the
godoc target from modifying the go.mod file, though there may still be
anomalies with modifying the go.sum file (e.g. this change).
Further, since the godoc tool defaults to -goroot=$(go env GOROOT), it
doesn't make sense to provide a default value for -goroot, as it may not
be what the user has set as $(go env GOROOT)
Change-Id: I92de6bf8af4c00464b857db363bd07fdb55ee143
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
Commands using cobra's ExactArgs feature previously did not have any
validation that the ExactArgs was being enforced. This patchset adds
tests to ensure that in the cases ExactArgs=n, that only n args are
accepted, and other values such as x or y throw an appropriate error.
Change-Id: I27b5774e79db51e0e9bc81d8c207be80811ba459
In the completion command validation was being done at runtime to
determine if too many or too few args were being passed in. This
approach required extra unit tests to validate the behavior.
This patch seeks to streamline the code by specifying the number of
args expected when initializing the cobra command, and allowing cobra
to throw an error before doing any work in go if the number of args is
incorrect.
As a result the unit tests for too many and too few args are no longer
needed for this package and have been removed.
Change-Id: If0cf043713ef08333f17b010210352205d74c4ee