122 Commits

Author SHA1 Message Date
Dmitry Ukov
1f2e20e106 [AIR-137] Add isogen subcommand for bootstrap
This is just a frame for command that will execute docker container
with ISO builder scripts

Change-Id: I59a5c494785af3cbcffd3b9f6a488d93f73f4878
2019-09-26 13:51:18 +04:00
Ian Howell
1c999e2095 Add coverage checks
This commit adds a makefile target for generating a report for unit test
coverage. It also adds the coverage_check tool to assert that the actual
test coverage meets the specified requirement.

This also improves various aspects of the testing utilities:
* The "test" package has been renamed to "testutil"
* The "Objs" member has been removed from the CmdTest object
* The "Cmd" member has been added to the CmdTest object. This allows
  testing of multiple variants of a root airshipctl command

Finally, this commit includes additional tests for root.go. These are
required in order to meet the required coverage threshold.

Change-Id: Id48343166c0488c543a405ec3143e4a75355ba43
2019-08-15 11:11:51 -05:00
Zuul
7c8ee26de4 Merge "Fix various minor nits in the Makefile" 2019-08-15 16:08:52 +00:00
Ian Howell
c3f61a37c7 Fix various minor nits in the Makefile
* Remove the unused SCRIPTS_DIR variable
* Make bracket/parenthesis usage consistent
* Add the delete-golden target and add it as a pre-req for
  update-golden. This will help to keep the testdata directories from
  accruing bloat

Change-Id: Ie4b7377872d48371e5e134fe18ed9347e89b7c70
2019-07-17 08:17:54 -05:00
Kaspars Skels
acdedaafe3 Add Zull job for mirroring to GitHub
Change-Id: Ifb343826b96fbbf83b960d8eafdb70c7701f0867
2019-07-16 16:50:49 -05:00
Ian Howell
129ccb3e3e Add a configuration file for golangci-lint
This adds the .golangci.example.yaml, allowing for more precise control
over how linting is done.

This configuration is highly opinionated and is subject to change.

Change-Id: Ida13bf0dca12e152b75427f5060ad4931e426c72
2019-07-15 12:11:08 -05:00
Pete Birley
5cf0b2327c CI: Add a functional test for interacting with a existing k8s cluster
This adds Ansible playbooks to install kubernetes using minikube and
then assert that airshipctl is able to communicate with the cluster.

Change-Id: Ice5cf3de8d9192d508c79c68caf8f5a61896da9c
Signed-off-by: Pete Birley <pete@port.direct>
2019-07-09 21:04:15 +00:00
Zuul
e3f407ef99 Merge "Remove dependency on k8s-code-generator" 2019-07-01 19:11:56 +00:00
Zuul
75c12c30bc Merge "Rename module to reflect its new location" 2019-07-01 18:28:50 +00:00
Ian Howell
3cda375947 Remove dependency on k8s-code-generator
The deletions from the go.mod in this change were a relic of an earlier
change, where the k8s-code-generator was being used to generated client
code for Argo workflows. Now that Argo has been properly integrated into
the project, this is no longer needed.

These deletions were caught by a `go mod tidy`

Change-Id: I3e9f115dc31ef30dee59ddeeee513282bc555fcf
2019-07-01 12:57:29 -05:00
Zuul
f5036b0423 Merge "Gerrit: Add .gitreview file" 2019-07-01 17:53:50 +00:00
Zuul
feddb0b5b6 Merge "Remove unused constant" 2019-07-01 17:53:41 +00:00
Ian Howell
6e41a56a7d Rename module to reflect its new location
Change-Id: I5c8c524c4d3f569b21b5b829722b3c49952cb0ab
2019-07-01 12:15:29 -05:00
Ian Howell
d6b06a8787 Zuul: Switch from travis to zuul
This PS adds the skeleton for a set of zuul checks and gates for
airshipctl and removes the travis config.

This PS also removes some dead code from the util package. This change
is required to get unit tests passing.

Change-Id: Ifb1be49cb1bb82c62a0085b6da9b8ff1b261a95b
2019-07-01 11:00:26 -05:00
Ian Howell
9212e67c23 Remove unused constant
Change-Id: I4e8eff5829fb525dd91162213a53bd318ee594c0
2019-06-25 15:34:40 -05:00
Pete Birley
a1c9e41957 Gerrit: Add .gitreview file
This PS adds a gitreview file for AirshipCTL.

