* The phase.docEntryPointPrefix field in the metadata.yaml
allows you to define a common part of the documentEntryPoint
for all phases in the phase bundle.
For example, let metadata.yaml be
---
phase:
path: manifests/phases
docEntryPointPrefix: manifests/site/test-site
and a phase be
---
apiVersion: airshipit.org/v1alpha1
kind: Phase
metadata:
name: initinfra-ephemeral
clusterName: ephemeral-cluster
config:
executorRef:
apiVersion: airshipit.org/v1alpha1
kind: KubernetesApply
name: kubernetes-apply
documentEntryPoint: ephemeral/initinfra
Then the documentEntryPoint for executor will be prepended with
docEntryPointPrefix and the path to the executor bundle will be
manifests/site/test-site/ephemeral/initinfra
Change-Id: I29ec14378790d95b66c3ff1fe6120bb200f91a50
Relates-To: #356
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
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>
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
testutil.InitConfig writes sample configs to files,
and if we just check that these files exist after
calling PersistConfig function, then don't test anything.
We have to change config file paths before calling PersistConfig
and then we can check if these files exist.
Change-Id: Ibaee17a57a86251f7016bb57b2d8bd9976cefac0
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
The new approach of config loading allows us to combine and move all
the config loading and verifications actions from cmd to pkg module;
it will be executed on demand only and save us from non expected
runtime errors. The examples of usage will be introduced in further
changes.
Change-Id: I1b4c29f9c5b1de3e46a1faf5c28fea5c7b3eb4e1
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
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
Since we have switched from debian to ubuntu based image and changed the
name (in https://review.opendev.org/733078) we need to align it with
airshipctl repository.
Renaming the following names:
1) debian-custom.iso -> ubuntu-focal.iso
2) quay.io/airshipit/isogen:latest-debian_stable -> quay.io/airshipit/isogen:latest-ubuntu_focal
Updating the following packages and resources:
1) k8s 1.17.3 -> 1.18.6
2) docker 19.03.9 -> 19.03.12
3) Calico 3.9 -> 3.15
Change-Id: I7eaf382acb79016a511db6e0955fa932c02963c4
Update golanci version, because we need to add asciicheck linter.
Because of update appears some gosec issues.
Closes: #312
Change-Id: I54759e7301f0fb9dcb60eb7d9a2d1e9cebfaf359
1) modifications to exported functions/variables documentation
2) moved some methods into a different folder
Change-Id: I212442516424bde3284f75b326d152c290d20c80
Since kubeconfig was moved to manifest we don't
need to change it during use-context update.
Change-Id: Ib6a0ff19eee89bc86a343e374d50938482e33941
Closes: #294
In this fix, we make sure that targetPath is taken into the account
when forming path to metadata file
Change-Id: Ie94c3508161b8c3b9254db08f4bf809348ff54f0
Relates-To: #295
Closes: #295
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>
This commit adds repository metadata object and method to load it
from manifests.
Metadata is to be changed and extended in the future, when phases
start to be implemented.
Change-Id: Idc9374220f62df8b1a80c276278361efa4503e12
Relates-To: #263
Relates-To: #255
Relates-To: #240
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>
Currently, if config file doesn't exist - airshipctl doesn't
throw an error and uses empty config object instead. It seems
this behavior was an attempt to hide an error if there was a call
of subcommand which is not require proper config file. Since we
moved config load calls to the specific subcommands from
root level - current behavior should be changed and we have to
throw an error instead if it's not possible to access config file.
Change-Id: I7e949fbc9d48d682e26500e0b6b6b9bd12665e24
Relates-To: #199
Closes: #199
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
This is a series of patches that refactor config.go into
several smaller modules, each relating specifically
to one component of the configuration structure.
This commit moves the types in the modules where they are used.
Change-Id: I5bbeb765d558f02e04ebf8e41987a436874b83d4
Closes: #35
This change adds a set-management-configuration command that allows the
user, typically CI, to change management configuration settings
imperatively.
Change-Id: I7a106a46f57fef0ea2a8c5dd8c8786d8a103305c
Signed-off-by: Drew Walters <andrew.walters@att.com>
The management configuration does not have central validation, leading
to late validation errors. Additionally, there is an effort to provide
better config validation on a command-by-command basis.
This change adds central validation to the management configuration that
will be used several ways:
1. For quicker validation today
2. For a new CLI command that will be introduced in a future change
that enables imperative modification of the management config
3. Possibly in future efforts to provide command-by-command config
validation by calling the exported Validate() function
Change-Id: I19eafddc818e8d478b9afd053d4ab387c7ad38b3
Signed-off-by: Drew Walters <andrew.walters@att.com>
When reconciling clusters, airshipctl points the bootstrapInfo and
managementConfiguration to an entry named default, and the user is
unaware of this change. The result is that user settings are ignored
unless the user defines settings under entries named "default". This
change updates the cluster reconciliation logic to do this only when a
cluster is added to the airshipconfig by airshipctl.
Fixes #244
Change-Id: I2cefbf83a74d9cd566015509a4f768698d274746
Signed-off-by: Drew Walters <andrew.walters@att.com>
It's redundant and contradictory to call EnsureComplete method from
GetCurrentContext function since this method is called twice
during config load and we perform this check inside of appropriate
action function (like phase apply or cluster init).
Change-Id: Idb9ab7e7665dcc6d199bc96c21ae1dc6d059ac2e
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
This adds an env var-driven configuration for the filesystem path
in which kustomize should expect its plugins (including airshipctl)
to be. The value defaults to a subfolder off the `.airshipit` folder.
The config is persisted as a singleton rather than a member of
AirshipCTLSettings (or the Config) because
1. the settings object would have had to have been passed around
a couple dozen additional files/functions,
2. it's reasonable to expect the plugin location to be consistent
across threads in a multi-threaded, airshipctl-as-library context.
Settings_test.go was moved in to an environment_test package to avoid
a circular import dependency.
Change-Id: Icdd21bd3687ef42492e388af982d7b490af3eff3
`airshipctl config init` command, generates default Airshipctl config
with mutually exclusive checkout options.
This CR fixing config generation by setting the only branch.
The `commitHash` and `tag` remain empty as an example in config file..
Change-Id: I12ec9b713e8f6769ddbd5301e000ab0242ea8ff4
Closes: #233
Problems description:
Once we execute airshipctl config init, the default config in
~/.airship/config doesn't contain default values for:
currentContext: ~
clusters:
default:
clusterType:
target:
bootstrapInfo: ~
managementConfiguration: ~
---
This PS set default values for Airshipctl config to use it
out of the box.
Closes: #234
Change-Id: I57449e678f19ab1c0e2212c38b01ea195f62aa44