Commit Graph

76 Commits

Author SHA1 Message Date
Kostiantyn Kalynovskyi
7c9dd85eeb Fix docker stdin write.
Without this commit airship can hang endlessly waiting for stdin
to be open. Apparently it depends on the containerd and docker
server version. This commit adds asnyc writing to stdin, this way
we don't have to wait for write to complete before starting docker
container. The code uses similar approach to upstream docker cli
implementation.

Related-To: #513

Change-Id: I2e6d4cbe37df1f8cba356af79c1c2cf18438e86c
2021-04-07 14:37:17 +00:00
Ruslan Aliev
3ccafd9d0f Remove deprecated options for phase/plan run cmd
There are some debries left after removing --kubeconfig flag
from support, this patch cleans them up.

Change-Id: Iabdd6bcbc59d169bf162c9cddb3cb264fb88a3f7
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2021-03-24 13:39:13 -05:00
Dmitry Ukov
1a0ba5647d Uplift cli-utils and cluster-api
Change-Id: I9b46421812dd15c01a250e6102f9c132ce82dd42
2021-03-02 21:52:50 +04:00
Kostiantyn Kalynovskyi
ea7d7eb86a Bump clusterctl libraries to v0.3.13
Change-Id: I77b5d6fef838ad6ef3a2b33a907073c8a3eed10f
2021-02-25 16:08:16 +00:00
Vladimir Kozhukalov
57f2885f47 Bump kustomize version
kustomize/api v0.6.5 => v0.7.2
 kustomize/kyaml v0.10.0 => v0.10.6

Change-Id: I944d1224bfc2a2ae9608438d655b61381d98b8c7
2021-02-25 05:13:24 +00:00
Kostiantyn Kalynovskyi
769e164b59 Implement airship container type
This will enable airship to run containers in privileged mode
as well and to specify commands to be executed.

Change-Id: I663eb55547bb821f26a9071c24d08166a3b3d56b
2021-02-08 17:59:11 +00:00
Ruslan Aliev
d632a5de5f Enable voting for golint job
Since golint job was fixed and it's essential to maintain
code standards this job should have voting status.

Change-Id: I623171ce89b3906eac30e11fa3d7ebeb2725372b
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2021-01-20 21:47:35 -06:00
Ruslan Aliev
f902491783 Fix golint check
Currently golint check zuul job does nothing because of
bug inside tools/golint script. This patch fixes this issue.

Change-Id: Iaab1741b2a3f5f61c49549d8e4ce88be6212d570
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2021-01-14 10:38:10 -06:00
Sirisha Gopigiri
91b2164a4f Adding Regex support for Templater
Adding go code to templater to support generation of strings
based on the regular expression passed.

Closes: #438
Change-Id: Ife0c4f8d5dd8032408875c73ba098919470be9e9
2021-01-04 18:18:27 +05:30
Sirisha Gopigiri
247047f2a3 Update Sprig library and add Uint32 support
Below code updates sprig library from v2.22 to
v3.2. Also added support for uint32 coversion.

Change-Id: I263cf6f1915d2f892f6f77efdcdd477ad902f527
2020-12-21 17:40:11 +05:30
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
Ruslan Aliev
d7ca864295 Move mockContainer implementation to testutil
Currently mockContainer implementation is located under
pkg/bootstrap/isogen and it's not possible to import it from
other packages. This patch moves it to appropriate new package
under testutil.

Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To : #432

Change-Id: I36510e8e065434de597e7316dfbe51da0825d343
2020-12-11 14:09:41 -06:00
Dmitry Ukov
aa46185975 Uplift kustomize api and kyaml versions
Change-Id: Id8334a74efb7f1004a36f2bfc0c6eca81380ef4d
Relates-to: #369
2020-12-04 13:43:26 +04:00
Zuul
0c2edba495 Merge "Revert "Encrypt and decrypt using sops"" 2020-11-05 22:32:28 +00:00
Sirisha Gopigiri
f705ff0000 Revert "Encrypt and decrypt using sops"
This reverts commit 9a608de653.

Requesting revert because of the sops+gpg testcase failure issues. The failed testcases are impacting airship-airshipctl-lint-unit zuul gate.

For more details please refer to https://github.com/airshipit/airshipctl/issues/378

Change-Id: I60f6b5daaeebc038b68556c60413b3d0c6db6d68
2020-11-05 13:53:15 +00:00
Ruslan Aliev
569d3c3872 Extend clusterctl client interface with GetKubeconfig function
Appropriate function will allow us to retrieve kubeconfig using
native function from cluster-api.

Change-Id: I5b3c9995c03228245b4a76e7034fba99ac03d9a6
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #374
2020-10-27 15:11:01 -05:00
uday.ruddarraju
9a608de653 Encrypt and decrypt using sops
Design document: https://docs.google.com/document/d/1EjiCuXoiy8DEEXe15KxVJ4iWrwogCyG113_0LdzcWzQ/edit?usp=drive_web&ouid=102644738301620637153

Demo readme: https://hackmd.io/@WE7PUWXBRVeQJzCZkXkOLw/ryoW-aOLv

