528 Commits

Author SHA1 Message Date
Ruslan Aliev
fc33287204 Remove kubeconfig from config struct
Change-Id: I5ab8722dd151d9e652e0b20e1d82988cd98505af
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2020-10-07 14:35:07 -05:00
Zuul
857b51612c Merge "Add ability to perform baremetal operation against all nodes" 2020-10-07 14:35:02 +00:00
Zuul
9b79bbf898 Merge "Extend plugin interface with execute method" 2020-10-06 15:40:44 +00:00
Kostiantyn Kalynovskyi
8b86f156b0 Uplift cluster-api go package to 0.3.10
This commit uplifts cluster-api go package to 0.3.10
In new version we are now allowed to skip var subsitution completely
that is why TestAdditionalVariableSubstitutionRepoClient is changed
to relfect that.

Also some of the cluster-api constructor functions has been changed,
and we are changing our factory injection methods as well.

Change-Id: I24aa849271eb7109eb4f7d53a352ea3bb20a21a5
2020-10-05 12:21:17 -05:00
Zuul
8c180daf4e Merge "Removes BMH specific logic in the airshipctl move command. Also removes pkg dependencies that were introduced by the BMH logic." 2020-10-05 16:43:01 +00:00
Dmitry Ukov
0d475ec6c5 Extend plugin interface with execute method
Change introduces evolution of airshipctl document plugins which
are compatible to the new approach for kustomize plugins.

Change-Id: I422110ba523b97c8a80a0b82cb43b70a4ee8e558
Relates-To: #322
2020-10-05 13:24:03 +04:00
Ruslan Aliev
07c44eedb7 Add ability to perform baremetal operation against all nodes
If no name or label filter specified baremetal operation will
be performed against all nodes with baremetalhost kind. Also,
baremeral cmd code was refactored and combined, which allowed
to remove duplicated code and slighlty improve test coverage
by reducing the number of untestable lines.

Change-Id: Ieadafdb9f55b995d4b47aeff1dc7233325f3191c
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #361
Closes: #361
2020-10-05 00:29:40 -05:00
Arvinderpal Wander
e909aff0ad Removes BMH specific logic in the airshipctl move command.
Also removes pkg dependencies that were introduced by the BMH logic.

Change-Id: Ib1235b5a8043f2f53d90a818fff25df4fdb9ec20
2020-10-03 07:52:21 -07:00
Ruslan Aliev
cc46ae2ef4 Fix unit test for showProgress function
Sometimes unit test for showProgress function fails if progress bar
was not finished before refreshing event occurs, so progress bar
prints to io.Writer its intermediate state (which is normal since
in regular terminal the output everytime overwrites by carriage
return), so expected and actual output become different. This PS
changes the concept of testing this function and adds the error
tracking of showProgress execution. Some other minor changes included.

Change-Id: I78b4fa9674d4412fa83c1e9320b686923cbe8084
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2020-10-02 01:52:59 -05:00
Zuul
2a47c00f00 Merge "Add progress bar and improve cmd output for image build command" 2020-09-30 14:34:03 +00:00
Zuul
29a6906efc Merge "Add test to phase bundleFactory" 2020-09-30 14:26:37 +00:00
Zuul
e4a2c68d3e Merge "Use BundleFactory instead of bundle in executors" 2020-09-30 14:24:52 +00:00
Zuul
d4ea864eeb Merge "Fix ListPhases to return not empty phase docs" 2020-09-29 17:47:31 +00:00
Kostiantyn Kalynovskyi
300486482c Add test to phase bundleFactory
The test makes sure that correct error is returned when bundle
factory fails, and increases test coverage of executor() function

Change-Id: Ibfc5d8ea1941a5d4d304a8afaedc5c89efe7c398
2020-09-29 00:40:15 +00:00
Kostiantyn Kalynovskyi
e6e56ffa2e Use BundleFactory instead of bundle in executors
This will allow to avoid using nil bundle and performing
additional checks inside the executors

Change-Id: Ia061cccf7e0a7948bbc5c8fce24e0e6f8b3256e1
2020-09-28 19:39:05 -05:00
Zuul
30914340da Merge "Refactor cluster status command" 2020-09-28 23:01:59 +00:00
Zuul
7502da5c34 Merge "Add document pull step to gate script runner" 2020-09-28 22:45:02 +00:00
Zuul
462b8d8442 Merge "Fix TestPersistConfig" 2020-09-28 22:13:37 +00:00
Zuul
e70187641a Merge "Add timeout flag for phase run in cli" 2020-09-28 22:06:44 +00:00
Zuul
ac0b5d7896 Merge "Add functions for default api objects" 2020-09-28 20:52:19 +00:00
Sirajudeen
3e4c228638 Add timeout flag for phase run in cli
Syntax:
	airshipctl phase run <PHASE_NAME> --timeout <time_unit>

