Commit Graph

29 Commits (faa13c51adae311e187380972837d81ca60d3e54)

Author SHA1 Message Date
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
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
Zuul 5737f3bf26 Merge "Remove NameInKubeconf field from Context struct" 2021-03-31 02:11:36 +00:00
Zuul 9196dd089a Merge "Reduce the number of unnecessary document.NewBundleByPath() calls" 2021-03-31 02:02:41 +00: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
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
Kostiantyn Kalynovskyi 6207e2c24d Add multiple kubeconifg sources to ClusterMap
Change ClusterMap API object to support multiple kubeconfig sources
for a cluster. If one kubeconfig source fails, kubeconfig builder
will not fail and move on to the next one. This behaviour will allow
to support cases when ephemeral cluster is not accesible anymore or
when target cluster is not yet accessible.

For more information please read issue #460 in airshipctl github

Relates-To: #460
Related-To: #460

Change-Id: I7cd32f78cd7c4ad8814eac357424c24216f40d76
2021-03-10 18:22:30 +00:00
Vladimir Kozhukalov f4001bcffa Remove isogen executor and related code
Isogen executor is not needed any more since there is
 iso build phase plan that runs two phases using generic
 containers.

Relates-To: #440

Change-Id: I3600e82fa1d8a92cdf103d93cd4536bf4a713cca
2021-03-02 08:14:57 +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
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
Dmitry Ukov 069e4069ce Implement plan list subcommand
Change-Id: Ibcd7dbf6dc8cd9d0b018c148017244526651d8ba
Closes: #385
2021-01-27 10:19:54 +00:00
Michael Beaver 193dc935f1 Refactor subPath out of config manifests
This change removes the SubPath entry portion of the config manifests, and
refactors several areas that used it. This also updates unit tests to
reflect the new changes.

Closes: #255

Change-Id: Ibbb519a3f1fb28a1594e971274c5de54b99c867e
2020-11-04 09:30:03 -06: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
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
Vladimir Kozhukalov 0dc4ab7491 Replace PrimaryRepositoryName with PhaseRepositoryName
Change-Id: I2276a3b3ea50b8e81dd240815cd00a0a2a2af96e
Relates-To: #356
2020-10-12 15:28:27 +03: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
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
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
Kostiantyn Kalynovskyi d79c71e94d Implement phase and phase.Client interface
Relates-To: #342

Change-Id: I8882204c0e9eae05fca30c093fcd3bad58e308e1
2020-09-11 16:24:04 -05:00
Kostiantyn Kalynovskyi 0a7661ab7c Add clustermap object and interface
This commit adds cluster map api object, cluster map
interface and it's implementation built on top of cluster map api
object.

Important note:
ClusterMap interface needs a method to identify namespace of the
cluster, it can't be a part of api object, because real source for
cluster namespace is cluster object from cluster-api upstream lib.
This will need further design discussion on how we will find
cluster-api kind: Cluster object in our manifests. For now, there
is dummy "default" namespace being used

Change-Id: I8175f54abbe77331f0c87c0bde50857ee5c0eb1d
2020-09-09 17:28:45 -05:00
Kostiantyn Kalynovskyi 1f932861d4 Add kubeconfig builder
Kubeconfig builder will be a single source of kubeconfig, allowing
to make a decision how to build kubeconfig based on different
parameters, such as path to kubeconfig, dynamic kubeconfig
options, or kubeconfig based on document bundle.

Change-Id: Ia63e11a6f0b327e283d3e7fce169a35d54684dfb
2020-09-02 17:18:19 -05:00
Kostiantyn Kalynovskyi a3200e8d62 Integrate kubernetes apply executor with phases
Also adds unit test to test GetExecutor() method.

Relates-To #259

Change-Id: I7d89750e671ec1b747a811aa71b86725217b5311
2020-08-21 16:19:01 +00:00
Alexander Noskov 582894d389 Switch to Ubuntu focal (20.04) based image
Since we have switched from debian to ubuntu based image and changed the
name (in https://review.opendev.org/733078) we need to align it with
airshipctl repository.
Renaming the following names:
1) debian-custom.iso -> ubuntu-focal.iso
2) quay.io/airshipit/isogen:latest-debian_stable -> quay.io/airshipit/isogen:latest-ubuntu_focal

Updating the following packages and resources:
1) k8s 1.17.3 -> 1.18.6
2) docker 19.03.9 -> 19.03.12
3) Calico 3.9 -> 3.15

Change-Id: I7eaf382acb79016a511db6e0955fa932c02963c4
2020-08-13 13:11:25 -05:00
Kostiantyn Kalynovskyi dfb74fb878 Integrate ManifestMetadata with phase executors
With this commit executors will not rely on hardcoded path to build
bundle with phase information

Change-Id: I6b8826929cb5a4b95a5c4d30f23fad3a3af52555
Relates-To: #259
2020-07-16 00:19:00 +00:00
Dmitry Ukov 66b6acf565 Add phase run method
Change introduces phase executor interface as well as method to call it.
Each registered executor must implement this interface.

Relates-To: #259
Change-Id: I44665e5318ae59b4549cc77d10526a71bd40b40a
2020-07-08 14:31:22 +04:00
Dmitry Ukov 325d824503 Introduce phases and phase plan
Airship API is extended with Phase and PhasePlan objects which
implemet k8s runtime.Object interface. Phase plan command is
added to airshipctl.

Closes: #262
Closes: #261
Closes: #260
Change-Id: I4c299ec9078af4ace29ab46bd6440f47ae18a094
2020-06-23 13:12:36 +04:00