339 Commits

Author SHA1 Message Date
Zuul
853b16997a Merge "Remove defaults from Config object at runtime" 2021-03-22 16:40:09 +00:00
Matthew Fuller
585af5a516 Remove defaults from Config object at runtime
This change fixes a bug where the default values that are
populated during an `airshipctl config init` were getting
mixed in with user specified values at runtime. For example,
a user with two contexts defined in their airship config
file would actually see a third phantom context with default
values in the output of `airshipctl config get-context`.

Also fixes a number of the config cmd and pkg unit tests that
were affected by this bug.

Change-Id: Iac591d4c2a616090028eb730576478edefb82544
Closes: #447
2021-03-19 17:31:02 +00:00
Zuul
86bd2c9984 Merge "Get-kubeconfig return all cluster contexts" 2021-03-19 01:20:48 +00:00
Kostiantyn Kalynovskyi
f24bf00d17 Get-kubeconfig return all cluster contexts
Now if we run `airshipctl cluster get-kubeconfig` without args
it will return kubeconfig for the entire site, which will have
contexts for every cluster defined in cluster map.

Relates-To: #460
Closes: #460

Change-Id: Icf1f09724a5c60ac520b1dbcbda69c3280ac4c7e
2021-03-17 19:27:14 +00:00
Zuul
7277a8492a Merge "Remove clusterctl command related functionality" 2021-03-17 17:48:49 +00:00
Zuul
98c50e1464 Merge "Revert "Adding commands to get and set encryption configs"" 2021-03-17 00:22:09 +00:00
Zuul
2d9de5f8b6 Merge "Revert "Adding encrypt and decrypt subcommands to secret command"" 2021-03-16 17:51:26 +00:00
Kostiantyn Kalynovskyi
6cae709dba Remove clusterctl command related functionality
It is not used anywhere anymore as commands themselves were
deprecated and removed in favor of clusterctl move and init
executors.

Change-Id: I526f75d95b70754034f0846edfc9d3e468648ced
2021-03-16 15:05:14 +00:00
Zuul
442f9965fb Merge "Remove deprecated cluster init/move commands" 2021-03-16 04:48:32 +00:00
Kostiantyn Kalynovskyi
6207e2c24d Add multiple kubeconifg sources to ClusterMap
Change ClusterMap API object to support multiple kubeconfig sources
for a cluster. If one kubeconfig source fails, kubeconfig builder
will not fail and move on to the next one. This behaviour will allow
to support cases when ephemeral cluster is not accesible anymore or
when target cluster is not yet accessible.

For more information please read issue #460 in airshipctl github

Relates-To: #460
Related-To: #460

Change-Id: I7cd32f78cd7c4ad8814eac357424c24216f40d76
2021-03-10 18:22:30 +00:00
Ruslan Aliev
159cddb269 Revert "Adding encrypt and decrypt subcommands to secret command"
This reverts commit 8fccf09753663fd83e07c01de38d3ca67d9a08d1.

Reason for revert: This change is no longer needed and never used, specified commands aren't implemented. All the encryption logic was implemented in this [1] PS chain.

[1] https://review.opendev.org/q/topic:%22generator_sops_encrypter%22+(status:open%20OR%20status:merged)
 

Change-Id: I94737137707cea63c05573147ba3bde808bf6f00
2021-03-10 11:33:49 -06:00
Ruslan Aliev
e4436ca36d Revert "Adding commands to get and set encryption configs"
This reverts commit 694067492cfedd5e7b369b396bfce9923c0ca3a1.

Reason for revert: Encryption configs inside airship config are
no longer required. Encrypt feature was implemented different way.

Change-Id: I1c8feec75000402e314e815e4832ce740f0e1254
2021-03-10 11:30:32 -06:00
Zuul
2351051ffd Merge "Remove image build command" 2021-03-10 08:23:00 +00:00
Scott Williams
fb997d49e1 Error messages checked expected value
Modified the test framework so that error messages are actualy checked
for an expected value (instead of previously only checking if there was
an error returned)

Closes-Bug: #451
Change-Id: I9c4b172a705a7648467afe41346c389c503e764b
2021-03-03 12:00:36 -06:00
Zuul
12d4b63a3d Merge "Phase Validation: cmd changes to support Phase Validation sub command" 2021-03-03 16:52:23 +00:00
Zuul
046e8fb05a Merge "Don't allow to run baremetal actions without flags" 2021-03-03 05:43:29 +00:00
muly
b0eabe544b Phase Validation: cmd changes to support Phase Validation sub command
Relates-To: #330

Change-Id: I8e45696723823d568e2f2eac8de65b38d30c09c3
2021-03-02 13:19:45 +00:00
Vladimir Kozhukalov
ab5ff1076f Remove image build command
We use phases for building the ephemeral ISO image, so
 a user can use `phase run` command instead. It is better
 to remove `image build` subcommand to avoid support of
 an unnecessary piece of code.

