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>
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
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>
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
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>
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>
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>
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 module is no longer needed since all config preloading actions
were moved to config module and global flags are stored within root
level cmd.
Change-Id: I411f6717e5b3d2998706c35a82f1e7f1b2aef3a8
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
AirshipCTLSettings will no longer be used by any command, so this
patch removes it from root level.
Change-Id: I2aa1d80ab0785b498af1ac2c86334f9b0d9ff047
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
Config init command will no longer use AirshipCTLSettings for
defining a config object which needs to be saved.
Change-Id: I303f05a8df1e7439d1b3dcfd41cf2679d729a9f8
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
All the phase commands was refactored for usage with new config
factory. Config object now is being initialized in pkg module on demand,
which provides more flexibility and cleaner code.
Change-Id: I742c39788098c3185ce89936ea81cd461bf97af3
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
All the config commands was refactored for usage with new config
factory. Config object now is being initialized in pkg module on demand,
which provides more flexibility and cleaner code.
Change-Id: Ibad0985e30c16efa96109a49edf2840c60305df8
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
These commands are no longer required since we going to remove
clusters and users from config. Appropriate fields will be removed
from Config struct in different PS.
Change-Id: I121280e91e394a38384202d9f5ffaaf4e458f82f
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
All the cluster commands was refactored for usage with new config
factory. Config object now is being initialized in pkg module on demand,
which provides more flexibility and cleaner code.
Change-Id: I1088ecbce0c34a146a646270404ff206b152d310
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
All the image commands was refactored for usage with new config
factory. Config object now is being initialized in pkg module on demand,
which provides more flexibility and cleaner code.
Change-Id: I3c51f201ec70b194ce1f127ff43a28292cf691f3
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
All the baremetal commands was refactored for usage with new config
factory. Config object now is being initialized in pkg module on demand,
which provides more flexibility and cleaner code.
Change-Id: If75cd3f1a8bc22fc47ea132188bd9fec989ee434
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
This command was refactored for usage with new config factory.
Config object now is being initialized in pkg module on demand,
which provides more flexibility and cleaner code.
Change-Id: Iff75eb66db2fee922e6db1bf2930892c02c3b601
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
As part of config refactoring process, we should remove debug field
from AirshipCTLSettings structure since debug variable is stored in
log module.
Change-Id: I02f3c7160ed0301605de32e0d0267be8524ccc12
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
AirshipCTLSettings are not used here, so it was removed.
Change-Id: If4bf64b9991b4ac05898632c79bacbacd7872635
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
As part of config refactoring process, we have to prepare root
level command to future changes, optimize function signatures
and its logic.
Change-Id: I563a7556ce1cca795a74cf2c6a26380467a15a5d
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #327
Now Run method will accept channels that they will write
events to, this will allow us to pass channels we want to them,
instead of execting them to return us a channel.
Wait method is removed from interface for now, as it needs more
design.
Change-Id: Ibd47dfe49172f537b79bcc8f83f7c76aece8e862
This commit uplifts cobra to the latest version. It also includes
various changes accounting for differences in the new version.
Change-Id: I0d1ed3ecd3b8d406428fded92abf6e782951d005
This patch adds some missing cmd unit tests for cluster module
and refactors current ones as well, slightly improving test coverage.
Change-Id: I80c449e213d9aed9abd11fe794afac07ca16bdc6
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
TestPull unit test should not perform functional verification. The purpose of
cmd unit tests should be testing proper cmd object creation, not actually run
the command. Moreover, we don't have possibility to mock and track all the
objects that created inside of called functions. We can only verify golden output
with help or when command performs basic stuff just inside of RunE interface. Actual
test of called methods performed in pkg module.
Change-Id: I2ad6b76f67cbf59d798c0f2b93752b3e3b3b053d
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
This patch refactors some code and adds useful debug/info log output.
Change-Id: I590f6e5c300e5c91443af0a8fdb1073229602a67
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #278