725 Commits

Author SHA1 Message Date
Niharika Bhavaraju
90c0116b7f Phase Validation: k8s applier package changes to support Phase Validation sub command
Relates-To: #330

Change-Id: I1503bcef1bc9d91d6897065a7c4418c1aa6181b6
2021-02-24 13:35:50 +00:00
Alexey Odinokov
f2dc2ca3f6 Allow airshipctl phase render to display encrypted secrets
Relates-to: #453
Change-Id: I150a48cbec5c87943ed6c07a8ef8d562437fda46
2021-02-16 19:27:23 +00:00
Zuul
f50998935e Merge "Integrate clusterctl client into phases" 2021-02-13 06:04:05 +00:00
Zuul
0d4f377c4e Merge "Extend kubeconfig builder" 2021-02-13 05:56:19 +00:00
Zuul
ea055dc87c Merge "Allow container config to be referenced as objects" 2021-02-12 21:06:53 +00:00
Zuul
56cb8cef20 Merge "Allow to get container logs asynchronously" 2021-02-11 21:22:56 +00:00
Alexander Hughes
2d523314d8 Bump linter from 1.29 to 1.36
Updating linter to latest version, which also updates
gosec to latest version to keep on top of updated security
checks in source code. Also disable gosec testing for rand.new.

Co-Authored-By: Alexander Hughes <Alexander.Hughes@pm.me>
Co-Authored-By: Sreejith Punnapuzha <Sreejith.Punnapuzha@outlook.com>
Change-Id: I46e71c41597f70150ace6d9611da5a01f93a933d
Signed-off-by: Alexander Hughes <Alexander.Hughes@pm.me>
2021-02-11 12:08:21 +00:00
Kostiantyn Kalynovskyi
efc4399e17 Allow container config to be referenced as objects
Now GenericContainer input config can be referenced as another
object inside the config bundle (with phase and executor objects).

Change-Id: Iff35e0844b1e9ce4beb72d939e229410208dcb16
2021-02-11 00:39:36 +00:00
Zuul
de970a8adf Merge "Fixed typos in inventory pkg" 2021-02-11 00:02:51 +00:00
bijayasharma
62272ed900 Added a warning message that cluster api already initialized
* Currently if the cluster init command is run & the cluster-api
  has already been initialized, the command fails.
* So,this commit adds a warning message that cluster-api already initialized.

Signed-off-by: bijayasharma <vetbijaya@gmail.com>
Change-Id: I93cc6b141c15fa4bc5661646ae0cbdf08580cbf9
Relates-To: #450
Closes: #450
2021-02-10 13:05:17 -05:00
Kostiantyn Kalynovskyi
9f051e465a Integrate clusterctl client into phases
This will make sure that phases have access to kubeconfgs generated
by cluster-api for the managed clusters.

Change-Id: Iabecced78192969d7a2ee5a48e75fc3adb0af092
2021-02-10 14:53:40 +00:00
Kostiantyn Kalynovskyi
d9f54b4171 Extend kubeconfig builder
Change-Id: I6724112826a4cc59815b7524bd05af01a9a1d01b
2021-02-10 14:52:39 +00:00
bijayasharma
c50286d015 Fixed typos in inventory pkg
Signed-off-by: bijayasharma <vetbijaya@gmail.com>
Change-Id: I8da797a6883df63adf6089743faa757d1099ef82
2021-02-10 13:20:50 +00:00
Zuul
77268cd1d0 Merge "Implement cluster list command" 2021-02-10 07:11:37 +00:00
Zuul
d0a9adc752 Merge "Implement render method for clusterctl executor" 2021-02-10 04:28:14 +00:00
Zuul
bc919145ac Merge "Fix typos in baremetal executor" 2021-02-10 01:58:51 +00:00
Zuul
5647f5381e Merge "Add ability to create bundle from bytes" 2021-02-09 22:46:15 +00:00
Kostiantyn Kalynovskyi
14026aadfd Allow to get container logs asynchronously
This will make sure that stderr of the generic container in gathered
in a go routine, this way we won't have to wait to see debug messages
from the container until it finishes.

