Phase helper provides plenty of useful methods for
a phase client. But these methods are not used by
phase executor initializers except for getting some
configuration values. So, it is better to provide
initializers with necessary values instead of passing
them the phase helper.
Change-Id: I8c596455e30444570a86efad73d792af0ca83a33
Relates-To: #464
Relates-To: #465
These mock objects can be tuned according to a test
case and then fed to a testable objects. For example,
all the phase executors are supposed to consume document
bundles and react respectively depending on the
behavior of the bundle.
Tests will be modified in later patches.
Change-Id: I7cd71752709d6d1f255d4bfbc641803479eed66e
Relates-To: #464
Relates-To: #465
Since this field is no longer actually used, there is need to
remove it completely.
Change-Id: I9f7002f8def31d1660919bd0128707e43a57ad71
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
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
This reverts commit f328c43295541dd2c855e493abd1e746216f9b24.
Reason for revert: Encryption config is no longer needed and
not used in airshipctl config.
Change-Id: I07f5fd035236b8ecbf4ad6dd164acb7e8c98deb5
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
It allows us to have more clear and controllable unit tests and
to move towards bringing all file operations in airshipctl to a
common standard for all source files (using only document
filesystem module).
Change-Id: I560edb7c8e9cd682f3c188527245fcd40045e16c
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #415
This also moves KRM related logic from executors package to
container package, and creates ClientV1Alpha1 interface that
would allow us to have versioned clients for generic container
executor.
Change-Id: I4b32fd8dd089b9ccea2ed64a805702e6a8705706
This commit allows to specify options to get container logs, such
as stderr, stdout and if logs should be followed.
Also extends RunCommandOptions with ability to add mounts in addtion
to binds
Relates-To: #458
Change-Id: I83507f2f7ca6ea596f52f5d3e9f868467458b6a3
This will make sure that when we add new features to how the
docker container is run, we don't need to change interface
method signature everywhere we use it.
Relates-To: #458
Change-Id: I12273264c1a8061300017246a1a4a17125ca8ae2
Please note that this is first commit in series and in next commits
remote/remote_direct* files will be remove completely, so if you
have any comments that address issues in these files, keep in mind
that they will be remove in next patchsets.
Change-Id: I52e9b8438a4f8e1a2395cbe90238b9cb654772d4
Currently MockDocument implementation located under pkg/bootstrap/isogen
package, which is not relevant for it and makes it impossible to import
in other test packages. Also _test.go filename is not proper one for
this source file since it doesn't contain any unit tests inside.
Change-Id: I9b3f28df653637701f5d6fca4376da5a22f39658
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #432
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
These methods will be used instead of calling their direct
analogs in the code in order to have more consistency.
Change-Id: Ie2eaf03b1fbd049ed5788f1a769a332ef863494b
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #415
In order to widely use filesystem interface in airshipctl
there is need to move it to separate package to avoid
importing unnecessary dependencies from document
package and, as a consequence, possible cyclic dependencies.
* filesystem moved from document/fs to pkg/fs
Change-Id: I3b6298462f03db43594a9fa26bf23ab7687c5589
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #415
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
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
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
All of these entities are no longer required and should be deleted.
Change-Id: Id4776efe668265df6961a38ce984b8ac37b27097
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
This is a part of two activities
* Refactor config and store all parameters to document model
* Implement everything as phases (which are supposed to be purely document driven)
This patch removes bootstrapInfo section from the airshipctl config and
makes these to commands
* airshipctl baremetal isogen
* airthipctl baremetal remotedirect
to take necessary parameters from documents
We introduce two airship API kinds ImageGenerator and RemoteDirect.
Instead of storing config parameters in cm/secrets we use these two
API objects.
Relates-To: #246
Closes: #254
Change-Id: I42903c45dce1c73da184c07277fec76fd88c700f
This will allow to use various sources for kubeconfig and provide
utility to write, save, and clean kubeconfig files, as well as
use kubeconfig interface for phase executors.
Relates-To: #264
Change-Id: Ia5b5af00700a0adf55124e1dd335d570515ed804
Update golanci version, because we need to add asciicheck linter.
Because of update appears some gosec issues.
Closes: #312
Change-Id: I54759e7301f0fb9dcb60eb7d9a2d1e9cebfaf359
airshipctl config init command currently fails with "no such file or directory"
error, this patch fixes it.
Change-Id: I78cff26ed71bdb400ce897630102350e72dc495d
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
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
This commit adds get-manifests and set-manifests option for airshipctl
config. get-manifests prints all the manifests in current config file.
set-manifests helps in setting/creating new manifests in current config
file.
Closes: #115
Change-Id: I7c677ed491a1d456744d27bf105f21e2b3c4e6aa
Signed-off-by: Sreejith Punnapuzha <sreejith.punnapuzha@outlook.com>
This commit makes mock filesystem reusable by moving it to importable
package in testutils
Change-Id: I4885480a9ef3b8c81da0058db708c32187af8e12
Relates-To: #277
Relates-To: #238
Closes: #277
Adds FakeFactory function, that allows to inject custom handlers
for HTTP and Unstructured client, which in turn enables better
testing for kubernetes api related packages
Relates-To: #276
Relates-To: #238
Change-Id: Ic27352bdc64bfccb91cc6a49afa6164e4624b1e1
Closes: #276
* encoding while saving credentials in authInfo
* decoding while fethcing credentials from authInfo
* Credentials are found only in ~/.airship/kubeconfig, so did not find
anything in ~/.airship/config to be encoded.
Change-Id: I13f3d49b2ad7ccd1388cabd015fe5a93be2c7b96
Closes: #155
Attempts to write to a nil map will cause a runtime panic,
since we don't have explicit checks whether the map is nil
or not - they were added with proper initialization using make.
Appropriate test configuration was added.
Change-Id: Ib50686de44b782fdc881bd4608dd74588fce93bd
Relates-To: #190
Closes: #190
Baremetal host power statuses are handled as strings in airshipctl.
Invoking remotedirect on a host that is powered off will result in a
remotedirect failure; therefore, the power status of a host needs to be
verified before remotedirect can begin. This change adds strict typing
to baremetal power statuses so airshipctl can verify the status of a
remote host before performing remotedirect regardless of the client type
(e.g. redfish, other).
Change-Id: I22f1784006add018ee1d67c18f94499aa9544752
Signed-off-by: Drew Walters <andrew.walters@att.com>
Early airshipctl usage has identified the need to eject virtual media
on-demand using airshipctl in order to prevent booting from stuck media.
This change adds a command to eject all virtual media attached to a
baremetal node.
Change-Id: Id67fa00489093dcb84ce54216e0553fa6a737ea6
Signed-off-by: Drew Walters <andrew.walters@att.com>
This change introduces a command to power on baremetal hosts.
Closes: #5
Change-Id: Ie76cd7c044cc44629648ef0b02bb7e492ccccdcf
Signed-off-by: Drew Walters <andrew.walters@att.com>
Management support is only available to the ephemeral host. This change
extends support of management features to hosts not labeled as the
ephemeral host.
Change-Id: I0ac917f2633f659e56e67cafc52d2db9d967754f
Signed-off-by: Drew Walters <andrew.walters@att.com>
Some management options are not directly related to the remote direct
functionality, and the remote direct config should not be validated when
they are needed. This change moves those management options to a
dedicated configuration module.
Change-Id: If4388bccbc70b2c77d7804cb4c38644775404242
Signed-off-by: Drew Walters <andrew.walters@att.com>
Removed Modules from config. There are no other types of modules
that need additional configuration. BootstrapInfo is defined
in the config directly.
Used camelCase for config parameters.
Change-Id: I3531a061026f3b2f1e72af6272ba4709f28d1b3d
The Dell Redfish implementation slightly deviates from the DMTF Redfish
specification. One variation is the Dell specification's classification
of virtual media, in which the Dell variation adds support for virtual
CDs and virtual floppy drives [0]. In order to perform some actions on Dell
hardware, airshipctl needs support for vendor specific clients.
This change introduces ephemeral boot media support for iDRAC systems
using a proprietary API in the Dell client.
During the creation of this change, it was also observed that Redfish
calls fail when media is already inserted. This change adds a check
to eject media if media is already inserted.
[0] https://www.dell.com/support/manuals/us/en/04/idrac9-lifecycle-controller-v3.2-series/idrac_3.21.21.21_redfishapiguide/virtualmedia?guid=guid-d9e76cf6-627d-4cb9-a3de-3f2b88b74cfb&lang=en-us
Closes: #139
Co-authored-by: Drew Walters <andrew.walters@att.com>
Change-Id: Ic9fd9e1493b1ff1bb20e956ae5f821d137c74760