This command is outdated and no longer needed, according to the
design call it should be removed.
Change-Id: I7c96fdd8cbc21c56ad9d0d6291ea9b6c6626735d
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #588
This command is outdated and no longer used, according to the design call
it should be removed.
Change-Id: I5953f0c66e9cee40c070afe148aa98c9d07113f7
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Relates-To: #588
Current modified go code, generates RsT files for each airshipctl
cmd and places them in a folder specific to the airshipctl subcommand.
It also generates the index.rst file for the specific airshipctl
subcommand folders. These generated rst files are appropriate to sphinx,
so that they can be easliy rendered in docs.airshipit.org
Steps to render the document locally
* Install sphinx: python3 -m pip install sphinx
* Clone airshipctl: git clone https://github.com/airshipit/airshipctl.git
* Download current PS: cd airshipctl; git fetch "https://review.opendev.org/airship/airshipctl" refs/changes/50/789250/2 && git checkout -b change-789250-1 FETCH_HEAD
* Build sphinx html pages: cd docs/source; sphinx-build -b html . _build
* Run local server: cd _build; python3 -m http.server
* Open URL to access the page: http://localhost:8000/ navigate to commands section access the document
Relates-To: #280
Change-Id: Ifa1dafc7b296014cc826072ac2c52f4488421352
This PS updates cmd related to root, completion, document and
version subcommands. It also updates minor details in other
subcommands.
The description and examples are updated for the airshipctl
commands, which will be inturn used for generating documentation.
Please ignore the .md file changes in this PS. They are added for zuul
gates to pass. Here is the PS with generated documention
files https://review.opendev.org/c/airship/airshipctl/+/789250
Relates-To: #280
Change-Id: I562c15c0d25b2e9731c0eb03854d1d348eb435f2
The description and examples are updated for the airshipctl
commands, which will be inturn used for generating documentation.
Please ignore the .md file changes in this PS. They are added for zuul
gates to pass. Here is the PS with generated documention
files https://review.opendev.org/c/airship/airshipctl/+/789250
Relates-To: #280
Change-Id: I7c088528842ff859f502d4484ff9a3847ebb1177
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
It is not used anywhere anymore as commands themselves were
deprecated and removed in favor of clusterctl move and init
executors.
Change-Id: I526f75d95b70754034f0846edfc9d3e468648ced
This PS will allow us to retrieve kubeconfig from different
kind of sources.
Change-Id: I31381cf466c58373efda40d06587e34bef411c68
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Instead of these commands users should run apporopriate phase
linked to clusterctl executor
Relates-To: #463
Change-Id: Iecb7320668fa98cfe322cbf922eb77e9490acbdc
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
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
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 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>
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
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>
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
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>
As mentioned in the issue there is only one duplicate key:
cmd/cluster/testdata/statusmap/legacy-crd.yaml:metadata
Change-Id: I2c82595c44645f3a104b45db52c2a3943877d9f1
Relates-To: #311
This change introduces the subcommand `status` to the `airshipctl
cluster` command. The `status` command will iterate over all defined
custom resources in the target path, check their status against the
resources currently in the cluster, and then report results on stdout.
Change-Id: Ieaff6b91fd9055f995c5ba8ce79959356a2a8a02
Relates-To: #73
Command "cluster initinfra" should be removed since
"phase apply" was introduced instead.
Change-Id: I263f8988a4456fc03314093a55ee1c1da8048404
Relates-To: #162
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
There are several commands which do not require to load config:
completion, help, secret, version. Hovewer, PersistentPreRun call
at root level forces airshipctl to load config anyway. Therefore,
we can observe unnecessary config load errors instead of actual result.
This patch moves config load to subcommand level where it is necessary.
Change-Id: I774a7d038c408e71688f7bf04f1cb87a2132a342
This commit cleans up the command constructors in an attempt to make the
codebase more uniform and approachable. This includes several refactors:
* Removed the FlagConstants - this makes the help messages and examples
significantly more readable without needed to compile and run
airshipctl
* Long help messages and examples are now constant
* Short, Long, and Examples all begin with a capitol letter
* Flag descriptions begin with a lowercase letter. This matches the flag
description for the builtin "help" flag, making formatting uniform for
all flags
* Removed redundant unit tests on non-leaf commands
This change also updates the documentation for the affected commands.
Change-Id: I8b9dcbfd9846b3deaab06dec17f80643dae78de9
This version is required to integrate with clusterctl.
Starting v0.0.6 cobra Execute() method returns ErrSubCommandRequired if
command is executed when its not runnable (Run or RuneE == nil), hence
all tests that invoke such commands need to be either remove or adjusted
to expect these errors
Change-Id: Ia7935c1bf83d47b3a7d3a6c03d1989d53ad57a9a
Relates-To: #187
Goland is complaining of a number of bad practices, and unused code.
This patchset addresses some of those complaints, such as:
- struct initialization without field names
- error string should not be capitalized or end with punctuation
- name starts with package name
- duplicate yaml keys
- snake case
- redundant parentheses
For the http.Transport redundant parentheses, the lint target fails
without the use of //nolint:errcheck so it has been added as
(currently) there is no potential for there to be an error returned
see [0] for example.
[0] https://golang.org/src/net/http/transport.go#L42
Change-Id: Ib1b20639c9b6e9be097ef1f158ecd7472f578488
Signed-off-by: Alexander Hughes <Alexander.Hughes@pm.me>
* added license templates for go, bash & yaml in tools dir
* added a script that will add license information for all
missing files. Type: go, yaml, yml, sh
* skip adding license for all files within testdata
* Syntax:
> ./tools/add_license.sh
* Skip license for manifests folder
* Added one extra line after licene for yaml files
* Added License after Hashbang for bash.
* Add an extra line after hashbang and before license
* Updated the go template to use multiline comments
New Files:
1. tools/add_license.sh
2. tools/license_go.txt
3. tools/license_yaml.txt
4. tools/license_bash.txt
Change-Id: Ia4da5b261e7cd518d446896b72c810421877472a
Realtes-To:#147
This change removes the getters and setters for the following attributes
of pkg/environment.AirshipCTLSettings:
* airshipConfigPath
* kubeConfigPath
* config
The above attributes have been exported to account for the removal of
these methods.
Change-Id: I4e7d38bf6771f7521179a2fe2990475b936b5d95
1. Add end-user documentation of CLI commands
2. Minor refactor of several help messages
3. Update of golden test data to reflect help message changes
Change-Id: I58b8ac3a7871efdb569887ab65191bfb1842c24e
Signed-off-by: Alexander Hughes <Alexander.Hughes@pm.me>
This PS fixes the output of airshipctl cluster initinfra --help.
This adds the missing space between 'as' and 'metal3.io'
Change-Id: I2ffc8a91d2b563e75d69f211472e0405f5b18205
Signed-off-by: Sreejith Punnapuzha <sreejith.punnapuzha@outlook.com>
Command will deploy initial inftrastructure that is identified by
airshipctl document module, bundle interface, documents will be fitered
based on label and annotation, which will indicate that it belongs to
initial infrastructure.
After the documents are identified, they will be labeled
indicating that these resources are deployed by initinfra, if flag
`prune` is specified, resources that have initinfra annotation and
deployedBy initinfra label, but are not part of the documents supplied
by bundle interface will be deleted. If user wants to avoid pruning of
some resources he can remove label deployBy manually from the kubernetes
resources that should not prunned.
Change-Id: I143835291d449be420bfcb2944ba7eaec37c3411
This updates references to 'kubernetes' to be consistent with
the proper naming reference used elsewhere ('Kubernetes').
Change-Id: Ia44f5cbc75c2fba79ac6531282e0612e62cbb9f9
Signed-off-by: Steve Wilkerson <sw5822@att.com>
New subcommands will be added later, this commit is a simple base
for other commits related to airshipctl cluster command
Change-Id: I77057c291b88bae3b8fca08ddf56bdf6d183fd24