Commit Graph

19 Commits (faa13c51adae311e187380972837d81ca60d3e54)

Author SHA1 Message Date
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
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
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
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 8bed52b057 Refactor phase related errors
* phase related errors were moved to separate package to prevent
   cycling import error;
 * error duplicates were removed;
 * non-related to package errors were moved to appropriate ones.

Change-Id: If6cfb08c48d356c1517a13157a5fe740dc1635a4
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #485
2021-03-23 22:04:28 -05:00
Kostiantyn Kalynovskyi dae03cff83 Add WorkDir method to airshipctl config
The method also creates a directory if it doesn't exist.

Relates-To: #480
Closes: #480
Change-Id: I240b963c0b850bb3965396473898eb23df7c5a62
2021-03-09 17:22:30 +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 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
Dmitry Ukov 178b0eff3e Implement plan run command
Change-Id: Ie627ce670cd2b19d6999dc7c7a7a6dc12b25cace
Closes: #395
2021-01-28 10:13:05 +04:00
Dmitry Ukov 069e4069ce Implement plan list subcommand
Change-Id: Ibcd7dbf6dc8cd9d0b018c148017244526651d8ba
Closes: #385
2021-01-27 10:19:54 +00:00
Vladislav Kuzmin 49c0ad4a23 Add PhaseEntryPointBasePath to phase helper
This parameter allows to get full path to current site.
Also change phaseRoot to phaseBundleRoot and
change the corresponding methods.

Change-Id: Ia4b1b55ceaa8c544ed429ec314bc8772a2fee6de
Relates-To: #379
2021-01-07 16:02:04 +00:00
Zuul 0f287089d9 Merge "Add check for executor ref in phase helper" 2020-10-27 22:32:32 +00:00
Vladimir Kozhukalov a608d4c56d Add docEntryPointPrefix field to the metadata.yaml
* The phase.docEntryPointPrefix field in the metadata.yaml
   allows you to define a common part of the documentEntryPoint
   for all phases in the phase bundle.

   For example, let metadata.yaml be
   ---
   phase:
     path: manifests/phases
     docEntryPointPrefix: manifests/site/test-site

   and a phase be
   ---
   apiVersion: airshipit.org/v1alpha1
   kind: Phase
   metadata:
     name: initinfra-ephemeral
     clusterName: ephemeral-cluster
   config:
     executorRef:
       apiVersion: airshipit.org/v1alpha1
       kind: KubernetesApply
       name: kubernetes-apply
   documentEntryPoint: ephemeral/initinfra

   Then the documentEntryPoint for executor will be prepended with
   docEntryPointPrefix and the path to the executor bundle will be
   manifests/site/test-site/ephemeral/initinfra

Change-Id: I29ec14378790d95b66c3ff1fe6120bb200f91a50
Relates-To: #356
2020-10-22 13:29:05 +03:00
Vladimir Kozhukalov dc68640389 Phase docs are targetPath + phaseRepo + phase.DocumentEntrypoint
Change-Id: I1d5ea75d1c19eb4ebaf37b28918ccde771bcef85
Relates-To: #356
2020-10-15 13:55:59 +03:00
Kostiantyn Kalynovskyi eddfc6338a Add check for executor ref in phase helper
Relates-To: #365
Closes: #365

Change-Id: I95251a0ef49436d86f6f882bf23a91ceb1b1a952
2020-10-12 13:41:48 -05:00
Zuul d4ea864eeb Merge "Fix ListPhases to return not empty phase docs" 2020-09-29 17:47:31 +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
Kostiantyn Kalynovskyi 9f01c87648 Fix ListPhases to return not empty phase docs
Change-Id: I44dd36c41279b34357d6d86a92fc49bfca7b871b
2020-09-18 15:47:28 -05:00
Kostiantyn Kalynovskyi 76b1ffd722 Implement helper interface
Change-Id: If65d7d8cd3fa082facc077753bb06275da2a6643
Relates-To: #342
2020-09-10 15:05:00 +00:00