224 Commits

Author SHA1 Message Date
Nikolay Fedorov
d10ad53ef5 Add Cluster API controller
Change-Id: I4dc45689e5d4c1df5b1910122794b7b400044ede
2020-02-13 16:50:54 +04: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
Kostiantyn Kalynovskyi
b43e4e4fea Add abstraction to git repositories
This can be used to pull documents from git repositories defined
by config module in manifest

Change-Id: Ib25cd7e263b6de56bc107607c081e2b02281b8b5
2020-01-08 19:43:59 +00:00
Zuul
7359327a20 Merge "Introduces set_context and get_context operations Each of these include an option for --current-context that set or retrieves the curret context" 2020-01-08 19:10:14 +00:00
Rodolfo Pacheco
a480527808 Introduces set_context and get_context operations
Each of these include an option for --current-context that set or retrieves
the curret context

This patchset mainly creates the cmd/config and pkg/config require additions

Also includes a fync getCurrentContext(<CLUSTERTYPE>)  in the config pkg
that other modules should rely on.

Introduces new  ErrMissingConfig and  ErrConfigFailed types been used by
set-context, will decimate through get/ and set/get cluster after this is
reviewed.

Change-Id: I501483a9db99f33f860eaf329a65bb0209b2aaff
2020-01-08 11:46:16 -05:00
Alexander Hughes
960e816c23 Minor document fixes
- Links to CONTRIBUTORS.md and testing-guidelines.md were broken.
- Minor fix to escaping of the (c) bulletpoint in contribution
  guidelines.

Change-Id: Iffb5233b50008a4e4e4fd17be483d7e8c1ee4856
2020-01-03 16:36:56 +00:00
Zuul
d9e18f78ff Merge "Fix redfish reboot logic" 2020-01-02 22:59:20 +00:00
Zuul
f0ed121539 Merge "Fix deprecated field in linter config" 2020-01-02 17:31:09 +00:00
Ian H. Pittwood
5b7de06eec Add proxy options to Makefile docker build
Adds options relating to proxy settings in the Makefile to be used
during the execution of docker build. The settings are optional to be
used and are set up similarly to other Airship projects such as [0] and
[1].

To set proxy settings during docker build, execute the command as
follows:

```
make docker-image \
  -e PROXY=<The proxy URL> \
  -e NO_PROXY=<comma-separated list of URLs/IPs not using the proxy> \
  -e USE_PROXY=true
```

[0] https://opendev.org/airship/pegleg/src/branch/master/Makefile
[1] https://opendev.org/airship/promenade/src/branch/master/Makefile

Change-Id: I92258465d9638b40797d38ba5d8b835fc38df23f
2019-12-19 18:22:41 +00:00
Alexander Hughes
358a7e9882 Minor documentation cleanup
This patch makes minor documentation fixes:
1. Wording of make images
2. Document rendering of bullet point c instead of a copyright symbol
3. Fix broken link for contributing docs
4. Use https for quay link instead of http
5. Limit line lengths to 80 characters

Change-Id: I8c6d339251e454b357d6eaeb125b925c209e8577
2019-12-16 09:48:04 -06:00
Zuul
8ee4c68547 Merge "Move all error structs to common package 'errors'" 2019-12-10 16:16:24 +00:00
Ian Howell
4f91de6e24 Fix deprecated field in linter config
The `deadline` field was deprecated in v1.21.0 of the linter in favor of
`timeout`

Change-Id: I543930d522311fa3e41c14d55624703bbc4e2b99
2019-12-06 15:48:53 -06:00
Ian Howell
3e08db66bd Fix testing-guidelines.md link
Change-Id: I644235c09935b4d55edad2587e448dd96715ad13
2019-12-06 15:23:37 -06:00
Dmitry Ukov
ca08fec157 Fix redfish reboot logic
Power On commnad was not sent due to wrong logic around
ScreenRedfishError function.

Change-Id: Iec39c49ddf7c4df8fed16fdfe06828513692abad
2019-12-04 08:59:48 +00:00
Dmitry Ukov
c1ed28fd25 Move all error structs to common package 'errors'
Change-Id: I91e9610b27244fe5d7500575eae24647e256dab8
2019-12-01 14:14:09 +04:00
Ian Howell
8dd721830b Create a new test object for each redfish unittest
This removes the SampleSystem testing variable and replaces it by a
function which generates the object. This guarantees that the test
system has the same initial configuration for each test regardless of
the order in which tests are run.

Change-Id: I9875723ac4194425674c2806cf099509f94ad771
2019-11-20 13:58:36 -06:00
Zuul
013d814a93 Merge "Utilize Docker caching to speed up image building" 2019-11-20 15:01:41 +00:00
Ian Howell
e3ca393d9e Utilize Docker caching to speed up image building
This rearranges the Dockerfile to COPY over the go module files for
downloading prior to building, linting, and testing. This will allow
developers to more quickly test their code via Docker given that their
dependencies change infrequently.

Change-Id: I3650fbd9ca18d453921d25a536e8b4cf60ce1b5e
2019-11-19 14:00:01 -06:00
Zuul
6fb756eec5 Merge "Minor README formatting fixes" 2019-11-19 15:14:45 +00:00
Zuul
9284d92b63 Merge "Bump kubernetes 1.16.3 as a main dependency" 2019-11-19 14:37:37 +00:00
Zuul
98b1f6ae57 Merge "Add make tidy to check for up-to-date go.mod" 2019-11-19 14:37:36 +00:00
Roman Gorshunov
819f4cc8fc Minor README formatting fixes
Adjust internal links to be relative to repository root, and change github
link to opendev link as project is hosted on opendev.org.

Change-Id: Icb5e3a378d600d087d6d97200d2c355d8619dc09
2019-11-19 08:20:01 +01:00
Alan Meadows
0b805a2bd6 Correct README link to developer documentation
Change-Id: Idb51b9170fc0516f899cf499d7dcd82bcb1b42c9
2019-11-18 17:04:37 -08:00
Zuul
94060af0fb Merge "Update README with a more accurate project description" 2019-11-19 00:46:23 +00:00
Alan Meadows
87f48407a7 Update README with a more accurate project description
Change-Id: I805a569c3624e30862dbba4b613aa9b683af54a3
2019-11-18 15:56:40 -08:00