303 Commits

Author SHA1 Message Date
bijayasharma
661ae70fd0 Removed capitalization in Error string message
* This commit will removed capitalizaion in Error message
  and follow the Golang code rule.
* Golang errors should not begin with capitalization:
  https://github.com/golang/go/wiki/CodeReviewComments#error-strings

Signed-off-by: bijayasharma <vetbijaya@gmail.com>
Change-Id: I053cfa9e21ad56b0f30e476ec36320cb7cea4da4
2021-01-26 19:42:08 +00:00
Zuul
cfa2bc0ab6 Merge "Add progress bool flag for phase run command" 2021-01-20 17:30:22 +00:00
Vladimir Kozhukalov
b0d171d0ec Remove unnecessary constants
Change-Id: Ib54ce13e552efb4ac8efe00c18956ed65b46d564
2021-01-14 14:51:12 +00:00
bijayasharma
2615afa87b Add phase tree command in cmd module
*This is the smaller patchset from earlier work:
 https://review.opendev.org/#/c/750449/

* This is the second part of huge PS
* First: https://review.opendev.org/#/c/762386/

Change-Id: I8e7a13445f73b46a8b83f79711551a6fd5f5ce1f
Relates-To: #296
2021-01-08 13:26:08 +00:00
Zuul
ea0a89a881 Merge "Introduce cluster get-kubeconfig command" 2020-12-18 18:30:46 +00:00
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
9cde986a31 Introduce cluster get-kubeconfig command
This command will be used to retrieve kubeconfig from from leveraging
cluster or from document model. Particular implementation will be
added in further commits to make it easier for review.

Change-Id: If9e35dd90fdfcad6fa60a3cc4fab76ec1cb57f62
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Related-To: #374
2020-12-16 16:13:42 -06:00
Zuul
b6d52343dc Merge "Allow to perform phase render using document entrypoint" 2020-12-16 16:51:46 +00:00
Kostiantyn Kalynovskyi
a6987107bd Allow to perform phase render using document entrypoint
In current setup, we rely on executor to perform render operation,
however there are many usecases, when we want to have a simple
`kustomize build` performed against document entrypoint in phase.
Now this will be a default behaviour and if a user would like
executor to perform rendering to actually understand what it's
doing, he will be able to specify --executor boolean flag.

Relates-To: #403

Change-Id: I181830f9814ff48a19ba0a1284e89900187bc7d8
2020-12-15 11:28:16 -06:00
Vladimir Kozhukalov
be3ce0917a Add progress bool flag for phase run command
* Phase executors accept run options which
   have progress boolean field.
   `airshipctl phase run` must be able to set
   this options from the command line flag.

Change-Id: I0645680ae68bf8690800aac5f3837ca78909ade0
2020-12-10 20:46:38 +03:00
Dmitry Ukov
653a553d1c Add plan subcommand group frame
Change-Id: Ie90b88ed47fb0050b874eecadafeef3d3fc5f3b1
Relates-To: #395
Relates-To: #385
2020-12-04 17:29:09 +04:00
Sirisha Gopigiri
07b66906ad Cmd changes to add regex support
Added support to accept regex parameter as part of `airshipctl secret
generate encryptionkey` command. This allows user to pass regex parameter
so that the passphrase generated matches the regex.

Relates-To: #398

Change-Id: I3914e6a896bb669e3974fe67c466336e15989a8d
2020-11-18 11:32:28 +05:30
Ruslan Aliev
f7217245a7 Add --overwrite option to config init cmd
Currently airshipctl will overwrite an existing config file
by default during config init execution. This patch adds an
appropriate flag to explicitly control whether the user wants
to overwrite an existing file or not.

Change-Id: I9f4756b98e9d1245145809aed203974e99feb662
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2020-11-14 00:52:37 +00:00
Zuul
e14314b624 Merge "Refactoring masterpassphrase cmd to encryptionkey" 2020-11-12 23:43:32 +00:00
Zuul
df3764b7ac Merge "Remove document plugin subcommand" 2020-11-12 03:03:33 +00:00
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
Zuul
084ed45ef3 Merge "Adds command objects for cluster check-certificate-expiration" 2020-11-11 10:09:30 +00:00
Sirisha Gopigiri
62ae2133ba Refactoring masterpassphrase cmd to encryptionkey
The below code changes the `airshipctl secret generate masterpassphrase`
command to `airshipctl secret generate encryptionkey`. This command will
be further enhanced to support regex fields while generating encryption key.