Change-Id: I929719c3369f4f5796d452b5f990bf5f28a4c0d5
2021-02-09 16:37:03 +00:00
Ruslan Aliev
7bf93ba699 Implement cluster list command
Required for document validation script.

Change-Id: I555173a445278b31ef51ebf831a79e63446a19bc
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2021-02-08 23:54:57 -06:00
Ruslan Aliev
0f44ad9a7c Implement render method for clusterctl executor
Change-Id: If3d66baa8eec27f51705c813f17854ad7ef23a26
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2021-02-08 23:53:37 -06:00
Ruslan Aliev
cc25bcf52e Add ability to create bundle from bytes
This patch implements new constructor of document.Bundle type
using raw bytes as source.

Change-Id: Ie7742bcf245083ac988541aa9987448f5827fec3
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2021-02-08 23:32:06 -06:00
Zuul
9ab2ed96b7 Merge "Implement airship container type" 2021-02-09 02:50:33 +00:00
Zuul
92cfc8c03f Merge "Extend Generic Container interface" 2021-02-09 02:33:23 +00:00
Zuul
8b19ced1b8 Merge "Extend container interface with mounts get log opts" 2021-02-09 01:11:37 +00:00
Zuul
a435109673 Merge "Add cluster name filter for phase list cmd" 2021-02-09 01:02:37 +00:00
Kostiantyn Kalynovskyi
769e164b59 Implement airship container type
This will enable airship to run containers in privileged mode
as well and to specify commands to be executed.

Change-Id: I663eb55547bb821f26a9071c24d08166a3b3d56b
2021-02-08 17:59:11 +00:00
Kostiantyn Kalynovskyi
d78cbe96a1 Extend Generic Container interface
This also moves KRM related logic from executors package to
container package, and creates ClientV1Alpha1 interface that
would allow us to have versioned clients for generic container
executor.

Change-Id: I4b32fd8dd089b9ccea2ed64a805702e6a8705706
2021-02-08 15:50:20 +00:00
Kostiantyn Kalynovskyi
971c81acdb Extend container interface with mounts get log opts
This commit allows to specify options to get container logs, such
as stderr, stdout and if logs should be followed.

Also extends RunCommandOptions with ability to add mounts in addtion
to binds

Relates-To: #458
Change-Id: I83507f2f7ca6ea596f52f5d3e9f868467458b6a3
2021-02-08 00:11:29 +00:00
Ruslan Aliev
d1c7913ed3 Add cluster name filter for phase list cmd
This patch implements ability to filter phase by given
cluster name.

Change-Id: I4eb95f9f75c57eff4ae8eb41c608c6f6d7fa009c
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2021-02-05 17:09:44 -06:00
Kostiantyn Kalynovskyi
4671ea7f74 Allow privileged mode in docker interface
Change-Id: I12e7a895c5ccd228a3bb1a2ef3588be96893ae36
2021-02-05 04:25:06 +00:00
Kostiantyn Kalynovskyi
3ae387e9f2 Change container RunMethod to allow extending
This will make sure that when we add new features to how the
docker container is run, we don't need to change interface
method signature everywhere we use it.

Relates-To: #458

Change-Id: I12273264c1a8061300017246a1a4a17125ca8ae2
2021-02-05 04:25:06 +00:00
Zuul
bc7d253586 Merge "Add ability to render different document sets" 2021-02-04 21:21:40 +00:00
Kostiantyn Kalynovskyi
6807547ab2 Add ability to render different document sets
Now we would be able to render phase bundle, executor bundle
and config bundle. Config bundle will contain documents such as
phases and executors.

Relates-To: #459
Closes: #459

