247 Commits

Author SHA1 Message Date
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
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
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
Zuul
87c03ba062 Merge "Switch remote direct to airshipctl configuration" 2020-02-10 21:15:17 +00:00
Zuul
29fb7ff3b8 Merge "Extend airshipctl config with remotedirect options" 2020-02-10 21:15:16 +00:00
Zuul
0c4f1658fb Merge "Fix cluster name parsing" 2020-02-10 21:15:16 +00:00
Kostiantyn Kalynovskyi
d9d3eb2f98 Add implementation of document/repo interface
This patch adds methods and repository stucts that will allow easily
clone/pull/update repositories that are defined in config.manifests.

Change-Id: I3789acd79d2072a2b90ed3bbaff99767070334e5
2020-02-10 20:06:14 +00:00
Ian H Pittwood
6cb70e7eb3 [#17] Fixes to airshipctl docs
Various typo fixes in documents

Various grammar and language changes for clarification

Change-Id: I111bf45c90405a26d09a5254733a055c78b47407
2020-02-10 19:25:07 +00:00
Zuul
6e8ca5b010 Merge "Refactor management of config file paths" 2020-02-10 18:39:39 +00:00
Roman Gorshunov
d6eba660f5 Add new nodesets to the gates configuration
Change-Id: Iaee19752fe99cc7f048f72ca2912714e2b7f1146
2020-02-10 17:43:52 +01:00
Dmitry Ukov
97c114cb21 Switch remote direct to airshipctl configuration
Related #7
Change-Id: I015b178895359ea468748eb72e367b4ff56026bb
2020-02-07 22:01:45 +04:00
Dmitry Ukov
8b86e4135f Extend airshipctl config with remotedirect options
Change-Id: I4a08dd671cce88749a6e647a46c2edb38aaf1b58
2020-02-07 21:58:10 +04:00
Dmitry Ukov
a125dc5d8a Fix cluster name parsing
For cluster names that contain underscore ('_') symbol config module
removed some part of the name due to hardcoded indexes after name split

Change-Id: Ibd1e9b3ef2fce7e43cbdf41f4b1852933a253868
2020-02-07 21:58:10 +04:00
Zuul
9a47c9b423 Merge "Add GitHub issue templates" 2020-02-07 17:00:34 +00:00
Ian Howell
32ef58435d Refactor management of config file paths
This change replaces the usage of the clientcmd's PathOptions with a
simpler filepath approach. The handling of the kube config file
associated with airshipctl is now entirely managed by airshipctl.

This also introduces the environment variable AIRSHIP_KUBECONFIG, which
can be used to override the default location for airship's kube config.
It can in turn be overridden by the command line argument.

Prior to this change, the kube config object was created by creating a
kubernetes client, then stripping off that client's config object. As a
side effect, this change removes the middleman, and creates the kube
config object directly from file.

Change-Id: I99ba88d50a0f45c40597a58fe4b3fdfeb7d1467d
2020-02-07 10:57:50 -06:00
Ian H. Pittwood
c7c1011a5c Fix various code style issues
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
2020-02-07 09:28:18 -06:00
Drew Walters
4503669442 Add GitHub issue templates
Airship is migrating from Jira to GitHub issues. This change adds GitHub
issues templates [0] for bug reports and feature requests.

[0] https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository

Change-Id: I696ad7befdd6f5d8f584f0ea14dbfe7182ad6d12
Signed-off-by: Drew Walters <andrew.walters@att.com>
2020-02-06 16:34:31 -06:00
Zuul
cac75584d0 Merge "Fix an output bug in get-context" 2020-02-06 19:11:56 +00:00
Zuul
e959582fa4 Merge "Implement document plugin loader" 2020-02-06 18:27:59 +00:00
Zuul
0e18af5fb3 Merge "Roles to genreate base config and build airshipctl" 2020-02-06 18:27:52 +00:00
Ian H. Pittwood
8a3950d238 Fix typos in variable names and comments
Change-Id: I361916cc18c67e72fbfdbb4b6547f80a5d098327
2020-02-05 16:31:05 -06:00
Kostiantyn Kalynovskyi
16af49c265 Roles to genreate base config and build airshipctl
These roles will allow to generate base airship and kubeconfigs

Change-Id: I8e93dbeaf1aef2f51db5ed9e807f58999ebe97f7
2020-02-05 20:59:20 +00:00
Zuul
9dba7f7744 Merge "Remove extra '-type' from --cluster-type flag" 2020-02-04 21:56:50 +00:00
Ian Howell
cfb90f443e Remove extra '-type' from --cluster-type flag
Change-Id: I8340ba5fcf60f73bc12b82e004436339e2365a78
2020-02-04 13:50:04 -06:00
Rodolfo Pacheco
36a302fce1 Introduces config cmd's for set-credentials and get-credentials
to manage authentication information for clusters.

Includes username/password, certificate
and token options.

Change-Id: If95e5bbf5c3ddc4732465e81de407d5ad416e8f2
2020-02-04 13:01:19 -05:00
Kostiantyn Kalynovskyi
8c6ebb66d9 [AIR-203] add airshipctl config init subcommand
This commit is only base for future implementation

Change-Id: I3cfb3508de04d0a717245a75b5b197fda68fd01c
2020-01-28 17:16:11 +00:00
Ian Howell
73f9eb383b Fix an output bug in get-context
This fixes an issue where `airshipctl config get-context` would provide
no output when there were no contexts in the configuration.

Change-Id: I8eaafff8ecee7878f80d22867b0420feba1bf376
2020-01-27 12:08:34 -06:00
Zuul
0528b76b9c Merge "Remove a redundant null check" 2020-01-23 19:45:02 +00:00
Zuul
3a3d0ae90c Merge "Fix config clusters index in CurrentContextCluster()" 2020-01-23 19:45:01 +00:00
Ian Howell
ee723a9983 Remove a redundant null check
This null check is no longer necessary, since manifest is guaranteed to
be non-null by the prior call to globalConf.CurrentContextBootstrapInfo

Change-Id: Ibec4eb7b7b993af39055d73861b5cf5c157c12a5
2020-01-23 10:48:58 -06:00
Ian Howell
f0a14cb4fd Add missing Manifest validations to EnsureComplete
The EnsureComplete method needs to perform various validations on a
Config object. This commit adds the missing validations for Manifests.

Change-Id: Ib562a67eefbbf19eb64444c4a811d946a9c8e170
2020-01-23 13:05:22 +04:00
Dmitry Ukov
7089223607 Move configuration errors to config module
Change-Id: I878ba176f72db3dba587478f17290991b0f5b3d3
2020-01-23 13:05:17 +04:00
Dmitry Ukov
48e14c3b55 [AIR-195] Extend config with isogen options
Change-Id: Ibde769336b955d450105c928e2be707327273879
2020-01-23 13:03:42 +04:00
Dmitry Ukov
b1361e05f8 Implement document plugin loader
Loader associated with Unknown type of a transformer kustomize plugin
and considered 'builtin'. Kustomize plugin system executes Config and
Transform method of builtin plugins. Therefore appropriate methods
of the document plugin loaders are executed as well. Main goal for
airship document plugin loaded is to determine desired aitship plugin
based on Kind field and execute its Config or Transform methods

Change-Id: Ic26a880570491ac3a59f2357ed455a2a7362387b
2020-01-21 10:25:57 +00:00
Dmitry Ukov
34cca34796 Fix NewBundle error return
Defer is executed at the very end of a functions. If we have named
return paramteters Cleanp() function will overwrite function result.
So if 'err' is not 'nil' Clenup() will overwrite 'err' with 'nil'

Change-Id: I97bbce53be26281515a287b513a3727aa199260d
2020-01-21 14:23:31 +04:00
Matt McEuen
d0ca82d624 Fix config clusters index in CurrentContextCluster()
Config.Clusters should be indexed only by "simple" cluster names
(without _ephemeral or _target postfixes).  This fixes an index
that indexed by the "full" cluster name defined in the kubeconfig,
in some cases resulting in a nil pointer dereference.

Change-Id: Ic7a4b46419354d5755ccea58ff73c5fbbc4d9658
2020-01-17 17:52:54 -06:00
Zuul
e2297e429d Merge "Fix flag loading order" 2020-01-16 15:55:22 +00:00
Ian Howell
51b1e86ad9 Fix flag loading order
Prior to this change, flags associated with the Config object were being
read too early (that is, before cobra had parsed them). They are now
read just in time for command execution.

Change-Id: I0affca9429867eb25db40f8323403e0f6976b47b
2020-01-15 13:04:16 -06:00
Ian Howell
1b8a965105 Add a simple whitespace linter
The goimports tool does not check for trailing whitespaces in multiline
strings. This commit adds a simple linter to address this deficiency.

This change will also have the benefit of providing light linting of any
non-go files.

Change-Id: I253dd7c4895f476fa3a6f0c4fccf7c9cada16366
2020-01-15 10:57:44 -06:00
Alexander Hughes
a8cc7ed2bf Update redfish module URL
Change-Id: I2fe1c8dc47a260cf17712ba72fae436e4ddf5da0
2020-01-14 16:03:04 -05:00
Zuul
c13f779fa8 Merge "Tighten the restrictions of the linter" 2020-01-13 19:57:32 +00:00
Ian Howell
49027f4151 Tighten the restrictions of the linter
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
2020-01-10 14:54:34 -06:00
Ian H. Pittwood
b8a2bb3b27 Updates to Makefile
Implements `make docs` command to create rtd-themed docs using Sphinx
from the existing Markdown documents in the docs directory.

Changes the `get-modules` command to `depend` to more closely match
OpenStack guidelines in [0].

Adds `fmt` command as specified in [0], currently referencing the `lint`
command.

Adds `godoc` command that will host a local godoc server instance with a
link directly to airshipctl technical documentation.

Adds `releasenotes` commands specified in [0], currently
noted as "TODO".

Adds `images` command as found in other Airship projects, referencing
`docker-image`.

[0] https://governance.openstack.org/tc/reference/pti/golang.html

Change-Id: I134fc2c2714bce6d23dc9cf8b86c3016d68def7e
2020-01-10 09:20:10 -06:00