Relates-To: #398
Change-Id: I87626cb410fd19beeb8cd23a5b86d61c48b63e63
2020-11-11 08:59:13 +00:00
Zuul
788d846b01 Merge "Introducing subcommand cluster check-certificate-expiration" 2020-11-09 21:52:39 +00:00
guhaneswaran20
dd03db0916 Adds command objects for cluster check-certificate-expiration
Reference:- https://hackmd.io/aGaz7YXSSHybGcyol8vYEw
Previous work:- https://review.opendev.org/#/c/755291/

Below is the complete ordered flow of PS for the feature:
https://review.opendev.org/#/c/760498/ - Cobra command
https://review.opendev.org/#/c/760501/ - Command Objects
https://review.opendev.org/#/c/760504/ - TLS check
https://review.opendev.org/#/c/760517/ - Kubeconf check
https://review.opendev.org/#/c/760532/ - Node check
https://review.opendev.org/#/c/760537/ - Combined Unit tests

Change-Id: Ie0fac7799724b7fb2255e387b7e90b26159bda5c
Relates-To: #391
2020-11-06 13:14:21 +00:00
guhaneswaran20
260d6905a4 Introducing subcommand cluster check-certificate-expiration
This command runs through the cluster and reports expirable
entities

Reference:- https://hackmd.io/aGaz7YXSSHybGcyol8vYEw
Previous work:- https://review.opendev.org/#/c/755291/

Below is the complete ordered flow of PS for the feature:
https://review.opendev.org/#/c/760498/ - Cobra command
https://review.opendev.org/#/c/760501/ - Command Objects
https://review.opendev.org/#/c/760504/ - TLS check
https://review.opendev.org/#/c/760517/ - Kubeconf check
https://review.opendev.org/#/c/760532/ - Node check
https://review.opendev.org/#/c/760537/ - Combined Unit tests

Change-Id: I7e20a6d3821877e16a5bc2cb8de3dd3c8b7850e2
Relates-To: #391
2020-11-06 05:28:47 +00: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 9a608de653ffe1ce8f60b5f16249e2152b3522ad.

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
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
f60458a6a8 Merge "Remove context from BMH object." 2020-10-28 20:41:00 +00:00
Kostiantyn Kalynovskyi
690d8d88c1 Remove context from BMH object.
This is first step in refactoring remote package to support
future inventory interface, also relates to remote-direct
executor, as it simplifies usage of Host objects

Relates-To: #362

Change-Id: Ief2fece134a465916ce461960cd7d16c9e237eb7
Relates-To: #362
2020-10-26 10:25:44 -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
Zuul
ab6d9ed311 Merge "Support rotation of svc account tokens" 2020-10-19 15:41:32 +00:00
Guhan Eswaran
b7dd46c4e6 Support rotation of svc account tokens
This patchset introduces airshipctl command
- airshipctl cluster rotate-sa-token which basically rotates SA tokens

Previous work: https://review.opendev.org/#/c/749470/

Change-Id: Ibe932fa8d2831979e5b2ac2781f746e8ec2fdc3c
2020-10-19 07:06:58 +00:00
Ruslan Aliev
0c870e5244 Remove clustertype-related functions
We don't use clustertype anymore, so all the related functions must
be deleted or adjusted as well as appropriate config fields.

Change-Id: I3931fdc71d4318e916f8bbc2d94e062c9df5f641
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #349
2020-10-16 11:31:58 -05:00
Ruslan Aliev
a6363f1c1e Run image build command like a phase
We perform almost the same activities prior calling createBootstrapIso
function like we do that in phase executor, also image build command
now is techically outdated since it doesn't work because it fails with
"phase document was not found" error. This patch removes unnecessary
functions like GenerateBootstrapIso and runs image build command in
a phase way. Test coverage increases slightly (by 0.2%) by removing
partially duplicating code which was not tested properly. Minor bug
fixes included.

Change-Id: I545004cea721164838b296ae647a7651cde248ff
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2020-10-13 17:48:55 -05:00
Vladimir Kozhukalov
0dc4ab7491 Replace PrimaryRepositoryName with PhaseRepositoryName
Change-Id: I2276a3b3ea50b8e81dd240815cd00a0a2a2af96e
Relates-To: #356
2020-10-12 15:28:27 +03:00
Zuul
76e4d3f48c Merge "Remove kubeconfig from config struct" 2020-10-07 21:57:49 +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
Zuul
64ef1f9ef1 Merge "Adding encrypt and decrypt subcommands to secret command" 2020-10-07 19:21:18 +00:00
uday.ruddarraju
8fccf09753 Adding encrypt and decrypt subcommands to secret command
Design document: https://docs.google.com/document/d/1EjiCuXoiy8DEEXe15KxVJ4iWrwogCyG113_0LdzcWzQ/edit?usp=drive_web&ouid=102644738301620637153