This patchset comprises of:
- package library to interact with sops
- integrate airshipctl encrypt/decrypt with sops

Change-Id: I2ca3ff3c8661d146708084728cb3f87365a4f39e
2020-10-23 02:27:45 -07:00
Sirajudeen
afe9121169 Uplift cli-utils from 0.18.1 to 0.20.6
* uplift of cli-utils had changes with signature of Applier.
  So had to update the impacted go code and cleanup the
  unwanted parameters.

Change-Id: I6f3018d1fd4cac2e1a328e50c44ad0f51bb0e16f
Closes: #367
2020-10-21 18:15:03 +00:00
Ruslan Aliev
fc33287204 Remove kubeconfig from config struct
Change-Id: I5ab8722dd151d9e652e0b20e1d82988cd98505af
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2020-10-07 14:35:07 -05:00
Kostiantyn Kalynovskyi
8b86f156b0 Uplift cluster-api go package to 0.3.10
This commit uplifts cluster-api go package to 0.3.10
In new version we are now allowed to skip var subsitution completely
that is why TestAdditionalVariableSubstitutionRepoClient is changed
to relfect that.

Also some of the cluster-api constructor functions has been changed,
and we are changing our factory injection methods as well.

Change-Id: I24aa849271eb7109eb4f7d53a352ea3bb20a21a5
2020-10-05 12:21:17 -05:00
Arvinderpal Wander
e909aff0ad Removes BMH specific logic in the airshipctl move command.
Also removes pkg dependencies that were introduced by the BMH logic.

Change-Id: Ib1235b5a8043f2f53d90a818fff25df4fdb9ec20
2020-10-03 07:52:21 -07:00
Ruslan Aliev
ec51a71181 Add progress bar and improve cmd output for image build command
This patch provides the ability to show progress bar using
container logs (ubuntu/debian based only).

Change-Id: I86eebe4d368d81c4685fb27ca31b86cbb3dea08d
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #278
2020-09-28 16:11:34 +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
Zuul
d3ff9bc814 Merge "Add poller" 2020-08-20 22:04:23 +00:00
Ian Howell
52153fc65d Uplift cli-utils to 1.18.1
Change-Id: Ib1f066f897735387c99a9ee99004ea2284c1a55a
2020-08-19 15:58:17 -05:00
Ruslan Aliev
d7b9a8c8b8 Add poller
Poller provides an ability to implement status reader,
which is an object that can fetch a resource of a specific
GVK from the cluster and compute its status.

Change-Id: Ia6f5de81a0ac645903308947df56664a838076dd
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2020-08-19 13:47:07 -05:00
Stanislav Egorov
a3d90e04ee Package version bump for kustomize api
Closes: #325

Change-Id: I8bf66a07962d1396053a7fb9c996730d984401a4
2020-08-17 20:51:30 -07:00
Ian Howell
a8bdae6c9a Uplift cobra to v1.0.0
This commit uplifts cobra to the latest version. It also includes
various changes accounting for differences in the new version.

Change-Id: I0d1ed3ecd3b8d406428fded92abf6e782951d005
2020-08-14 09:19:34 -05:00
Kostiantyn Kalynovskyi
6a2fba6f21 Add events package
The package will have Event object, that would represent any event
that airshipctl can have, also this package provides Processor interface
that is to be used to process, print, or track progress of the executor
runners

Change-Id: I184408f7b6130653cdbabbe5e5adaac2dd758663
2020-07-07 09:44:22 -05:00
Arvinderpal Wander
3edf72eeb6 Adds support for clusterctl move of capi and bmo resources
from ephermeral to workload cluster.

Change-Id: Ib6d31282056468d5a153177dfb33ce4a55514ab3
2020-06-04 10:19:41 +00:00
Drew Walters
0d7dc4de24 Add automated CLI documentation
This change creates a tool that generates CLI documentation each time
`make update-golden` is executed.

Change-Id: I4bcdf299cd424f4cff1ecf6503822d304e9a3947
Signed-off-by: Drew Walters <andrew.walters@att.com>
2020-05-13 19:43:10 +00:00
Kostiantyn Kalynovskyi
5f920fe9be Skip variables substitution in clusterctl integration
This commit overrides default components interface behavior by
allowing to inject SkipVariables parameter, see L#37 at components_client.go.

To do this, we pass new Repository Client interface which is built on top
of the clusterctl implementation with one simple injection of SkipVariables
Please see related issue for more details

Relates-To: #201
Closes: #201

Change-Id: If068caa8308e39c9ee23d07f189bad26be04d5cf
2020-05-06 18:13:45 +00:00
Dmitry Ukov
c458e8cde4 Add template based generator plugin
Plugin is responsible for resource generation based on template
(go template format is used) supplied to its configuration.
Go template can use an object (map) specified under 'spec'
configuration parameter.

Change-Id: I8c1b7dc5676bfff2f9b1a47f6433177ae796a15f
2020-04-29 23:38:58 +04:00
Kostiantyn Kalynovskyi
0ab9b6d7ea Add impl of Repository interface from cluster-api
Implementation would allow us to build our own cluster-api components
based on airship document bundle.

