200 Commits

Author SHA1 Message Date
Zuul
c13f779fa8 Merge "Tighten the restrictions of the linter" 2020-01-13 19:57:32 +00:00
Ian Howell
49027f4151 Tighten the restrictions of the linter
This change causes the linter to be a bit more complainy. The hope is
that this will cut down on some of the more pedantic issues being caught
in code reviews, and thus reduce the overall time a change spends in the
review process.

This change includes various changes to the codebase to bring it up to
the new standards.

Change-Id: I570d304bca5554404354f972d8a2743279a0171b
2020-01-10 14:54:34 -06:00
Ian H. Pittwood
b8a2bb3b27 Updates to Makefile
Implements `make docs` command to create rtd-themed docs using Sphinx
from the existing Markdown documents in the docs directory.

Changes the `get-modules` command to `depend` to more closely match
OpenStack guidelines in [0].

Adds `fmt` command as specified in [0], currently referencing the `lint`
command.

Adds `godoc` command that will host a local godoc server instance with a
link directly to airshipctl technical documentation.

Adds `releasenotes` commands specified in [0], currently
noted as "TODO".

Adds `images` command as found in other Airship projects, referencing
`docker-image`.

[0] https://governance.openstack.org/tc/reference/pti/golang.html

Change-Id: I134fc2c2714bce6d23dc9cf8b86c3016d68def7e
2020-01-10 09:20:10 -06:00
Kostiantyn Kalynovskyi
b43e4e4fea Add abstraction to git repositories
This can be used to pull documents from git repositories defined
by config module in manifest

Change-Id: Ib25cd7e263b6de56bc107607c081e2b02281b8b5
2020-01-08 19:43:59 +00:00
Zuul
7359327a20 Merge "Introduces set_context and get_context operations Each of these include an option for --current-context that set or retrieves the curret context" 2020-01-08 19:10:14 +00:00
Rodolfo Pacheco
a480527808 Introduces set_context and get_context operations
Each of these include an option for --current-context that set or retrieves
the curret context

This patchset mainly creates the cmd/config and pkg/config require additions

Also includes a fync getCurrentContext(<CLUSTERTYPE>)  in the config pkg
that other modules should rely on.

Introduces new  ErrMissingConfig and  ErrConfigFailed types been used by
set-context, will decimate through get/ and set/get cluster after this is
reviewed.

Change-Id: I501483a9db99f33f860eaf329a65bb0209b2aaff
2020-01-08 11:46:16 -05:00
Alexander Hughes
960e816c23 Minor document fixes
- Links to CONTRIBUTORS.md and testing-guidelines.md were broken.
- Minor fix to escaping of the (c) bulletpoint in contribution
  guidelines.

Change-Id: Iffb5233b50008a4e4e4fd17be483d7e8c1ee4856
2020-01-03 16:36:56 +00:00
Zuul
d9e18f78ff Merge "Fix redfish reboot logic" 2020-01-02 22:59:20 +00:00
Zuul
f0ed121539 Merge "Fix deprecated field in linter config" 2020-01-02 17:31:09 +00:00
Ian H. Pittwood
5b7de06eec Add proxy options to Makefile docker build
Adds options relating to proxy settings in the Makefile to be used
during the execution of docker build. The settings are optional to be
used and are set up similarly to other Airship projects such as [0] and
[1].

To set proxy settings during docker build, execute the command as
follows:

```
make docker-image \
  -e PROXY=<The proxy URL> \
  -e NO_PROXY=<comma-separated list of URLs/IPs not using the proxy> \
  -e USE_PROXY=true
```

[0] https://opendev.org/airship/pegleg/src/branch/master/Makefile
[1] https://opendev.org/airship/promenade/src/branch/master/Makefile

Change-Id: I92258465d9638b40797d38ba5d8b835fc38df23f
2019-12-19 18:22:41 +00:00
Alexander Hughes
358a7e9882 Minor documentation cleanup
This patch makes minor documentation fixes:
1. Wording of make images
2. Document rendering of bullet point c instead of a copyright symbol
3. Fix broken link for contributing docs
4. Use https for quay link instead of http
5. Limit line lengths to 80 characters

