184 Commits

Author SHA1 Message Date
Ruslan Aliev
3dfb02eb14 Extend poller capabilities
This patch allows to wait for certain state when applying
particular resources.

Change-Id: I064cb49c8971f1edee870bc6c3c3dd1e428c73f0
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Closes: #624
2021-09-29 01:42:32 -05:00
Vladimir Kozhukalov
a6b89c0c94 Use bundle mock for container executor tests
Also:
 - Remove unnecessary bundle from baremetal executor
   tests.
 - Use inline output for container api tests and remove
   unnecessary test bundle files.
 - Fixed merge conflict.

Change-Id: I400fb18fb1595c34598b451be5ad3f12012bae63
Relates-To: #464
Relates-To: #465
2021-09-21 08:04:22 +00:00
Zuul
00d74a4500 Merge "Allow to specify multiple clusters per get-kubeconfig request" 2021-09-18 06:24:55 +00:00
Ruslan Aliev
b67242f532 Add possibility to specify poll interval
Currently, there is no way to specify poll interval for
kubernetes-apply phases, however such possibility exists
in cli-utils API and could be helpful for tuning apply
process.

Change-Id: I605767d589920d0f1e10343afd9672c8d615a46a
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2021-09-13 22:09:16 -05:00
Ruslan Aliev
b8ddc1fe43 Allow to specify multiple clusters per get-kubeconfig request
Change-Id: I1b736a4b9cae4e6e47ddb7909a8fd619518e975c
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Closes: #567
2021-08-12 22:45:33 -05:00
Zuul
c8434994bd Merge "Add possibility to specify 0 timeout via CLI options" 2021-07-30 21:57:47 +00:00
Ruslan Aliev
ab55bc5e86 Move clustetctl to KRM
Change-Id: I79ccb7b7c92f27cf6fdaaa540d86db80a0a62b41
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Closes: #568
2021-07-17 22:06:43 -05:00
Ruslan Aliev
583fda5dfe Add possibility to specify 0 timeout via CLI options
Currently zero timeout won't be applied if specified via CLI
options of commands plan run and plan run. This patch fixes it.

Change-Id: Icad06ae8c71d78dc81821e2c5b0adb486d547fda
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #566
Closes: #566
2021-06-29 01:26:34 -05:00
bijayasharma
622d45f3bd Add flags to airshipctl get-kubeconfig cmd
* This commits add --file and --merge flags to
  airshipctl get-kubeconfig cmd

Change-Id: I919d4f068d3ef9bcda6b3a7c9aeb0826a4e5c0d4
Signed-off-by: bijayasharma <vetbijaya@gmail.com>
Relates-To: #495
Closes: #495
2021-06-23 13:41:14 +00:00
Ruslan Aliev
035e371a5e Allow to setup timeout for get kubeconfig request
This PS replaces cluster-api implementation with our own since
it allows to configure timeout.

Change-Id: I5cbba24dd7c6a279fcd2325e904ac7d18348eabf
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #548
Closes: #548
2021-06-13 17:29:10 -05:00
Ruslan Aliev
bc9f97ff2e Embed validation cfg into phase and plan definition
* validation config is now part of airshipctl api
 * additional CRD locations can be only kustomize entrypoints
 * changed mechanism to call document-validation executor to allow
   to pass validation config from phase or plan
 * kubeval version pinned to the latest 0.16.1
 * default k8s version to validate against uplifted to 1.18.6
 * default URL with k8s schemas changed to more updated and reliable

Change-Id: Ifb24be224d5f0860d323a671b94e28a86debc65b
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Closes: #563
2021-06-11 15:37:38 +00:00
Zuul
575023cfcf Merge "Update metadata.yaml to kubernetes style" 2021-06-09 18:06:36 +00:00
siraj.yasin
f45ece8294 Update metadata.yaml to kubernetes style
* Define GVK for metadata.yaml
* Added supoorting type and registered the kind 'AirshipMetadata' to
  runtime scheme
* Used document object to read metadata instead of reading it as config

Relates-To: #530

Change-Id: I748cd0921ba7bb04ca6fb2999294776e6803ed3e
2021-06-04 03:34:31 +00:00
Vladislav Kuzmin
16da661959 Switch gating deployment to phase plan
Add all needed phases for deployment to deploy-gating
phase plan.

Relates-To: #517
Change-Id: I9d5af24b0877d90ab1ba24b31cca6ec7127e0f1d
2021-06-03 19:41:05 +04:00
Zuul
cc5221972a Merge "Update Validation Logic for Clusterctl Move" 2021-05-26 04:03:58 +00:00
Zuul
1f5dbf8645 Merge "Implement render method for container exec" 2021-05-24 21:32:08 +00:00
Ratnopam Chakrabarti
1cd6c2842a Update Validation Logic for Clusterctl Move
Removed the namespace condition check from the validation of 'Move'.
This is to allow validation of docker and cloud provider test site
manifests that do not use namespace.