Relates-To: #170

Change-Id: Ic029fd07ca5221747e49c3cf48e80a3e279ac1f0
2020-04-27 13:44:14 -05:00
Kostiantyn Kalynovskyi
f34c900ecc Uplift cobra dependency to v0.0.6
This version is required to integrate with clusterctl.
Starting v0.0.6 cobra Execute() method returns ErrSubCommandRequired if
command is executed when its not runnable (Run or RuneE == nil), hence
all tests that invoke such commands need to be either remove or adjusted
to expect these errors

Change-Id: Ia7935c1bf83d47b3a7d3a6c03d1989d53ad57a9a
Relates-To: #187
2020-04-23 10:47:46 -05:00
Ian Howell
7c6de22354 Uplift go-git
The go-git module (and helper modules)  recently moved from
`gopkg.in/src-d/go-git` to `github.com/go-git/go-git` [0]. This commit
switches to the new module, as well as uplifts from v4 to v5.

[0] https://github.com/src-d/go-git/issues/1295#issuecomment-592965250

Change-Id: I2e73ba7bb1220a3c75c0d81aa5ab0f1f13479161
2020-04-14 09:07:28 -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
Matt McEuen
e690a4c453 Update Kustomize to v3.3.1
This updates the Kustomize module dependency to v3.3.1,
which has replacement functionality required by the Replacement Transformer
plugin, among other enhancements.

Change-Id: I058114c398464394cfb6b2626cb475d763c1bacc
2020-04-03 12:11:33 -05:00
Ian Howell
77ebd891a2 Cluster Status library tools
This adds the StatusMap type, which can be used to gather the Status of
a given kubernetes resource. A StatusMap can be created from a
document.Bundle and represents all possible Statuses for all
CustomResources, and the conditions that must be met for those statuses
to be valid.

Relates-To: #73
Change-Id: If2cba0bb9890fe28feff0c890bb8036489196fc4
2020-03-27 16:09:15 -05:00
Ian Howell
8495e83cce Uplift dependencies on kubernetes to 1.17
This change removes the dependencies on arbitrary 1.16 SHAs in favor of
depending on a tagged 1.17 version of various kubernetes packages.

Change-Id: I5c99e431b1d1b27502aeb0ad13b4a84c25011420
2020-03-26 11:48:08 -05:00
Dmitry Ukov
2817df8482 Ensure node power state ON/OFF for Reset command
Change-Id: Icc6b18b4694a17ab2f8e0bf1112e41a1d18a5b00
Relates-To: #54
Depends-On: https://review.opendev.org/713622
2020-03-19 09:53:58 +04:00
Dmitry Ukov
ae22635081 Fix go get for airshipctl module
k8s.io/kubernetes package is not needed any more since kubectl cli
support has been removed. Therefore we do not need replacements for
kubernetes modules any more

Change-Id: I5d9229c0011881afe8957f0f5957985d5c0b8041
Closes: #63
2020-03-13 07:25:19 +00:00
Alexander Hughes
51e07c57d5 [#70] Remove unnecessary kubectl subcommand
kubectl subcommand should not exist as part of airshipctl and is
being removed.

Change-Id: Ie52e8c0f32fd10593e70b68462d9ce95696b2a4d
2020-03-12 12:17:14 +00:00
Ian Howell
e8892c4e99 [#58] Add golint
This adds the golint linter to the `make lint` target. As of this
commit, the results from golint are not counted as errors. Further
changes to the code will be required to bring it up to golint's
standards, at which point we will allow golint to cause failures for the
`lint` target.

Change-Id: I34134e3deb080e6da0bc0aac299caca6c3b5d0a9
2020-02-26 11:15:10 -06:00
Ian H. Pittwood
7437bb2972 [#13] Add document pull command
Adds `airshipctl document pull` command that will check the current
manifest specified by the config and download it to the config specified
target path.

Change-Id: I493564c056225ff1e19f5d1aecb8c187683529ec
2020-02-12 11:01:11 -06:00
Alexander Hughes
a8cc7ed2bf Update redfish module URL
Change-Id: I2fe1c8dc47a260cf17712ba72fae436e4ddf5da0
2020-01-14 16:03:04 -05:00
Kostiantyn Kalynovskyi
b43e4e4fea Add abstraction to git repositories
This can be used to pull documents from git repositories defined
by config module in manifest

Change-Id: Ib25cd7e263b6de56bc107607c081e2b02281b8b5
2020-01-08 19:43:59 +00:00
Dmitry Ukov
592850934f Bump kubernetes 1.16.3 as a main dependency
Change-Id: I564745a0d53367fa3b3087107610cec43272cf7c
2019-11-15 13:24:11 -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
Kanwar Saad Bin Liaqat
3bf54274c3 Bootstrap redfish Remote direct
This commit implements redfish remote direct subcommand
under bootstrap.

Change-Id: Idf97445f6fa59a77145eae1edaa15b1d22723f19
Signed-off-by: Kanwar Saad Bin Liaqat <kanwar.sbl@gmail.com>
2019-11-01 02:41:38 +02:00