Change-Id: I8c6d339251e454b357d6eaeb125b925c209e8577
2019-12-16 09:48:04 -06:00
Zuul
8ee4c68547 Merge "Move all error structs to common package 'errors'" 2019-12-10 16:16:24 +00:00
Ian Howell
4f91de6e24 Fix deprecated field in linter config
The `deadline` field was deprecated in v1.21.0 of the linter in favor of
`timeout`

Change-Id: I543930d522311fa3e41c14d55624703bbc4e2b99
2019-12-06 15:48:53 -06:00
Ian Howell
3e08db66bd Fix testing-guidelines.md link
Change-Id: I644235c09935b4d55edad2587e448dd96715ad13
2019-12-06 15:23:37 -06:00
Dmitry Ukov
ca08fec157 Fix redfish reboot logic
Power On commnad was not sent due to wrong logic around
ScreenRedfishError function.

Change-Id: Iec39c49ddf7c4df8fed16fdfe06828513692abad
2019-12-04 08:59:48 +00:00
Dmitry Ukov
c1ed28fd25 Move all error structs to common package 'errors'
Change-Id: I91e9610b27244fe5d7500575eae24647e256dab8
2019-12-01 14:14:09 +04:00
Ian Howell
8dd721830b Create a new test object for each redfish unittest
This removes the SampleSystem testing variable and replaces it by a
function which generates the object. This guarantees that the test
system has the same initial configuration for each test regardless of
the order in which tests are run.

Change-Id: I9875723ac4194425674c2806cf099509f94ad771
2019-11-20 13:58:36 -06:00
Zuul
013d814a93 Merge "Utilize Docker caching to speed up image building" 2019-11-20 15:01:41 +00:00
Ian Howell
e3ca393d9e Utilize Docker caching to speed up image building
This rearranges the Dockerfile to COPY over the go module files for
downloading prior to building, linting, and testing. This will allow
developers to more quickly test their code via Docker given that their
dependencies change infrequently.

Change-Id: I3650fbd9ca18d453921d25a536e8b4cf60ce1b5e
2019-11-19 14:00:01 -06:00
Zuul
6fb756eec5 Merge "Minor README formatting fixes" 2019-11-19 15:14:45 +00:00
Zuul
9284d92b63 Merge "Bump kubernetes 1.16.3 as a main dependency" 2019-11-19 14:37:37 +00:00
Zuul
98b1f6ae57 Merge "Add make tidy to check for up-to-date go.mod" 2019-11-19 14:37:36 +00:00
Roman Gorshunov
819f4cc8fc Minor README formatting fixes
Adjust internal links to be relative to repository root, and change github
link to opendev link as project is hosted on opendev.org.

Change-Id: Icb5e3a378d600d087d6d97200d2c355d8619dc09
2019-11-19 08:20:01 +01:00
Alan Meadows
0b805a2bd6 Correct README link to developer documentation
Change-Id: Idb51b9170fc0516f899cf499d7dcd82bcb1b42c9
2019-11-18 17:04:37 -08:00
Zuul
94060af0fb Merge "Update README with a more accurate project description" 2019-11-19 00:46:23 +00:00
Alan Meadows
87f48407a7 Update README with a more accurate project description
Change-Id: I805a569c3624e30862dbba4b613aa9b683af54a3
2019-11-18 15:56:40 -08:00
Dmitry Ukov
592850934f Bump kubernetes 1.16.3 as a main dependency
Change-Id: I564745a0d53367fa3b3087107610cec43272cf7c
2019-11-15 13:24:11 -06:00
Zuul
49e05cc9a6 Merge "Remove a duplicated unit test" 2019-11-15 16:59:55 +00:00
Zuul
20c8dc8fde Merge "This tests get-cluster with the pre-built CmdTest" 2019-11-15 16:58:09 +00:00
Zuul
80621d71e5 Merge "Remove unused and commented out code" 2019-11-15 16:46:08 +00:00
Ian Howell
404760ce3e This tests get-cluster with the pre-built CmdTest
This changes the unit tests in ./cmd/config/get_cluster.go by swapping
out the `run` function for the pre-built CmdTest. This matches the
conventions of the existing test bed.

Change-Id: I4cecd211fe7ab74a1151635f29bda578887f400a
2019-11-15 10:30:41 -06:00
Ian Howell
a0751bb343 Remove a duplicated unit test
This drops the TestSpecifyKubeConfigInCli unit test, as it as a
duplicate of TestInitFlags.