Change-Id: Ia6b9196dfb3d8fb3264fef676c975ccc32883fee
2021-02-04 17:40:35 +00:00
Kostiantyn Kalynovskyi
0a5f1e2ca4 Reuse RemoteDirect function for redfish dell client
Change-Id: I17726cae6f4d1f99e1cec4fa7a29c1a9e1dee3d5
2021-02-04 01:11:09 +00:00
Kostiantyn Kalynovskyi
0d13002f9a Fix typos in baremetal executor
Change-Id: I3b9ace228722a357b277927ef2e80a9427f7f687
2021-02-02 19:30:52 +00:00
Kostiantyn Kalynovskyi
f0e80cfdc5 Add BaremetalManager executor
This will allow to peform remote BMH operations as a phase

Change-Id: I8e99285e0407d1922312a08ad4f766363f8855d2
2021-02-02 16:42:09 +00:00
Zuul
3984e81095 Merge "Add BMH manager executor api object" 2021-02-01 22:54:41 +00:00
Zuul
e77bac1571 Merge "Implement genCAEx and genSignedCertEx with Subj support" 2021-02-01 20:22:53 +00:00
Zuul
621b7758e0 Merge "Link cluster get-kubeconfig cmd with appropriate functionality" 2021-02-01 19:19:06 +00:00
Kostiantyn Kalynovskyi
3f9e56ecef Add BMH manager executor api object
Also this commit extends helper interface with inventory

Change-Id: I8df785f1c095a2e9502f23e1c83c5fcfe6f811fd
2021-02-01 19:10:31 +00:00
Alexey Odinokov
47df361761 Implement genCAEx and genSignedCertEx with Subj support
The original sprig-library implementation of
genCA and genSignedCert may accept only CN parameter
which isn't enough for K8s admin certificate.
That certification must have O=system:masters, e.g.
/CN=admin/O=system:masters

This PR introduces the set of functions that
insted of cn accept subj argument that may have
a form compatible with openssl -subj parameter.
If the first symbol isn't '/' subj behaves as
cn argument.

The set of new functions that accept subj arg is:
genCAEx
genCAWithKeyEx
genSignedCertEx
genSignedCertWithKeyEx

Since the implementaion required to copy some
non-exported helper functions from sprig,
the decision was made to separate all go-template
extension functions into a separate package:
extlib. This package can be reused in other
go-applications, it's just necessary to use
GenericFuncMap function to get function-map.

Change-Id: I0ffddee2e597323803bf5f1b54f315ded424b7be
2021-01-29 16:43:32 +00:00
Zuul
34ff5e88bc Merge "Implement basic validation for plan and phase" 2021-01-29 01:33:38 +00:00
Zuul
897faf2d51 Merge "Implement plan run command" 2021-01-28 21:32:27 +00:00
Zuul
71e038a5c5 Merge "Removed capitalization in Error string message" 2021-01-28 15:25:33 +00:00
Zuul
aacaefc820 Merge "Cleanup ClusterMap interface" 2021-01-28 08:10:20 +00:00
Zuul
4ea1b0e2f0 Merge "Add InventoryRepoName field to config" 2021-01-28 06:13:58 +00:00
Dmitry Ukov
f0e276bb7b Implement basic validation for plan and phase
Plan validation:
1. Each phase must be defined within phase document bundle.
2. Each phase does not return error for Validate method

Phase validation:
1. Document bundle associated with the phase can be rendered without an
error.
2. Associated executor must not return an error.

Relates-to: #330
Change-Id: I08c5e8e42570f2cafdced5a02481b033414ffae0
2021-01-28 10:13:05 +04:00
Dmitry Ukov
178b0eff3e Implement plan run command
Change-Id: Ie627ce670cd2b19d6999dc7c7a7a6dc12b25cace
Closes: #395
2021-01-28 10:13:05 +04:00
Zuul
0b9f5fd197 Merge "Cleanup unused remote pkg code" 2021-01-28 03:01:16 +00:00
Dmitry Ukov
069e4069ce Implement plan list subcommand
Change-Id: Ibcd7dbf6dc8cd9d0b018c148017244526651d8ba
Closes: #385
2021-01-27 10:19:54 +00:00