This is the third of multiple patchsets to support
encryption and decryption in airshipctl

Complete feature: https://review.opendev.org/#/c/742695/

Change-Id: Ibe1060a83d11233cccaa3d3989765968a4dbed76
2020-10-06 08:37:56 -07:00
Ruslan Aliev
07c44eedb7 Add ability to perform baremetal operation against all nodes
If no name or label filter specified baremetal operation will
be performed against all nodes with baremetalhost kind. Also,
baremeral cmd code was refactored and combined, which allowed
to remove duplicated code and slighlty improve test coverage
by reducing the number of untestable lines.

Change-Id: Ieadafdb9f55b995d4b47aeff1dc7233325f3191c
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #361
Closes: #361
2020-10-05 00:29:40 -05:00
Ruslan Aliev
cc46ae2ef4 Fix unit test for showProgress function
Sometimes unit test for showProgress function fails if progress bar
was not finished before refreshing event occurs, so progress bar
prints to io.Writer its intermediate state (which is normal since
in regular terminal the output everytime overwrites by carriage
return), so expected and actual output become different. This PS
changes the concept of testing this function and adds the error
tracking of showProgress execution. Some other minor changes included.

Change-Id: I78b4fa9674d4412fa83c1e9320b686923cbe8084
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2020-10-02 01:52:59 -05:00
Zuul
2a47c00f00 Merge "Add progress bar and improve cmd output for image build command" 2020-09-30 14:34:03 +00:00
Zuul
30914340da Merge "Refactor cluster status command" 2020-09-28 23:01:59 +00:00
Zuul
7502da5c34 Merge "Add document pull step to gate script runner" 2020-09-28 22:45:02 +00:00
Sirajudeen
3e4c228638 Add timeout flag for phase run in cli
Syntax:
	airshipctl phase run <PHASE_NAME> --timeout <time_unit>

Exmaple:
	airshipctl phase run initinfra-ephemeral --debug --wait-timeout 1000s

Change-Id: Ic8c699f5302eb482f32aee0e7d7c593df2ed7d3b
2020-09-28 16:58:18 +00: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
Zuul
484a4b1549 Merge "Update metadataPath using set-manifest in cli" 2020-09-28 14:41:01 +00:00
Zuul
14cf69d9eb Merge "Redirect airshipctl log output to stderr" 2020-09-25 09:59:43 +00:00
Ruslan Aliev
d8a6139e81 Add document pull step to gate script runner
Currently we don't test document pull step by rewriting
manifest_directory variable as current source path, which
makes a mess in target_path, manifest_path and related paths
(concatenation of target_path+manifest_path won't return
an existing and proper location). This patch organizes
mentioned variables and enables document pull step which
starts working properly. The latest repo state used as
git source for this command.

Change-Id: I5abce73877441c7529f2f77add79cf410e2226d8
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2020-09-25 00:39:28 -05:00
Ruslan Aliev
94d99c85d0 Refactor cluster status command
This patch moves all cluster status functionality from
cmd level to pkg level as well as unit tests, making code
cleaner and improving actual test coverage.

Change-Id: Ia811887b684b2129ca30dd90b5afc72e726271ff
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2020-09-24 20:06:00 +00:00
Sirajudeen
2769c62c8a Update metadataPath using set-manifest in cli
* Added metatada-path as a flag to set-manifest

Change-Id: Id26f20c4a6350b4aae34da850bbfcab42cbe9f21
2020-09-24 19:33:15 +00:00
bijayasharma
e99adf50ad Removed K8s Authors
To make it consistent, this commit will remove K8s authors
from copyright section.

Change-Id: I4e670cc76ea1feb6456965707a8deff258e5f215
2020-09-23 11:36:43 -04:00
Ruslan Aliev
2f5402ae80 Remove phase apply command
Command phase run will be used instead, so phase apply became no
longer needed.

Change-Id: I8bdbd6bcad7efbb03632978d8952700fc39d55ba
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2020-09-23 01:42:16 -05:00