Change-Id: Ife9b5fdebc3cdfd5dac3ecccc8fef55811741ce8
Closes: #473
2021-03-02 13:08:15 +03:00
Ruslan Aliev
68e76a9059 Extend cluster get-kubeconfig cmd functionality
This PS will allow us to retrieve kubeconfig from different
kind of sources.

Change-Id: I31381cf466c58373efda40d06587e34bef411c68
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2021-03-02 00:22:45 -06:00
Kostiantyn Kalynovskyi
7dfb0eb98c Don't allow to run baremetal actions without flags
With this change we will be sure that no commands against bmh
hosts will be applied without selector flags specified, now if you
want to target all hosts in inventory you must specify --all flag

Relates-To: #364
Related-To: #364

Closes: #364
Change-Id: I0d615ea226528162e07acc96fa61b26e031145aa
2021-02-24 20:01:15 +00:00
Kostiantyn Kalynovskyi
b5b68b3d0f Remove deprecated cluster init/move commands
Instead of these commands users should run apporopriate phase
linked to clusterctl executor

Relates-To: #463

Change-Id: Iecb7320668fa98cfe322cbf922eb77e9490acbdc
2021-02-24 15:17:10 +00:00
Alexey Odinokov
f2dc2ca3f6 Allow airshipctl phase render to display encrypted secrets
Relates-to: #453
Change-Id: I150a48cbec5c87943ed6c07a8ef8d562437fda46
2021-02-16 19:27:23 +00:00
Ruslan Aliev
7bf93ba699 Implement cluster list command
Required for document validation script.

Change-Id: I555173a445278b31ef51ebf831a79e63446a19bc
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2021-02-08 23:54:57 -06:00
Ruslan Aliev
d1c7913ed3 Add cluster name filter for phase list cmd
This patch implements ability to filter phase by given
cluster name.

Change-Id: I4eb95f9f75c57eff4ae8eb41c608c6f6d7fa009c
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2021-02-05 17:09:44 -06:00
Kostiantyn Kalynovskyi
6807547ab2 Add ability to render different document sets
Now we would be able to render phase bundle, executor bundle
and config bundle. Config bundle will contain documents such as
phases and executors.

Relates-To: #459
Closes: #459

Change-Id: Ia6b9196dfb3d8fb3264fef676c975ccc32883fee
2021-02-04 17:40:35 +00:00
Zuul
621b7758e0 Merge "Link cluster get-kubeconfig cmd with appropriate functionality" 2021-02-01 19:19:06 +00:00
Zuul
897faf2d51 Merge "Implement plan run command" 2021-01-28 21:32:27 +00:00
Zuul
71e038a5c5 Merge "Removed capitalization in Error string message" 2021-01-28 15:25:33 +00:00
Zuul
4ea1b0e2f0 Merge "Add InventoryRepoName field to config" 2021-01-28 06:13:58 +00:00
Dmitry Ukov
178b0eff3e Implement plan run command
Change-Id: Ie627ce670cd2b19d6999dc7c7a7a6dc12b25cace
Closes: #395
2021-01-28 10:13:05 +04:00
Zuul
a2fd0b7b76 Merge "Add inventory interface and cmd line integration" 2021-01-28 02:34:30 +00:00
Dmitry Ukov
069e4069ce Implement plan list subcommand
Change-Id: Ibcd7dbf6dc8cd9d0b018c148017244526651d8ba
Closes: #385
2021-01-27 10:19:54 +00:00
Dmitry Ukov
c36a8ea022 Introduce generic table printer
* Table printer is based on cli-utils approach
* Rename 'phase plan' command to 'phase list' and print all Phase
documents from model instead of just printing PhasePlan object

Relates-To: #358
Change-Id: If3c5e2463e32f6794af4c82c12955a45583fce80
2021-01-27 14:10:31 +04:00
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
Ruslan Aliev
899bbdbe07 Link cluster get-kubeconfig cmd with appropriate functionality
This patch links cluster get-kubeconfig command call with
appropriate clusterctl functionality, and also replaces old
callbacks and removes outdated implementation.

Change-Id: Ibd0d981985f94497db250c8df3f5675fdec1d2ca
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #374
2021-01-26 11:03:59 -06:00
Kostiantyn Kalynovskyi
fe8c86feb8 Add InventoryRepoName field to config
If inventory repo name is not specified, phaseRepoDir will be used

Change-Id: Iea3eca5d7ca14c549696b7214c8d4b07ef3e5bf4
2021-01-22 22:26:37 +00:00
Kostiantyn Kalynovskyi
4e7b4efa8f Add inventory interface and cmd line integration
Change-Id: If15ea99372358ea97c3b35b01781427e06400db1
2021-01-22 20:21:44 +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