Change-Id: Ib968f07083668591a73858f0b0647ae1d8e3655a
Signed-off-by: Pete Birley <pete@port.direct>
2019-06-25 08:11:57 -05:00
Ian Howell
dfe8fd0bf1 Add kubeadm command 2019-06-13 14:46:07 -05:00
Ian Howell
cede5a2b20 Remove the unneeded cmd/argo package 2019-06-13 13:15:50 -05:00
Ian Howell
7fff1231d5 Add the completion command for bash and zsh
TODO:
  * Add documentation on how to use this
  * Switch to using Cobra's GenZshCompletion function
2019-06-13 12:33:19 -05:00
Ian Howell
b0871d50d5 Add kustomize subcommand 2019-06-13 12:31:39 -05:00
Ian Howell
39ff211864 Add kubectl as a subcommand 2019-06-13 09:42:20 -05:00
Ian Howell
5999d17323 Add argo as a subcommand
This is a drop-in of the argo cmd package, with some slight tweaks to
adhere to airshipctl's models and linter. It still needs to be combed
over and modified to meet airshipctl's needs, as well as requiring unit
tests
2019-06-13 08:58:19 -05:00
Ian Howell
3c02f845d0 Remove argo 2019-06-13 08:12:45 -05:00
Ian Howell
95a504ee4e Update golangci-lint with fixed tag 2019-06-10 08:29:00 -05:00
Ian Howell
236274eef1 Add a convenience NewAirshipCTLCommand function
This adds the NewAirshipCTLCommand, a function which returns the root
airshipctl command with all of the default plugins preloaded
2019-06-07 14:06:37 -05:00
Ian Howell
eb79dff0c9 Add detailed documentation on plugins 2019-06-07 11:35:51 -05:00
Ian Howell
f33c634141 Revert "Test with vendor directory"
This reverts commit 0a0b691efe4f6ca398e5f8d8f95605ade0b6686b.
2019-06-07 08:48:36 -05:00
Ian Howell
0a0b691efe Test with vendor directory 2019-06-07 08:34:06 -05:00
Ian Howell
6aa4d897fd Update readme 2019-06-06 16:26:38 -05:00
Ian Howell
56a4824524 Fix unit tests 2019-06-06 15:27:57 -05:00
Ian Howell
549e5cb955 Fix a fatal bug in GetClientSet 2019-06-06 14:29:56 -05:00
Ian Howell
68cfcf82ae Fix log tests 2019-06-06 11:40:40 -05:00
Ian Howell
cbd1e048c9 Move the client objects out of the settings objects
* This also modifies the way that logging is handled
2019-06-06 10:57:33 -05:00
Ian Howell
247a439abc Remove old .gitignores 2019-06-06 09:30:51 -05:00
Ian Howell
93137aa418 Update README with build status 2019-06-06 09:29:07 -05:00
Ian Howell
3a51a39226 Add .travis.yml 2019-06-06 09:21:20 -05:00
Ian Howell
50f29ca75d Remove coverage tests 2019-06-06 08:59:59 -05:00
Ian Howell
ed6cd68e55 Spelling mistake 2019-06-05 10:04:43 -05:00
Ian Howell
e1edc45362 Remove redundant code 2019-06-03 08:41:27 -05:00
Ian Howell
44f208ccad Add unit test for workflow 2019-06-03 08:39:50 -05:00
Ian Howell
a8e649eb67 Move workflow listing to its own package
* adds the AGE, DURATION, and PRIORITY columns
* adds the --all-namespaces flag
2019-05-31 15:57:07 -05:00
Ian Howell
3b4a9fb82c Move workflow init to the workflow package 2019-05-31 10:12:24 -05:00
Ian Howell
d7a0f93cd1 Change bootstrap's io.Writer to match other commands 2019-05-30 16:13:33 -05:00
Ian Howell
cb0d15bdb8 Fix coverage to handle all packages sans generated code 2019-05-30 15:34:10 -05:00
Ian Howell
5ed74c4944 Move workflow init logic to pkg/workflow/initialize 2019-05-30 11:34:34 -05:00
Ian Howell
e4b45002c9 Enable the linter, and fix uncovered linting issues
This uses the current master commit of golangci-lint. We will want to
update to use a tagged version as soon as the golangci-lint team pushes
a new tag
2019-05-30 10:02:54 -05:00
Ian Howell
42ace4fd46 Fix an issue causing command line args to be parsed too late 2019-05-30 09:54:26 -05:00
Ian Howell
3b31b47158 Convert workflow_init_test to a proper table test 2019-05-29 15:34:38 -05:00
Ian Howell
3dae793f70 Remove unnecessary arg parsing from tests 2019-05-29 15:15:01 -05:00
Ian Howell
4c6b8486c9 Move all tests to proper table-tests
This commit also changes the way that output is handled while testing
2019-05-29 15:11:55 -05:00