698 Commits

Author SHA1 Message Date
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
a435109673 Merge "Add cluster name filter for phase list cmd" 2021-02-09 01:02:37 +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
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
Dmitry Ukov
c36a8ea022 Introduce generic table printer
* Table printer is based on cli-utils approach
* Rename 'phase plan' command to 'phase list' and print all Phase
documents from model instead of just printing PhasePlan object

Relates-To: #358
Change-Id: If3c5e2463e32f6794af4c82c12955a45583fce80
2021-01-27 14:10:31 +04:00
Kostiantyn Kalynovskyi
c6d6516200 Cleanup ClusterMap interface
This commit deletes a left over method that was used to get
namespace of the cluster. Instead ClusterAPIRef should be
used to get both name and namespace of the cluster in
terms of cluster-api.

Change-Id: I770cd11094257df29e1cac2c63ed3edecd62e54f
2021-01-26 20:25:52 +00:00
bijayasharma
661ae70fd0 Removed capitalization in Error string message
* This commit will removed capitalizaion in Error message
  and follow the Golang code rule.
* Golang errors should not begin with capitalization:
  https://github.com/golang/go/wiki/CodeReviewComments#error-strings

Signed-off-by: bijayasharma <vetbijaya@gmail.com>
Change-Id: I053cfa9e21ad56b0f30e476ec36320cb7cea4da4
2021-01-26 19:42:08 +00:00
Ruslan Aliev
899bbdbe07 Link cluster get-kubeconfig cmd with appropriate functionality
This patch links cluster get-kubeconfig command call with
appropriate clusterctl functionality, and also replaces old
callbacks and removes outdated implementation.

Change-Id: Ibd0d981985f94497db250c8df3f5675fdec1d2ca
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #374
2021-01-26 11:03:59 -06:00
Zuul
63421c8fcc Merge "Add general inventory interface implementation" 2021-01-25 18:08:44 +00:00
Kostiantyn Kalynovskyi
7bb4ac288d Remove unsed functions and increase test coverage
Change-Id: I2601700a477006946e1d759a8b8d849bf30e8afd
2021-01-22 23:31:22 +00:00
Kostiantyn Kalynovskyi
fe8c86feb8 Add InventoryRepoName field to config
If inventory repo name is not specified, phaseRepoDir will be used

Change-Id: Iea3eca5d7ca14c549696b7214c8d4b07ef3e5bf4
2021-01-22 22:26:37 +00:00
Zuul
6acf6b99b3 Merge "Move remotedirect method to remote interface" 2021-01-22 21:31:47 +00:00
Kostiantyn Kalynovskyi
129fd7ffa6 Cleanup unused remote pkg code
Change-Id: Ie879b6c8947148ae15b1c7cb5e15a46e998ec05c
2021-01-22 20:23:08 +00:00
Kostiantyn Kalynovskyi
8958d7093c Add general inventory interface implementation
This commit also adds function to be used with command line pkg

Change-Id: Ifdebfd62817b071f06cad90a14897fda63808a7a
2021-01-21 23:18:55 +00:00
Kostiantyn Kalynovskyi
decc12b0a9 Move remotedirect method to remote interface
Please note that this is first commit in series and in next commits
remote/remote_direct* files will be remove completely, so if you
have any comments that address issues in these files, keep in mind
that they will be remove in next patchsets.

Change-Id: I52e9b8438a4f8e1a2395cbe90238b9cb654772d4
2021-01-21 23:09:54 +00:00
Zuul
fa04ecc548 Merge "Fix pulling docs from remote branch" 2021-01-15 19:49:33 +00:00
Zuul
6c7a6b0dfd Merge "Changed the return statements to go idiomatic way" 2021-01-14 22:03:56 +00:00
Zuul
1cb1171fa8 Merge "Remove unnecessary constants" 2021-01-14 19:09:26 +00:00
Zuul
2e66fc59f6 Merge "Implement kustomize sink in generic container executor" 2021-01-14 18:40:14 +00:00
Ruslan Aliev
0e44b580f0 Fix pulling docs from remote branch
Currently airshipctl is not able to checkout remote branch
due to using simple branch reference name instead of remote one.
This patch fixes appropriate problem and allows user to specify
what kind of branch to use - local or remote one (since reference
name will be different in these scenarios).

Change-Id: I1fea29f84097b9e7160597003d0e8961f4d3aca6
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2021-01-14 12:35:56 -06:00
Kostiantyn Kalynovskyi
eea34fba72 Don't create NS when dry run strategy is specified.
Change-Id: Ib573d51128b0d0cfab0860e89c691b3b06f8c411
2021-01-14 14:53:40 +00:00
Vladimir Kozhukalov
b0d171d0ec Remove unnecessary constants
Change-Id: Ib54ce13e552efb4ac8efe00c18956ed65b46d564
2021-01-14 14:51:12 +00:00
Zuul
8810447fc5 Merge "Implement RunAction method of the baremetal interface" 2021-01-13 16:14:35 +00:00
Vladislav Kuzmin
3de8b5b2b2 Implement kustomize sink in generic container executor
Sink function allows to write configurations to an external system.

Change-Id: If9c6904239a542ea4c2bef2920965b6d87feb1e6
Relates-To: #202
Relates-To: #369
2021-01-13 17:56:04 +04:00
Ruslan Aliev
5a6f1096eb Groom phase/executors package
All the duplicated methods were removed. Unit tests reorganized.
Test coverage increased.

Change-Id: I0f7bd3eea63c101195ea50c0369e62945d73f297
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Closes: #432
2021-01-12 16:31:43 -06:00
Zuul
932d92664e Merge "Add PhaseEntryPointBasePath to phase helper" 2021-01-12 19:40:38 +00:00
muly
d16ba90d34 Changed the return statements to go idiomatic way
Change-Id: I56f57d9e6ef385245b2a299d9d6d7bacd2266b68
2021-01-12 14:10:22 -05:00
Zuul
41ad76c3d0 Merge "Call correct client when building Host object" 2021-01-12 19:00:36 +00:00
Zuul
78e0e81bc0 Merge "Bootstrap Ephemeral - Executor methods" 2021-01-11 21:02:20 +00:00
Sidney Shiba
4b31d3b936 Bootstrap Ephemeral - Executor methods
This patchset includes the go code for the Executor for the Bootstrap
container/Ephemeral cluster and respective unit test code.

This executor allows to deploy a K8S cluster on a public/private cloud
provider through a dedicated Bootstrap container.

This patchset does not include the manifests for the executor to avoid
too big patchset. It will be included in a different patchset.

Change-Id: I3f9d2ba1bb65b344522e105fd26310af24e3a1b1
2021-01-08 10:34:01 -06:00
Kostiantyn Kalynovskyi
fa03b40f4a Implement RunAction method of the baremetal interface
Change-Id: I86b2cd7824c68ccd4fac875a5ad1d3ff9cd69072
Relates-To: #397
Relates-To: #362
Relates-To: #359
2021-01-08 03:25:25 +00:00