288 Commits

Author SHA1 Message Date
Yasin, Siraj (SY495P)
70eb76e608 [#51] - removing --current-context for set-context
Now that --current-context is removed for set-context, removing all
references of --current-context for set-context in test cases.

Change-Id: Ib77a8dba4a245c61d1d6c057561b0f6983d80cd3
2020-02-21 13:44:47 +00:00
Zuul
5876eeaaa6 Merge "[#59] Add Airship logo to docs" 2020-02-20 19:41:54 +00:00
Zuul
fde57977ae Merge "[#59] Add documentation build gate" 2020-02-20 19:41:54 +00:00
Zuul
b6910f8aed Merge "[#59] Publish documentation output to html dir" 2020-02-20 19:41:53 +00:00
Zuul
76963067f8 Merge "[#59] Build docs with Python 3" 2020-02-20 19:15:04 +00:00
Zuul
45adf6ec75 Merge "[#42] Refactor flag operations to be uniform" 2020-02-20 18:52:08 +00:00
Ian Howell
091fa09a23 [#50] Clean up temp files from unit tests
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
2020-02-20 11:48:11 -06:00
Drew Walters
d902cb98e3 [#59] Add Airship logo to docs
This change adds the Airship logo to our documentation.

Change-Id: Ie3d068eea2e3545fa38f35f6f7a1e1869360ffac
Signed-off-by: Drew Walters <andrew.walters@att.com>
2020-02-20 11:33:24 -06:00
Ian Howell
dc0979b65b [#42] Refactor flag operations to be uniform
This also increases unit test coverage

Change-Id: I324954a1216f2204ff3977c05eb9bd087cd87795
2020-02-20 11:25:41 -06:00
Drew Walters
86ae398e20 [#59] Add documentation build gate
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>
2020-02-20 11:21:26 -06:00
Drew Walters
c834b2d22f [#59] Publish documentation output to html dir
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>
2020-02-20 11:21:04 -06:00
Drew Walters
3a5f25c22e [#59] Build docs with Python 3
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>
2020-02-20 10:16:47 -06:00
Zuul
94deadd7b1 Merge "Change document labeling" 2020-02-20 15:22:40 +00:00
Kostiantyn Kalynovskyi
ca0ecbd3ab Change document labeling
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
2020-02-19 20:51:21 +00:00
Ian Howell
855fecc45e [#53] Disable the dupl linter
dupl produces too many false positives to continue to be useful. This
change disables it.

Change-Id: I696160890b0a69aacb28977dfee268f14d3c6c20
2020-02-19 14:04:22 -06:00
Zuul
24542ca8bc Merge "[#51] Remove current-context flag" 2020-02-19 07:35:35 +00:00
Zuul
6c3fa7f28a Merge "Add render sub-command frame" 2020-02-18 19:46:23 +00:00
Zuul
ea03924dfd Merge "[#6] Add config init subcommand" 2020-02-18 19:10:55 +00:00
Drew Walters
18d6e2ac29 [#51] Remove current-context flag
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>
2020-02-18 13:06:37 -06:00
Zuul
f2987e1a8c Merge "[#41] Update make godoc target" 2020-02-18 18:32:28 +00:00
Drew Walters
5d83122b17 [#6] Add config init subcommand
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>
2020-02-17 16:22:10 -06:00
Drew Walters
f8a9a471d3 Use RemoveAll to cleanup test directories
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>
2020-02-17 16:22:09 -06:00
Ian H Pittwood
90f025e64d Remove remote dependency for pull_test.go
Change-Id: I158ade3b7987d3c2f2b57a616a200a210517e24a
2020-02-17 15:49:27 -06:00
Ian Howell
46f5c63ccd [#48] Make output from config get-* uniform
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
2020-02-17 12:22:06 -06:00
Zuul
f4e75e2152 Merge "[#47] Switch config module to black box testing" 2020-02-17 17:15:17 +00:00
Dmitry Ukov
ff917e5a49 Add render sub-command frame
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
2020-02-17 11:27:22 +00:00
Drew Walters
5aebf87fc2 [#33] Add image build gate
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>
2020-02-14 10:17:15 -06:00
Dmitry Ukov
317a5a4287 [#47] Switch config module to black box testing
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
2020-02-14 11:25:04 +04:00
Zuul
d6811316a1 Merge "[#27] Move execution logic from cmd to pkg" 2020-02-14 06:04:06 +00:00
Zuul
b1b4ff6bc7 Merge "Moving roles from zuul-airship-roles." 2020-02-13 21:11:29 +00:00
Zuul
f847dc9fea Merge "add role to collect airship config directory" 2020-02-13 20:18:00 +00:00
Zuul
baeabb4b3b Merge "[#13] Add document pull command" 2020-02-13 12:03:17 +00:00
Zuul
7732c9f9f4 Merge "[#12] Implement RedfishConfigError interface" 2020-02-13 09:46:36 +00:00
Kostiantyn Kalynovskyi
d7df2fb571 Moving roles from zuul-airship-roles.
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
2020-02-12 22:52:17 +00:00
Zuul
e11a6dcf16 Merge "[#37] Change issue tracker info to GitHub Issues" 2020-02-12 21:43:09 +00:00
Alexander Hughes
7bfdea075e [#12] Implement RedfishConfigError interface
Implement RedfishConfigError
Rename RedfishConfigError to follow airship norms IE ErrRedfish...
Update unit tests

Change-Id: I49051315460b5d261186f32bae6101a752740eae
2020-02-12 21:29:58 +00:00
Ian H. Pittwood
22bb19eaca Adds triage label to issue templates
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
2020-02-12 13:55:38 -06:00
Ian H. Pittwood
c0684561b9 [#37] Change issue tracker info to GitHub Issues
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
2020-02-12 11:13:14 -06:00
Ian Howell
9d72a01fc3 [#41] Update make godoc target
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
2020-02-12 11:06:10 -06:00
Ian H. Pittwood
7437bb2972 [#13] Add document pull command
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
2020-02-12 11:01:11 -06:00
Zuul
1399c569f4 Merge "[#34] Add tests to commands expecting N args" 2020-02-12 14:41:12 +00:00
Zuul
ad9ee69cce Merge "Add implementation of document/repo interface" 2020-02-12 14:41:12 +00:00
Alexander Hughes
8f27532ce0 [#34] Add tests to commands expecting N args
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
2020-02-12 14:11:30 +00:00
Zuul
70daee6d3c Merge "[#17] Fixes to airshipctl docs" 2020-02-12 07:58:49 +00:00
Zuul
ec6d1e408b Merge "[#10] Perform early validation of completion cmd" 2020-02-12 07:48:06 +00:00
Zuul
07784ce97a Merge "[#28] Fix bad defaults for config file paths." 2020-02-12 07:45:27 +00:00
Ian H. Pittwood
69b37c15b8 [#27] Move execution logic from cmd to pkg
Moves all execution logic from cmd/config to pkg/config.

Adds tests for moved execution logic.

Change-Id: I6381c9fe9eeba938e855bf7d7ea52cd22a5c08b6
2020-02-11 15:33:47 -06:00
Alexander Hughes
c7f42bfcf4 [#10] Perform early validation of completion cmd
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
2020-02-11 18:44:05 +00:00
Zuul
dae73126e9 Merge "Add new nodesets to the gates configuration" 2020-02-11 15:12:31 +00:00
Ian Howell
e42049919e [#28] Fix bad defaults for config file paths.
This moves the management of default file paths away from pflag and
into airshipctl.

Change-Id: Ib2f701d727fdd28794980cf44722d3147d4e6f07
2020-02-10 16:25:43 -06:00