Exmaple:
	airshipctl phase run initinfra-ephemeral --debug --wait-timeout 1000s

Change-Id: Ic8c699f5302eb482f32aee0e7d7c593df2ed7d3b
2020-09-28 16:58:18 +00:00
Ruslan Aliev
ec51a71181 Add progress bar and improve cmd output for image build command
This patch provides the ability to show progress bar using
container logs (ubuntu/debian based only).

Change-Id: I86eebe4d368d81c4685fb27ca31b86cbb3dea08d
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #278
2020-09-28 16:11:34 +00:00
Ruslan Aliev
d8a6139e81 Add document pull step to gate script runner
Currently we don't test document pull step by rewriting
manifest_directory variable as current source path, which
makes a mess in target_path, manifest_path and related paths
(concatenation of target_path+manifest_path won't return
an existing and proper location). This patch organizes
mentioned variables and enables document pull step which
starts working properly. The latest repo state used as
git source for this command.

Change-Id: I5abce73877441c7529f2f77add79cf410e2226d8
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2020-09-25 00:39:28 -05:00
Ruslan Aliev
94d99c85d0 Refactor cluster status command
This patch moves all cluster status functionality from
cmd level to pkg level as well as unit tests, making code
cleaner and improving actual test coverage.

Change-Id: Ia811887b684b2129ca30dd90b5afc72e726271ff
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2020-09-24 20:06:00 +00:00
Sirajudeen
2769c62c8a Update metadataPath using set-manifest in cli
* Added metatada-path as a flag to set-manifest

Change-Id: Id26f20c4a6350b4aae34da850bbfcab42cbe9f21
2020-09-24 19:33:15 +00:00
Zuul
29088b7b42 Merge "Removed K8s Authors" 2020-09-24 18:58:14 +00:00
Zuul
233b87a103 Merge "Move plugins configurations to API module" 2020-09-24 15:34:08 +00:00
Zuul
272113b192 Merge "Fix printing docker container logs" 2020-09-24 14:54:42 +00:00
Kostiantyn Kalynovskyi
065888d6c7 Add functions for default api objects
This allows to avoid nil pointers when working with unmarshaled
objects, that may be missing some fields.

Next step would be to revisit why pointers are used in such obj
as Clusterctl and ImageConfiguration

Change-Id: I99a711529a53943ef1b0cb1ebb4d240f2482fac8
2020-09-23 18:37:46 -05:00
bijayasharma
e99adf50ad Removed K8s Authors
To make it consistent, this commit will remove K8s authors
from copyright section.

Change-Id: I4e670cc76ea1feb6456965707a8deff258e5f215
2020-09-23 11:36:43 -04:00
Ruslan Aliev
09ffae277b Fix printing docker container logs
Currently, we observe non-readable artefacts in the beginning of each
log line from docker container because log stream prints logs in
multiplexed way and first 8 bytes is actually a header by default. This
patch fixes this issue by using TTY mode (in this case output data
is copied directly from the container output stream, no extra
multiplexing or headers)[1].

[1] https://godoc.org/github.com/docker/docker/client#Client.ContainerLogs

Change-Id: I26f1588936be736a124b9c77ed712ac4376f03a2
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2020-09-23 03:06:31 -05:00
Ruslan Aliev
2f5402ae80 Remove phase apply command
Command phase run will be used instead, so phase apply became no
longer needed.

Change-Id: I8bdbd6bcad7efbb03632978d8952700fc39d55ba
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2020-09-23 01:42:16 -05:00
Ruslan Aliev
0c736af2e8 Implement render methods
Change-Id: I03b7aad33576eaa9ef7dfaabfb579ac90cc26a12
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2020-09-23 03:06:51 +00:00
Zuul
0bdbd690db Merge "Fix typos" 2020-09-23 02:59:18 +00:00
Kostiantyn Kalynovskyi
2b30dd0d71 Stop using CurrentContextEntryPoint in remote pkg
Note this commit doesn't refactor remote package, it is only created
to shift from using CurrentContextEntryPoint function, which would
in turn allow us to refactor config package and get rid of cluster
types in airship config.