Relates-To: #503
Change-Id: I39544ba9c9c13ff5a6519b7afd8844629e60087e
2021-05-19 11:09:25 -04:00
Zuul
e38f4fbf4c Merge "Use site-wide kubeconfig only on demand" 2021-05-18 19:06:09 +00:00
Zuul
a9dcdaaf47 Merge "Use bundle mock for k8s applier tests" 2021-05-18 17:49:49 +00:00
Kostiantyn Kalynovskyi
bbd9b018dd Use site-wide kubeconfig only on demand
This patchset introduces new field to Phase.Config API object

SiteWideKubeconfig - if set to true, the phase will have access
to all kubeconfigs for each cluster defined in ClusterMap.

By default only kubeconfig of the cluster specified in
Phase.Metadata.ClusterName will be available to the phase executor.

This approach will speed up the deployment process because arishipctl
will not have to look for multiple kubeconfigs when running each phase

Closes: #547

Change-Id: Ic92027ba88d3ce8cb769c254968530037540b8fd
2021-05-17 23:30:21 +00:00
Ruslan Aliev
7fd779ae0b Invoke validation container directly via ClientV1 package
This patch will allow us to bypass unnecassary logic in generic
container executor (e.g. mounting kubeconfig).

Change-Id: I526940e8f01c66f7609355a4ef750b38f1d9a323
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2021-05-13 13:12:18 -05:00
Vladimir Kozhukalov
ebb03b504b Use bundle mock for k8s applier tests
Change-Id: Id00e5c493bf9cca2c03ea30f51c1ed978df74c15
Relates-To: #464
Relates-To: #465
2021-05-13 11:13:13 +03:00
Zuul
ed271774f6 Merge "Add Plan Status() to ifc.plan interface" 2021-05-11 09:37:16 +00:00
Zuul
1b74bd49f4 Merge "Add kubeconfig cleanup in KubernetesApply executors" 2021-05-07 21:07:38 +00:00
Kostiantyn Kalynovskyi
dbe05585d3 Close events channel on executor level
This will fix a bug, when go routine wasn't finished when program has
exited. Results of the bug was that not all defered statemnets were
executed, which lead to temp kubeconfig not being cleaned up

Relates-To: #541
Closes: #541

