449 Commits

Author SHA1 Message Date
Kostiantyn Kalynovskyi
7a2d01789e Add ordering of the documents
By default kustomize cli orders k8s resources, in a way, that they
can easily by applied to cluster, namespaces and crds first. In this
patch set we implementing same behavior

Relates-To: #131
Closes: #131

Change-Id: I4fc75366627ed361ac1da48e89a35949bcb79801
2020-03-26 09:54:42 -05:00
Zuul
423d75400e Merge "Fix airshipctl image publish" 2020-03-25 21:49:58 +00:00
Matt McEuen
ef33f672a3 Fix airshipctl image publish
Resolve the following error when logging into the remote docker registry.

Failed to import the required Python library (Docker SDK for Python:
docker (Python >= 2.7) or docker-py (Python 2.6)) on
ubuntu-bionic-rax-dfw-0015461365's Python /usr/bin/python3.
Please read module documentation and install in the appropriate
location, for example via `pip install docker` or `pip install docker-py`
(Python 2.6). The error was: No module named 'docker'

Change-Id: I0df7e58aae886dfa3901815a60853e47c98b5e90
2020-03-25 16:21:16 -05:00
Alan Meadows
69fefba69f Remove label filtering from initinfra
Now that initinfra leverages a specific entrypoint using
the cluster type, and the Config.Initinfra subdirectory
there is no need to also require all documents be labeled
with a specific label.  That would be redundant.

Change-Id: I41ff1ea01d5f04d7d987d2308636adfff48016ea
2020-03-25 10:47:20 -07:00
Zuul
66a1332ce9 Merge "Ensure node power state ON/OFF for Reset command" 2020-03-25 13:34:56 +00:00
Zuul
14f52863e0 Merge "Add filtering method for document bundle" 2020-03-25 13:29:14 +00:00
Pavel Basov
af90464e66 Add selector to filter initinfra docs
airpship.org/phase: "initinfra" labeled documents are deployed with initinfra

Change-Id: Ie4c9421b9c4b3fe44e20a843f7a3b6551c5a7e6d
Closes: #125
2020-03-24 20:51:59 +01:00
Dmitry Ukov
09ef460e31 Add filtering method for document bundle
SelectByFieldValue method returns new bundle with documents which
values referenced by JSON path comply with function passed as input
argument to the method

Related: #14
Change-Id: I31bb6beee96b0d65719b6976caac63e54c65dcd2
2020-03-24 23:23:58 +04:00
Kostiantyn Kalynovskyi
ea3c6a626b Fix wrong buffer dirrectory for kubectl interface
Change-Id: I0b82be7fe16943f15f87a570eb724476582b51a6
Relates-To: #126
Closes: #126
2020-03-24 11:58:17 -05:00
Zuul
db6217f011 Merge "Standardize KubeConfig variables" 2020-03-24 16:05:07 +00:00
Zuul
b05114514e Merge "Add the dynamic kubernetes client" 2020-03-24 16:05:07 +00:00
Zuul
58ebba43f6 Merge "Update network data format" 2020-03-24 15:57:45 +00:00
Zuul
c803763c2f Merge "Shift CAPI function to upstream implementation" 2020-03-24 14:35:42 +00:00
Alexander Hughes
6832164372 Standardize KubeConfig variables
Settings variable, function names, and comments inconsistently use
either Kubeconfig, KubeconfigPath or KubeConfigPath capitalizations.

This is a minor refactor to consistently use the KubeConfig
capitalization variants.

Relates-To: #124

Change-Id: Iaece6683931164ccaa213f4f3385de9c077d26b7
Signed-off-by: Alexander Hughes <Alexander.Hughes@pm.me>
2020-03-24 08:31:47 -04:00
Ian Howell
ea9fba7278 Add the dynamic kubernetes client
The dynamic client will be needed to interact with any custom resource
that airshipctl doesn't know about. It will be required for checking the
health of a cluster, as well as any other operations that may need to be
performed on generic objects.

This also adds the pkg/k8s/client/fake package, which can be used to
create a mock instance of a client for use in unit tests.

