14 Commits

Author SHA1 Message Date
bijayasharma
f9378e74b0 Add phase tree command in package module
* This commit is the smaller patchset from earlier work:
  https://review.opendev.org/#/c/750449/

* This is the first series of patchset

Change-Id: Ib1ff74eba65de7c7c59cf8f4fd26b15e388ba368
Signed-off-by: bijayasharma <vetbijaya@gmail.com>
Relates-To: #296
2021-01-06 19:38:54 +00:00
Sirajudeen
1d34132b87 Added unit test for missing document functions
* Added more unit tests to increase test coverage

Change-Id: I292ddcd1c98ae49b37032a7d6111e063be397de3
2020-07-16 15:36:04 -05:00
Sirajudeen
35d119d3d1 Added unit test for dochelper, config
* added more negative test cases to dochelper, config to
  increase the test coverage

Change-Id: I3179823f9196157e72009ff998cfb8dd348fee1f
2020-07-14 16:48:03 -05:00
Dmitry Ukov
c05286d3f6 Implement document filtering using api objects
Change-Id: I9ac70ed85c949224d091e9e3afead70084b38170
Co-Authored-By: Vladimir Kozhukalov <kozhukalov@gmail.com>
2020-06-23 13:12:33 +04:00
Dmitry Ukov
155db7dca5 Extend document interface with utility methods
* GetGroup, GetVersion and GetKind now can be used to construct GVK
  structs
* ToObject deserialize document to a particular object. This is
  needed to precess custom resources which were defined for airship

Change-Id: I527e2c73288e865455853c5553bffd508a2d2eb6
2020-06-02 15:20:01 +04:00
Kostiantyn Kalynovskyi
aa3067cbb7 Add clusterctl resource type.
This type would allow us to control behavior of clusterctl modules
and choose components we want to install, if we put document of kind
Clusterctl into Bundle. In near future we need to generate deepcopy
methods for this object, so it can be used with kubernetes schema

Relates-To: #170

Change-Id: I2f40a7e9b66e0f7f0bbc8b6874ec45f767416c69
2020-04-29 14:39:30 -05:00
Kostiantyn Kalynovskyi
1969866b0a Add metadata support for clusterctl repository implementation
Change-Id: Ie9285cbba0fb590392b975be1eb2b02b28de56d1
2020-04-29 13:45:54 -05:00
Matt McEuen
e52ed80363 Update Kustomize integration to api/v0.3.1
This updates the Kustomize dependency for airshipctl to
api/v0.3.1, which is the oldest version which will support the
Replacement Transformer plugin.

Some changes were needed to accomodate the fact that various apis
that airshipctl was relying on were moved to kustomize-insternal
packages, namely:
- Integrated with the krusty.Kustomizer to drive kustomization
- Removed the custom plugin loader which leveraged the Unknown type
- Worked around NoFieldError becoming private, inc. removing a test

As a follow on we'll need to re-integrate plugin functionality somehow.

Also, in this release Kustomize has implemented support for the
"config.kubernetes.io/local-config" annotation, which we'd planned
to use to to avoid deploying some documents to the Kubernetes API.
It turns out the semantics are different than we anticipated;
Kustomize also fails to return these docs via document *selection*.
Therefore, this change reverts to an earlier approach which uses
a custom airshipit.org/deploy-k8s label.

Change-Id: I7022e12464ea7b6a3ca8609f99f3699bf8da0edd
2020-04-13 10:06:41 -05:00
Alan Meadows
e2cca32748 Add Redfish Authentication Support
This commit also introduces a dochelper concept.  This provides
some convenience methods to the document pkg that help extract data
from known document types as well as walk document relationships to
discover related information such as BMC credentials for baremetal
hosts.

Once merged, a follow up patchset will leverage these within the
cloud-init code to deduplicate some of these lookups.

Change-Id: Ie6a770ce4b34adbea30281917f0cb2fdc460b4fb
2020-03-27 15:29:07 -07:00
Kostiantyn Kalynovskyi
ad1e160c1a Add selector to filter docs to be deplyed to k8s
By default every document is to be deployed to kubernetes however
some documents may need to be skipped, because they serve only
informational purposes and have no consumers in kubernetes cluster

Change-Id: If2ea5659acb319c15cf3f55e9f3d9e86dc647e9f
Relates-To: #130
Closes: #130
2020-03-26 12:17:00 -05:00
Kostiantyn Kalynovskyi
7a2d01789e Add ordering of the documents
By default kustomize cli orders k8s resources, in a way, that they
can easily by applied to cluster, namespaces and crds first. In this
patch set we implementing same behavior

Relates-To: #131
Closes: #131

Change-Id: I4fc75366627ed361ac1da48e89a35949bcb79801
2020-03-26 09:54:42 -05:00
Kostiantyn Kalynovskyi
c1cce8f9c5 Add single source of Seletors
Also this commit, adds condition to setup testbundle, that ignores
directories

Commit adds new set of functions that allow easy selection of
documents from bundle for different modules.

Relates-To: #61
Closes: #61

Change-Id: I6011203a1f573cbb847e9f57c04aa60bf8278ef1
2020-03-13 16:31:12 -05:00
Kostiantyn Kalynovskyi
746141f6ac [#11] Implement selector kustomize primitive
Introduce Selector object that would serve as adaptor to kustomize,
this provides a layer between kustomize in a way that there is no
more need to import types package from kustomize by other modules.

Change-Id: Ib9e892e8b71d1808e427dd5240e4f313cc366225
2020-03-03 22:31:26 +00:00
Alan Meadows
7eeb529053 Initial commit for document pkg library
This introduces two new interfaces to airshipctl:

* Bundle: represents a Kustomize rendered
collection of your documents that allows you to
iterate over or filter the documents in the bundle.

* Document: a thin wrapper around a rendered
document.

This commit also includes a proposal for a way to
represent YAML test fixtures as testdatafs.go
and a new testdata subfolder within the document
pkg.

Change-Id: I4282b27977617552c25c5ae2c3b7da44e67dd014
2019-10-04 14:22:26 -07:00