15 Commits

Author SHA1 Message Date
Anderson, Craig (ca846m)
2daacf5f2a image-builder integration for ISO builds
This introduces airshipctl integration with image-builder [0], which
replaces the existing isogen tool for ephemeral ISO generation.

The airshipctl isogen executor has been updated for building ephemeral
ISOs using the image-builder container. The ability for user-declared
filenames for cloud-init user data and network data was removed, since
the user's only interest is in supplying the relevant overrides, not in
transparent naming coordination with the image-builder container. A new
object is added to the document package to identify the document kind,
label, and key to retrieve data from since this is pattern we will
reuse elsewhere.

Progress flag removed as requsted. Progress is reported directly by the
image-builder container.

Isogen debug flag removed in favor of using log.DebugEnabled()

[0] https://review.opendev.org/#/c/730777/

Depends-On: https://review.opendev.org/c/airship/images/+/730777/
Change-Id: I545004feaf2116f8ffb29faf6f7f7f5fcfe24fff
2020-12-17 14:47:53 -08:00
Dmitry Ukov
aa46185975 Uplift kustomize api and kyaml versions
Change-Id: Id8334a74efb7f1004a36f2bfc0c6eca81380ef4d
Relates-to: #369
2020-12-04 13:43:26 +04: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
Kostiantyn Kalynovskyi
36facd30eb Add new constructor to create documents
The change would allow to build a document object from bytes

Change-Id: I15c13a960b4e989cffa4525c85b8f32f2a51a0e1
Relates-To: #238
Relates-To: #279
Closes: #279
2020-06-17 22:31:24 +00: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
Zuul
8438935cfe Merge "Update Kustomize integration to api/v0.3.1" 2020-04-14 11:36:33 +00:00
Zuul
f520dc1190 Merge "Change Label and Annotate to accept map of string" 2020-04-13 19:07:47 +00: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
Kostiantyn Kalynovskyi
b485f00c58 Change Label and Annotate to accept map of string
The methods are useful when incoming data are not key value pairs,
rather than iterating two times, one time when we call Annotate()
or Label() over the map, and then iterate again inside the function,
it would be better if we could skip iterating the first time, and
let everything to be handled by Annotate or Label functions

Relates-To: #162

Change-Id: Ia9d989a0534d15e4024317c4606a187ac021b751
2020-04-09 16:34:05 -05:00
Yasin, Siraj (SY495P)
c25d223c7b Add copyright for missing files
* added license templates for go, bash & yaml in tools dir
* added a script that will add license information for all
    missing files. Type:  go, yaml, yml, sh
* skip adding license for all files within testdata
* Syntax:
   > ./tools/add_license.sh

* Skip license for manifests folder
* Added one extra line after licene for yaml files
* Added License after Hashbang for bash.
* Add an extra line after hashbang and before license
* Updated the go template to use multiline comments

New Files:
  1. tools/add_license.sh
  2. tools/license_go.txt
  3. tools/license_yaml.txt
  4. tools/license_bash.txt

Change-Id: Ia4da5b261e7cd518d446896b72c810421877472a
Realtes-To:#147
2020-04-09 08:35:59 -05:00
Ian Howell
cdc6ba66f1 [#102] Add function pass forwarding for annotating
* Expose the GetAnnotations method of the document.Document interface.
* Add the Annotate method for adding a single annotation to a
  document.Document
* Clean up the implementation of Label and GetLabels

Change-Id: I94af2380f50848bfcd64af9d5c2c991305d9746f
Relates-To: #102
2020-03-17 12:18:52 -05:00
Stanislav Egorov
5224ed1b62 [#103]: replaced external methods for document interface
Removed external methods from document interface.
Created new methods to supply document labelling.

Change-Id: I4c20ad515999a6c049a2feddafdb62af8e1dfefb
2020-03-16 15:08:19 -07:00
Alexander Hughes
2bf3117197 [#58] Update types for golint
This patch addresses guidance from effective go [0] and golint
failures such as:

pkg/document/document.go:8:6: type name will be used as
document.DocumentFactory by other packages, and that stutters; consider
calling this Factory
pkg/remote/errors.go:9:6: type name will be used as
remote.RemoteDirectError by other packages, and that stutters; consider
calling this DirectError
pkg/remote/remote_direct.go:27:6: type name will be used as
remote.RemoteDirectClient by other packages, and that stutters; consider
calling this DirectClient
pkg/remote/redfish/errors.go:10:6: type name will be used as
redfish.RedfishClientError by other packages, and that stutters;
consider calling this ClientError
pkg/remote/redfish/redfish.go:14:6: type name will be used as
redfish.RedfishRemoteDirect by other packages, and that stutters;
consider calling this RemoteDirect

[0] https://golang.org/doc/effective_go.html#package-names

Relates-To: #58

Change-Id: I6d94da7755c8719bbcc4a77917e283074281309a
Signed-off-by: Alexander Hughes <Alexander.Hughes@pm.me>
2020-03-03 01:41:43 +00:00
Ian Howell
49027f4151 Tighten the restrictions of the linter
This change causes the linter to be a bit more complainy. The hope is
that this will cut down on some of the more pedantic issues being caught
in code reviews, and thus reduce the overall time a change spends in the
review process.

This change includes various changes to the codebase to bring it up to
the new standards.

Change-Id: I570d304bca5554404354f972d8a2743279a0171b
2020-01-10 14:54:34 -06: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