Change-Id: Ia331ff4875a067045f6f9245daee109126fb1d33
Relates-To: #73
Relates-To: #20
2020-03-23 16:24:04 -05:00
Sreejith Punnapuzha
d39e490f06 [#106] Add docker install role
This PS adds role which installs docker

Depends-On: https://review.opendev.org/#/c/714109/

Change-Id: I2d114fbb8bd93f88bd9526529e985f92125dc428
Signed-off-by: Sreejith Punnapuzha <sreejith.punnapuzha@outlook.com>
2020-03-23 15:25:15 -05:00
Dmitry Ukov
5f1b3f4198 Update network data format
Metal3 supports only network_data.json (converted to yaml) format.
Ephemeral node should also be configured using this format

Relates-To: #120
Change-Id: I46380a0fd708c0bc260d355545b27fd007885de6
2020-03-23 11:27:35 +00:00
Dmitry Ukov
7df1237ac7 Shift CAPI function to upstream implementation
Cluster API function documents are handled by its community and should be
used as an external dependency for Airship document model. This change
will bring CAPI manifests maintenance to Cluster API git repo tag
management inside of an appropriate functions

Change-Id: I31acb3de7f3ae339ab0b9a48a37df09eb694bdb7
Relates-To: #104
Relates-To: #121
2020-03-23 13:34:38 +04:00
Zuul
b2a602fa07 Merge "Revert "[#89] Gather container logs in check pipeline"" 2020-03-19 21:36:30 +00:00
Roman Gorshunov
a8c91a7c40 Revert "[#89] Gather container logs in check pipeline"
This reverts commit 5c5ff8b46f254c5004bbf20b9b7da4933d476b58.

Logs are not being collected under artifacts section of Zuul.
Container logs collector patch set 712555 needs further work.

Change-Id: If8703812cf101506de2808365dfee6c032a0f35f
2020-03-19 15:26:58 +00:00
Zuul
906c2b2ec2 Merge "[#89] Gather container logs in check pipeline" 2020-03-19 11:54:05 +00:00
Dmitry Ukov
2817df8482 Ensure node power state ON/OFF for Reset command
Change-Id: Icc6b18b4694a17ab2f8e0bf1112e41a1d18a5b00
Relates-To: #54
Depends-On: https://review.opendev.org/713622
2020-03-19 09:53:58 +04:00
Zuul
ae853757bc Merge "[#52] Provide Redfish feedback in RemoteDirect" 2020-03-18 05:46:49 +00:00
Zuul
39b4150ca8 Merge "Refactor Redfish ClientError" 2020-03-18 05:32:24 +00:00
Ian Howell
cdc6ba66f1 [#102] Add function pass forwarding for annotating
* Expose the GetAnnotations method of the document.Document interface.
* Add the Annotate method for adding a single annotation to a
  document.Document
* Clean up the implementation of Label and GetLabels

Change-Id: I94af2380f50848bfcd64af9d5c2c991305d9746f
Relates-To: #102
2020-03-17 12:18:52 -05:00
Drew Walters
4ba23313c5 [#52] Provide Redfish feedback in RemoteDirect
Currently, errors thrown by RemoteDirect are simply HTTP status codes
from the Redfish client HTTP requests. This change adds feedback to
RemoteDirect errors when the Redfish client provides error feedback.

Closes #52

Change-Id: I4441baf3b98405e92613a2d4e8c44ef63a5d4001
Signed-off-by: Drew Walters <andrew.walters@att.com>
2020-03-17 16:38:41 +00:00
Drew Walters
0cf1068c5f Refactor Redfish ClientError
This change refactors the Redfish ClientError to match the error pattern
used elsewhere in airshipctl.

Change-Id: Ie309ba9ac41e5b618cf2f4c18f1f381d875e9cdb
Signed-off-by: Drew Walters <andrew.walters@att.com>
2020-03-17 16:36:08 +00:00
Vamsi Savaram
5c5ff8b46f [#89] Gather container logs in check pipeline
Change-Id: I043e7bf1cbb4cf67e3b811df1c0e84ecfc137988
Signed-off-by: Vamsi Savaram <vamsi.savaram@gmail.com>
2020-03-17 16:27:17 +01:00
Zuul
3a6332f4de Merge "Increase test coverage" 2020-03-17 15:01:18 +00:00
Zuul
3618fecdb0 Merge "Fix a failure when running unit tests locally" 2020-03-17 14:17:14 +00:00
Zuul
b25aec30b7 Merge "Increase config pkg test coverage" 2020-03-17 13:56:43 +00:00
Zuul
8785d15836 Merge "[#106] Add Gather logs role" 2020-03-17 13:50:55 +00:00
Yasin, Siraj (SY495P)
f12446afdf Increase test coverage
Added test cases:
	WriteFiles
	TabWriter
	NewRedfishRemoteDirectClient

Updated:
	ReadYAMLFile	=> new test case with invalid yaml file

Change-Id: I06c6f2eefd1c1c1659e0bf3c08fbe28628c80725
2020-03-17 08:46:34 -05:00
Stanislav Egorov
3eacfc6c71 [#102]: removed methods for bundle interface
Removed two unused methods from bundle interface.

Two other methods are used internally and there is no need to keep it in the interface.

Change-Id: I5d7999e4b2c83dd43025442e5549ac7826009a87
2020-03-16 15:08:19 -07:00
Stanislav Egorov
5224ed1b62 [#103]: replaced external methods for document interface
Removed external methods from document interface.
Created new methods to supply document labelling.

Change-Id: I4c20ad515999a6c049a2feddafdb62af8e1dfefb
2020-03-16 15:08:19 -07:00
Drew Walters
5293ebcc2a [#33] Fix secret name
Change-Id: I61e52834892bf01cc96ab6d5a886112b375ce253
Signed-off-by: Drew Walters <andrew.walters@att.com>
2020-03-16 13:41:03 -05:00
Drew Walters
6aeeaaa1ec [#33] Convert secret names to underscores
Currently, the image publish job is not functioning. This appears to be
due to an invalid secret name. Hyphens cause problems in Ansible
variable names [0]. This change converts the secrets in this repository
to use underscores.

[0] https://github.com/ansible/ansible/issues/3907

Closes #33

Change-Id: I2b1db9ba01a425788541afd8938afef92ef539d6
Signed-off-by: Drew Walters <andrew.walters@att.com>
2020-03-16 12:19:13 -05:00
Zuul
fc4bf5f22a Merge "Show isogen container logs if debug is enabled" 2020-03-16 13:41:15 +00:00
Zuul
fc71531bc3 Merge "Fix network and cloud data for ephemeral host" 2020-03-16 13:39:26 +00:00
Zuul
62612dd1fb Merge "Add single source of Seletors" 2020-03-16 07:45:01 +00:00
Ruslan Aliev
0e9cd303cb Fix network and cloud data for ephemeral host
Change-Id: I954971d52e708ae5e89d99dfc926f6570570f94a
2020-03-13 16:32:52 -05:00
Kostiantyn Kalynovskyi
c1cce8f9c5 Add single source of Seletors
Also this commit, adds condition to setup testbundle, that ignores
directories

Commit adds new set of functions that allow easy selection of
documents from bundle for different modules.

Relates-To: #61
Closes: #61

Change-Id: I6011203a1f573cbb847e9f57c04aa60bf8278ef1
2020-03-13 16:31:12 -05:00
Ian Howell
5eec83e05f Fix a failure when running unit tests locally
This change fixes an issue in pkg/k8s/client.TestNewClient in which the
unit test was using the developer's real airship config file. This was,
in some cases, causing unit tests to fail when run locally.

Change-Id: Ic8911b9e72d3e76f0219472ea0a9de5b3b255c3b
2020-03-13 14:43:43 -05:00
Francis Yi
c375db77c3 Increase config pkg test coverage
Added tests for:
* CurrentContextBootstrapInfo
* SetLoadedConfigPath
* SetKubeConfigPath
* GetCurrentContext
* CurrentContextCluster
* CurrentContextAuthInfo
* CurrentContextManifest
* CurrentContextEntryPoint

Min test coverage at 80%.

Change-Id: Ifda50eb6f8d7142b65ea956d181354bbe71f8457
2020-03-13 14:29:12 -04:00
Kostiantyn Kalynovskyi
4c85c696e8 Resolve gather-libvirt-logs role failures
This commit adds small fix, a missing 'path' parameter to synchronize
module call

Relates-To: #111
Closes: #111

Change-Id: I5208a0b327ddc75941f82dec671e6869352ed2ad
2020-03-13 11:27:11 -05:00
Zuul
2ccb060c61 Merge "[#91] refactor secrets as top level command" 2020-03-13 16:05:47 +00:00
Alexander Hughes
c2a0359ff9 [#91] refactor secrets as top level command
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>
2020-03-13 13:00:53 +00:00
Dmitry Ukov
e57b3ce4c0 Show isogen container logs if debug is enabled
Change-Id: I92c82eecdb35de22cc4da2326632b8af3aadd4cd
2020-03-13 12:53:30 +04:00
Dmitry Ukov
ae22635081 Fix go get for airshipctl module
k8s.io/kubernetes package is not needed any more since kubectl cli
support has been removed. Therefore we do not need replacements for
kubernetes modules any more

Change-Id: I5d9229c0011881afe8957f0f5957985d5c0b8041
Closes: #63
2020-03-13 07:25:19 +00:00
Zuul
6fbcc26323 Merge "Split document model, add entrypoints for repos" 2020-03-12 21:10:27 +00:00