Change-Id: If314886d9bed04b2c0f8a5006bc058395f4fdf7a
2021-05-03 15:26:17 +00:00
Kostiantyn Kalynovskyi
c08f4337f7 Add kubeconfig cleanup in KubernetesApply executors
Change-Id: I32c99feb19099a6926b0dadeb0b32aa59dc0c9ca
2021-04-29 22:15:24 +00:00
Niharika Bhavaraju
5085f22c56 [#394] plan list -o yaml changes
Added yaml output flag to show plan list in yaml format

Relates-To: #394
Co-authored By: Niharika Bhavaraju<niha.twinkle@gmail.com>
Change-Id: I8bed077573eb79783cfc77e4ebf82c819f41d125
2021-04-29 18:10:57 +05:30
Zuul
6543f63ebf Merge "Add validation phases" 2021-04-28 03:26:02 +00:00
Ruslan Aliev
31995eaf9d Add validation phases
This patch introduces ability to validate phases using kubeval.
Appropriate functionality was embedded into phase/plan validate
command.

Change-Id: I1e1ccae2b7e4948bdc97a199c96c07a3eb7292b2
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #503
Closes: #2
Closes: #19
2021-04-22 11:37:12 -05:00
bijayasharma
e9179ff018 Fix typos in various files
Signed-off-by: bijayasharma <vetbijaya@gmail.com>
Change-Id: Ibe0066e74497c3caecc50e1187abd0bde7955b04
2021-04-21 17:32:31 +00:00
Zuul
1fd133329c Merge "Do not pass phase helper to executor initializers" 2021-04-20 17:40:58 +00:00
Vladimir Kozhukalov
1b960c129d Do not pass phase helper to executor initializers
Phase helper provides plenty of useful methods for
 a phase client. But these methods are not used by
 phase executor initializers except for getting some
 configuration values. So, it is better to provide
 initializers with necessary values instead of passing
 them the phase helper.

Change-Id: I8c596455e30444570a86efad73d792af0ca83a33
Relates-To: #464
Relates-To: #465
2021-04-20 10:00:47 +03:00
niharikab
289b569de4 Add Plan Status() to ifc.plan interface
This commit adds plan Status() method to ifc.plan
interface.

Relates-To: #412
Change-Id: I4857eec9ea125902e305af64fbb336ff6de4faa8
2021-04-19 20:09:51 +05:30
Pallav Gupta
10e75b5580 Fix plan list command
The aim of this PS to fix current issue we have when we have
new plan created with description width more than 40 char.
Added condition if width is more than specified in command
so the command execution will not break and just crop
exceeding description length.
Eg: e351b2bc43/pkg/print/table/columndefs.go (L71)

Change-Id: Icc353ec688b2fbb563add39f8d38004008093895
2021-04-15 12:18:23 -07:00
Ruslan Aliev
dc60b1116c Implement render method for container exec
Currently it returns NotImplemented error, and that's not
correct behavior. Since this kind of executor has the bundle
inside, it should be properly rendered.

Change-Id: I4c4e417b064236130b4349560fa3eb2615a0f824
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2021-04-04 21:21:35 -05:00
Ruslan Aliev
675f718317 Remove unused fields from ExecutorConfig
AirshipConfig and BundleName fields are not used within Executors,
so they should be removed.

Change-Id: I23c54b854938ae554e888102a41c7ec215b85c27
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2021-04-03 16:52:15 -05:00
Zuul
6a62e11fea Merge "[#323] Cluster list command to output in table/clusternames." 2021-03-31 03:00:29 +00:00
Zuul
5737f3bf26 Merge "Remove NameInKubeconf field from Context struct" 2021-03-31 02:11:36 +00:00
Zuul
ba5e56d3c9 Merge "Introduce plan validate command" 2021-03-31 02:02:55 +00:00
Zuul
9196dd089a Merge "Reduce the number of unnecessary document.NewBundleByPath() calls" 2021-03-31 02:02:41 +00:00
Niharika Bhavaraju
1f90036413 [#323] Cluster list command to output in table/clusternames.
* airshipctl cluster list
* airshipctl cluster list -o table
* airshipctl cluster list -o name(lists cluster names)

Relates-To: #323
Change-Id: Ic4609b8e05984c14acf8f20053123423d5e0088a
2021-03-30 17:03:13 +05:30
Zuul
adacadda4d Merge "[#358] Introduce Phase List command to output phase list(pkg module)." 2021-03-30 00:37:04 +00:00
Ruslan Aliev
6076891f31 Introduce plan validate command
This patch implements CLI command to invoke plan validation.
Appropriate functionality was already added to pkg previously.

Change-Id: I038b49c8de0af65f38b62950b27b31d95a6301a9
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #19
Relates-To: #497
Closes: #497
2021-03-27 12:59:30 -05:00
Ruslan Aliev
e9041a2a22 Reduce the number of unnecessary document.NewBundleByPath() calls
Since document.NewBundleByPath() is pretty resource and time
consuming call (because it invokes kustomize under the hood),
we should avoid unnecessary calls of this function. There are
lots of the same constructor calls of new bundle from phase
bundle root path, mostly in helper, which slows airshipctl
and makes no sense. This patch fixes this problem by storing
phase root bundle variable in helper, which creates only once
during airshipctl execution.

Change-Id: I6b59d440f7ab7a68dc613091dafcc9e82df10eb7
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Closes: #488
2021-03-27 12:58:36 -05:00
Ruslan Aliev
b8e0978d6d Remove NameInKubeconf field from Context struct
Since this field is no longer actually used, there is need to
remove it completely.

Change-Id: I9f7002f8def31d1660919bd0128707e43a57ad71
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2021-03-26 19:22:52 -05:00
Ruslan Aliev
92ce88fc29 Allow relative and ~ path for container mount
This patch allow to specify relative and home (~/) path for container
mounts.src field. In case if specified path is not absolute, it will be
created by following pattern: 'targetPath+mounts.src'; in case if path
contains ~/ - it will be properly expanded (it will allow us to mount
~/.airship working directory).

Change-Id: I878094371a2bc4e48216b1d076e466e3d29a86f6
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #484
Closes: #484
2021-03-25 16:41:30 -05:00
Niharika Bhavaraju
9bf40366a5 [#358] Introduce Phase List command to output phase list(pkg module).
* Phase list command lists phases of current documentset/plan in
  table or yaml format.
 airshipctl phase list
 airshipctl phase list --plan planName
 airshipctl phase list --plan planName -o yaml
 airshipctl phase list --plan planName -o table(default format)

Relates-To: #358

Co-Authored-By: Niharika Bhavaraju <niha.twinkle@gmail.com>

Change-Id: I37add2fc9dca2433de525bac8c2cc9e56fe39621
2021-03-25 20:16:27 +05:30
bijayasharma
60488d4d7a Add phase status command
Signed-off-by: bijayasharma <vetbijaya@gmail.com>
Change-Id: I09fc1e84f195982a43c97f80feb82fb2e489771d
Relates-To: #411
2021-03-25 12:36:01 +00:00
Zuul
4e296dacab Merge "Don't fail if docEntryPoint isn't defined for Container exec" 2021-03-25 08:49:25 +00:00
Zuul
818efdfc19 Merge "Remove deprecated options for phase/plan run cmd" 2021-03-25 06:20:03 +00:00