Added yaml output flag to show plan list in yaml format
Relates-To: #394
Co-authored By: Niharika Bhavaraju<niha.twinkle@gmail.com>
Change-Id: I8bed077573eb79783cfc77e4ebf82c819f41d125
This patch introduces ability to validate phases using kubeval.
Appropriate functionality was embedded into phase/plan validate
command.
Change-Id: I1e1ccae2b7e4948bdc97a199c96c07a3eb7292b2
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #503
Closes: #2
Closes: #19
Proposed util functions can set variable amount of env vars at once,
covered with unit tests and handles possible errors in more convenient
way.
Change-Id: Ibd31f528fba1b10be49d1e8cc5e5f29c6b3d902a
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
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
The aim of this PS to fix current issue we have when we have
new plan created with description width more than 40 char.
Added condition if width is more than specified in command
so the command execution will not break and just crop
exceeding description length.
Eg: e351b2bc43/pkg/print/table/columndefs.go (L71)
Change-Id: Icc353ec688b2fbb563add39f8d38004008093895
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
AirshipConfig and BundleName fields are not used within Executors,
so they should be removed.
Change-Id: I23c54b854938ae554e888102a41c7ec215b85c27
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
This fixes a bug when in host value is specified in api object,
but it is ignored by docker
Closes: #512
Related-To: #512
Change-Id: I57e66a19124d1d0a295396491dbd22e2e2193d31
This commit adds functionality to generate SSH keypair via templater
plugins. ssh keypairs can be generated via generate-secrets phase.
Signed-off-by: Sreejith Punnapuzha <Sreejith.Punnapuzha@outlook.com>
Change-Id: I83720df5f934caf65dab201a1d0894ed3fee6cb5
* command internal logic was revised and optimized
* added ability to delete/reset management config fields
* unit tests were reorganized, new cases were added
Change-Id: I911df180e6986cb1f4dab6aea01216c8a4e15353
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #348
This patch implements CLI command to invoke plan validation.
Appropriate functionality was already added to pkg previously.
Change-Id: I038b49c8de0af65f38b62950b27b31d95a6301a9
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #19
Relates-To: #497
Closes: #497
Since document.NewBundleByPath() is pretty resource and time
consuming call (because it invokes kustomize under the hood),
we should avoid unnecessary calls of this function. There are
lots of the same constructor calls of new bundle from phase
bundle root path, mostly in helper, which slows airshipctl
and makes no sense. This patch fixes this problem by storing
phase root bundle variable in helper, which creates only once
during airshipctl execution.
Change-Id: I6b59d440f7ab7a68dc613091dafcc9e82df10eb7
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Closes: #488
* command internal logic was revised and optimized
* added ability to delete/reset context fields
* unit tests were reorganized, new cases were added
Change-Id: Ie35d11405e88fea21abf33cb75f44b03bb4644fd
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #348
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 patch allow to specify relative and home (~/) path for container
mounts.src field. In case if specified path is not absolute, it will be
created by following pattern: 'targetPath+mounts.src'; in case if path
contains ~/ - it will be properly expanded (it will allow us to mount
~/.airship working directory).
Change-Id: I878094371a2bc4e48216b1d076e466e3d29a86f6
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #484
Closes: #484
* Phase list command lists phases of current documentset/plan in
table or yaml format.
airshipctl phase list
airshipctl phase list --plan planName
airshipctl phase list --plan planName -o yaml
airshipctl phase list --plan planName -o table(default format)
Relates-To: #358
Co-Authored-By: Niharika Bhavaraju <niha.twinkle@gmail.com>
Change-Id: I37add2fc9dca2433de525bac8c2cc9e56fe39621
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>
Input for this executor could be empty, so we have to handle
ErrDocumentEntrypointNotDefined error more intelligently.
Change-Id: I73e0f770e64cead7dbbbce2af2b7a2ebd323b83b
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #485
Closes: #485
* phase related errors were moved to separate package to prevent
cycling import error;
* error duplicates were removed;
* non-related to package errors were moved to appropriate ones.
Change-Id: If6cfb08c48d356c1517a13157a5fe740dc1635a4
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #485
This change fixes a bug where the default file and directory
permissions weren't getting added (if missing) to the Config
object at runtime.
Change-Id: I87ed2f40af9fe079baade67c506a19de427c4e64
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
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
Now if clusterName is specified for kubebuilder, Build() method
will return kubeconfig containing only context for that cluster.
If no clusterName is specified kubeconfig will have contexts of
all clusters that builder can build. This behaviour is similar
to `kubeconfig get` command.
Relates-To: #460
Change-Id: Ib3bebf61bc60430d347ded41b2e31249b11126eb