Relates-To: #349
Relates-To: #246
Relates-To: #265

Change-Id: I1c941c8ade3497b9911fb126465aa85c25567431
2020-09-22 12:29:37 -05:00
Kostiantyn Kalynovskyi
fc72884676 Fix clusterctl, IsoGen executors to emit proper events
Change-Id: Ib69d9c85f7d27b83726f925d5a802c8e950c3a86
2020-09-21 13:57:26 -05:00
Ruslan Aliev
2e85043c20 Fix typos
Change-Id: I0ce87ec00d2b5974cf861d9c9685f23d7d0f5fc1
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2020-09-21 02:49:33 -05:00
Kostiantyn Kalynovskyi
9f01c87648 Fix ListPhases to return not empty phase docs
Change-Id: I44dd36c41279b34357d6d86a92fc49bfca7b871b
2020-09-18 15:47:28 -05:00
Vladislav Kuzmin
27e0ab455c Add isogen executor
Relates-To: #344
Change-Id: I1b9b04f1f723d8df6d6aad63b64a917566b22176
2020-09-18 13:49:01 +04:00
Dmitry Ukov
034efc3682 Move plugins configurations to API module
Data structure representing plugin configurations should be a part of
airshipctl API module. Plugin implementations will reside in document
package.

Change-Id: Id2e359b747a16a5573052cfb05c1148d346db508
Relates-To: #322
2020-09-17 19:22:07 +04:00
Ruslan Aliev
5d52339bd6 Remove clusters, users, reconcilation and config import
All of these entities are no longer required and should be deleted.

Change-Id: Id4776efe668265df6961a38ce984b8ac37b27097
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
2020-09-16 18:35:12 -05:00
uday.ruddarraju
f328c43295 Adding encryption config to airshipctl config
Design document: https://docs.google.com/document/d/1EjiCuXoiy8DEEXe15KxVJ4iWrwogCyG113_0LdzcWzQ/edit?usp=drive_web&ouid=102644738301620637153

This patchset comprises of:
- airship config now supports encryption configs to store encryption and decryption keys
from local file system or the kubernetes api server that will be used to encrypt
and decrypt secrets in a future patchset

This is the first of multiple patchsets to support encryption and decryption in airshipctl

Complete feature: https://review.opendev.org/#/c/742695/

Change-Id: I195e8e254b7cc6b3e04e45d67e0a0e3797183816
2020-09-15 14:11:04 -07:00
Zuul
3601c2b59c Merge "Cleanup phase package" 2020-09-15 20:23:36 +00:00
Kostiantyn Kalynovskyi
285130106a Use cluster name as context in executors
Change-Id: I4fcf524dd2ff466290b80df7d966f90aa0409471
Relates-To: #342
2020-09-15 12:29:16 -05:00
Kostiantyn Kalynovskyi
b63c9e3888 Cleanup phase package
Change-Id: Ib849da5faa2f69f058bd9df814b55e117ecefb8a
Relates-To: #342
2020-09-15 17:27:40 +00:00
Zuul
40fd9eeadd Merge "Implement clusterctl move executor" 2020-09-15 17:27:23 +00:00
Zuul
c176e78979 Merge "Allow substring replacement of numerics" 2020-09-15 14:01:12 +00:00
Kostiantyn Kalynovskyi
6114d5895f Implement clusterctl move executor
Change-Id: Ibb3aea6ead51409b9cbd69cc02e685d3fce186a4
Relates-To: #342
2020-09-15 08:57:25 -05:00
Vladimir Kozhukalov
b76ddc98ac Fix TestPersistConfig
testutil.InitConfig writes sample configs to files,
 and if we just check that these files exist after
 calling PersistConfig function, then don't test anything.

 We have to change config file paths before calling PersistConfig
 and then we can check if these files exist.

Change-Id: Ibaee17a57a86251f7016bb57b2d8bd9976cefac0
2020-09-15 14:13:47 +03:00
Matt McEuen
9997e7427e Allow substring replacement of numerics
This change adds the ability to use substring substitution to inject
numeric source values into string targets.  This is required for our
networking catalogue, since a numeric k8s API port needs to be inserted into
numeric and (sub)string targets in different phases.

Co-Authored-By: Ian Howell <ian.howell0@gmail.com>
Change-Id: I24beb46a2bda4e118406129a0a922b0c56142c76
2020-09-14 16:03:51 -05:00