14 Commits

Author SHA1 Message Date
Dmitry Ukov
9c69138990 Remove document plugin subcommand
This change finalises shift to new version of kustomize plugins

Change-Id: Ie47f42a9e2c4dc03fc4dca437020ad71a564d894
2020-11-11 14:59:14 +04:00
Ian Howell
3410000626 Add unit tests for missing Bundle functions
This increases the unit test coverage of the pkg/document package

Change-Id: I037a66879fc4ce1f31e394dc2bda5ca61391c3e2
2020-08-05 09:31:09 -05:00
Vladislav Kuzmin
d7101bcb2c Refactor environment module
Move code from environment module to util and document
modules to prevent circular dependencies.

Relates-To: #264

Change-Id: Ifec9ab3f1ada01cc662e655ff4a6f2cfebe4150a
2020-07-31 14:03:39 +04:00
Kostiantyn Kalynovskyi
edf09b0fd5 Add Append method to bundle interface
This method would allow us to append bundle with new documents

Change-Id: I201a2a0f2e7f707556a53495538c0f075ce6fe17
Relates-To: #238
2020-07-07 14:45:26 +00: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
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
Dmitry Ukov
09ef460e31 Add filtering method for document bundle
SelectByFieldValue method returns new bundle with documents which
values referenced by JSON path comply with function passed as input
argument to the method

Related: #14
Change-Id: I31bb6beee96b0d65719b6976caac63e54c65dcd2
2020-03-24 23:23:58 +04:00
Stanislav Egorov
3eacfc6c71 [#102]: removed methods for bundle interface
Removed two unused methods from bundle interface.

Two other methods are used internally and there is no need to keep it in the interface.

Change-Id: I5d7999e4b2c83dd43025442e5549ac7826009a87
2020-03-16 15:08:19 -07: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
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
Ian Howell
d775b2159a This updates the current unit tests for testify
This commit removes any assertion from Go's "testing" package,
preferring instead to use an assertion from the testify package. All
tests now have uniformity.

This also decrease the number of iterations in the password generation
test, decreasing test runtime tenfold

Change-Id: I8799110e93dfa19bebe9050528e865b4c991c3df
2019-11-07 12:15:06 -06:00
Kostiantyn Kalynovskyi
3ca3a34fbf Add NewTestBundle function to testutils package
This commit adds small helper function in testutils module, that would
help with testing modules that relay on bundle interface. The function
will take directory with testdata as a parameter, and load all files in
it into its fakefile system, allowing bundle to get those files and
render required yaml/kustomize files storing them as airship documents
in the returned bundle.

Change-Id: Ib55180cc720c42cab77626601d9ec0d6151b8454
2019-11-04 18:28:13 +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