Change-Id: I69a8f5f0151e9c8b9906c1b3076e16304c50831a
2019-11-15 10:27:46 -06:00
Ian Howell
086b0661d2 Remove unused and commented out code
Change-Id: I92b325d7b78e26bbab21270ac9e52540a26c4ea1
2019-11-15 10:14:42 -06:00
Zuul
1556a09103 Merge "Clean up the reconcileClusters function" 2019-11-15 15:52:31 +00:00
Ian Howell
7ecae507e0 Add make tidy to check for up-to-date go.mod
This commit adds the `tidy` target. This target will fail if the go.mod
or go.sum files are not up to date with the code. It will also be a
prerequisite to the `lint` command, implying that it will also be caught
by the Zuul gates.

Change-Id: Ie33de2d793beca100435670346eb0e2ea7b3b0dd
2019-11-15 09:41:41 -06:00
Zuul
ffcb533d39 Merge "Switch isogen command output to log module" 2019-11-15 15:37:48 +00:00
Zuul
5e7cad2d8a Merge "Isolate unit tests by using temp directories" 2019-11-15 15:37:47 +00:00
Dmitry Ukov
5ae4a37618 Switch isogen command output to log module
Change-Id: I4f23bbe192a2f56a4ebfa0d1417b2271a343ff96
2019-11-14 13:25:49 -06:00
Zuul
a6b837afa7 Merge "[AIR-137] Add ISO builder artifacts check" 2019-11-13 17:22:17 +00:00
Zuul
3c3c4b32e0 Merge "[AIR-145] Generate cloud init settings" 2019-11-13 17:21:10 +00:00
Ian Howell
61eecca7f3 Isolate unit tests by using temp directories
This commit changes several unit tests to set a "workspace" in a temp
directory. This completely isolates them from other tests as well as the
developer's environment.

Change-Id: Ifa1048c427dc3d69e15dae04318c7d8463b8f8e1
2019-11-12 15:37:29 -06:00
Ian Howell
871bd8c703 Clean up the reconcileClusters function
* This removes unneeded variables and complexity from the
  reconcileClusters function.
* It also adds a unit test for said function, slightly increasing overall
  unit test coverage
* Finally, this also addresses an issue in the rmConfigClusterStragglers
  function in which the clusters entry was not cleaned up in spite of
  being empty.

Change-Id: I9e7535305840db5f2fb763452d5e4ef46be467c9
2019-11-12 14:56:58 -06:00
Ian Howell
e48b436680 This commit prevents NewConfig from returning errors
Prior to this commit, NewConfig was setting up a new Config object and
filling it with a new kubeconfig object. The process for creating a
kubeconfig object has the potential to return an error. This commit
removes the creation of that object from NewConfig, delegating creation
of kubeconfig objects to more appropriate functions, such as LoadConfig.

Change-Id: I57a040f2e76bbc003eb82171f382e80425b37870
2019-11-12 10:09:36 -06:00
Dmitry Ukov
f73e28164c [AIR-137] Add ISO builder artifacts check
Change-Id: I0f454d56044c6f477b0e4fae18ea0bef8738715d
2019-11-08 08:49:33 +00:00
Dmitry Ukov
6b82a529fc [AIR-145] Generate cloud init settings
Settins are generated based on a secret data

Change-Id: Ib4c25e720759694432e03796ae5d1b4f2f2a1a1b
2019-11-08 08:49:33 +00:00
Zuul
915c47506b Merge "This updates the current unit tests for testify" 2019-11-07 21:05:01 +00:00
Zuul
d462b8a014 Merge "Initial Contributions and Developer Docs" 2019-11-07 20:56:39 +00:00
Alan Meadows
7328c22a3e Initial Contributions and Developer Docs
This commit forms a starting point for our CONTRIBUTING.md
and developer documentation.

Change-Id: I7de8ad19e658a849208c18a3339c1f01a95471d5
2019-11-07 10:48:32 -08:00
Ian Howell
d775b2159a This updates the current unit tests for testify
This commit removes any assertion from Go's "testing" package,
preferring instead to use an assertion from the testify package. All
tests now have uniformity.

This also decrease the number of iterations in the password generation
test, decreasing test runtime tenfold

Change-Id: I8799110e93dfa19bebe9050528e865b4c991c3df
2019-11-07 12:15:06 -06:00
Zuul
f24abc6033 Merge "Add testing expectations" 2019-11-07 18:05:40 +00:00