Browse Source

style(armada): quality of life and cleanup

- adding .editorconfig file
- minor cleanup in various files related to .editorconfig
- typos, whitespace, etc.
- other general housekeeping items on the codebase

Change-Id: I104f8dcb06aafb180da12f7ee4c0ded41fc07b9d
changes/20/570020/1
Marshall Margenau 1 year ago
parent
commit
e1b64d200b

+ 0
- 1
.dockerignore View File

@@ -4,7 +4,6 @@ examples
4 4
 CODE_OF_CONDUCT.rst
5 5
 ChangeLog
6 6
 LICENSE
7
-OWNERS
8 7
 etc/armada/armada.conf
9 8
 etc/armada/policy.yaml
10 9
 charts/*

+ 27
- 0
.editorconfig View File

@@ -0,0 +1,27 @@
1
+# EditorConfig is awesome: http://EditorConfig.org
2
+
3
+root = true
4
+
5
+[*]
6
+charset = utf-8
7
+end_of_line = lf
8
+indent_size = 4
9
+indent_style = space
10
+insert_final_newline = true
11
+trim_trailing_whitespace = true
12
+
13
+[*.py]
14
+# Armada uses PEP8 line length of 79
15
+# Note: for VS Code, set "editor.rulers":[79] in your workspace settings
16
+max_line_length = 79
17
+
18
+[*.{yml,yaml}]
19
+indent_size = 2
20
+
21
+[Makefile]
22
+indent_style = tab
23
+
24
+[*.md]
25
+# Note: VS Code may not honor the following setting
26
+# See: https://github.com/editorconfig/editorconfig-vscode/issues/153
27
+trim_trailing_whitespace = false

+ 4
- 1
.gitignore View File

@@ -105,4 +105,7 @@ AUTHORS
105 105
 ChangeLog
106 106
 etc/armada/armada.conf
107 107
 etc/armada/policy.yaml
108
-.editorconfig
108
+
109
+# IDEs
110
+.idea/
111
+.vscode/

+ 0
- 22
.travis.yml View File

@@ -1,22 +0,0 @@
1
-language: python
2
-
3
-sudo: required
4
-
5
-python:
6
-  - "2.7"
7
-
8
-before_install:
9
-    - pip install -r test-requirements.txt
10
-    - pip install -r requirements.txt
11
-    - pip install tox
12
-
13
-install:
14
-    - pip install -e .
15
-
16
-script:
17
-    - flake8
18
-    - armada -h
19
-    - nosetests -w armada/tests/unit --cover-package=armada --with-coverage --cover-tests
20
-
21
-# after_success:
22
-#     - codecov

+ 33
- 36
CODE_OF_CONDUCT.rst View File

@@ -5,10 +5,10 @@ Our Pledge
5 5
 ----------
6 6
 
7 7
 In the interest of fostering an open and welcoming environment, we as
8
-contributors and maintainers pledge to making participation in our
9
-project and our community a harassment-free experience for everyone,
10
-regardless of age, body size, disability, ethnicity, gender identity and
11
-expression, level of experience, nationality, personal appearance, race,
8
+contributors and maintainers pledge to making participation in our project and
9
+our community a harassment-free experience for everyone, regardless of age, body
10
+size, disability, ethnicity, gender identity and expression, level of experience,
11
+education, socio-economic status, nationality, personal appearance, race,
12 12
 religion, or sexual identity and orientation.
13 13
 
14 14
 Our Standards
@@ -25,54 +25,51 @@ include:
25 25
 
26 26
 Examples of unacceptable behavior by participants include:
27 27
 
28
--  The use of sexualized language or imagery and unwelcome sexual
29
-   attention or advances
30
--  Trolling, insulting/derogatory comments, and personal or political
31
-   attacks
28
+-  The use of sexualized language or imagery and unwelcome sexual attention or
29
+   advances
30
+-  Trolling, insulting/derogatory comments, and personal or political attacks
32 31
 -  Public or private harassment
33
--  Publishing others’ private information, such as a physical or
34
-   electronic address, without explicit permission
32
+-  Publishing others’ private information, such as a physical or electronic
33
+   address, without explicit permission
35 34
 -  Other conduct which could reasonably be considered inappropriate in a
36 35
    professional setting
37 36
 
38 37
 Our Responsibilities
39 38
 --------------------
40 39
 
41
-Project maintainers are responsible for clarifying the standards of
42
-acceptable behavior and are expected to take appropriate and fair
43
-corrective action in response to any instances of unacceptable behavior.
40
+Project maintainers are responsible for clarifying the standards of acceptable
41
+behavior and are expected to take appropriate and fair corrective action in
42
+response to any instances of unacceptable behavior.
44 43
 
45
-Project maintainers have the right and responsibility to remove, edit,
46
-or reject comments, commits, code, wiki edits, issues, and other
47
-contributions that are not aligned to this Code of Conduct, or to ban
48
-temporarily or permanently any contributor for other behaviors that they
49
-deem inappropriate, threatening, offensive, or harmful.
44
+Project maintainers have the right and responsibility to remove, edit, or
45
+reject comments, commits, code, wiki edits, issues, and other contributions
46
+that are not aligned to this Code of Conduct, or to ban temporarily or
47
+permanently any contributor for other behaviors that they deem inappropriate,
48
+threatening, offensive, or harmful.
50 49
 
51 50
 Scope
52 51
 -----
53 52
 
54
-This Code of Conduct applies both within project spaces and in public
55
-spaces when an individual is representing the project or its community.
56
-Examples of representing a project or community include using an
57
-official project e-mail address, posting via an official social media
58
-account, or acting as an appointed representative at an online or
59
-offline event. Representation of a project may be further defined and
60
-clarified by project maintainers.
53
+This Code of Conduct applies both within project spaces and in public spaces
54
+when an individual is representing the project or its community. Examples of
55
+representing a project or community include using an official project e-mail
56
+address, posting via an official social media account, or acting as an appointed
57
+representative at an online or offline event. Representation of a project may be
58
+further defined and clarified by project maintainers.
61 59
 
62 60
 Enforcement
63 61
 -----------
64 62
 
65
-Instances of abusive, harassing, or otherwise unacceptable behavior may
66
-be reported by contacting the project team. The
67
-project team will review and investigate all complaints, and will
68
-respond in a way that it deems appropriate to the circumstances. The
69
-project team is obligated to maintain confidentiality with regard to the
70
-reporter of an incident. Further details of specific enforcement
71
-policies may be posted separately.
72
-
73
-Project maintainers who do not follow or enforce the Code of Conduct in
74
-good faith may face temporary or permanent repercussions as determined
75
-by other members of the project’s leadership.
63
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
64
+reported by contacting the project team. All
65
+complaints will be reviewed and investigated and will result in a response that
66
+is deemed necessary and appropriate to the circumstances. The project team is
67
+obligated to maintain confidentiality with regard to the reporter of an incident.
68
+Further details of specific enforcement policies may be posted separately.
69
+
70
+Project maintainers who do not follow or enforce the Code of Conduct in good
71
+faith may face temporary or permanent repercussions as determined by other
72
+members of the project’s leadership.
76 73
 
77 74
 Attribution
78 75
 -----------

+ 13
- 13
CONTRIBUTING.rst View File

@@ -7,7 +7,7 @@ involved in contributing to Armada.
7 7
 Code of Conduct
8 8
 ---------------
9 9
 By contributing to Armada, you are agreeing to uphold the
10
-`Contributor Convenant Code of Conduct <https://github.com/att-comdev/armada/
10
+`Contributor Covenant Code of Conduct <https://github.com/att-comdev/armada/
11 11
 blob/master/CODE_OF_CONDUCT.rst>`_. Please familiarize yourself with it
12 12
 before contributing.
13 13
 
@@ -37,12 +37,12 @@ the issue type.
37 37
 +=============+===============================================================+
38 38
 | bug         | Indicates a confirmed bug or other unexpected behavior        |
39 39
 +-------------+---------------------------------------------------------------+
40
-| ehancement  | Feature request                                               |
40
+| enhancement | Feature request                                               |
41 41
 +-------------+---------------------------------------------------------------+
42 42
 | question    | Indicates a question                                          |
43 43
 +-------------+---------------------------------------------------------------+
44 44
 | docs        | Assigned to issues indicating missing or incomplete           |
45
-|             | documenation                                                  |
45
+|             | documentation                                                 |
46 46
 +-------------+---------------------------------------------------------------+
47 47
 | duplicate   | Assigned to issues that are duplicates of previously reported |
48 48
 |             | issues                                                        |
@@ -83,9 +83,9 @@ readme.html#getting-started>`_
83 83
 Armada accepts patches through GerritHub changes. Each commit pushed to
84 84
 GerritHub is recognized as a "change" (the equivalent of a GitHub pull
85 85
 request). When a change is pushed to GerritHub for review, it contains an
86
-intial patch set that shows all of the revised changes. When a Gerrit change is
87
-amended, a new patch set is created to show the differences from the previous
88
-patch set.
86
+initial patch set that shows all of the revised changes. When a Gerrit change
87
+is amended, a new patch set is created to show the differences from the
88
+previous patch set.
89 89
 
90 90
 The general workflow for submitting a change is:
91 91
 
@@ -114,7 +114,7 @@ installed. Git-review can be installed using Python
114 114
 
115 115
     pip install git-review
116 116
 
117
-Git-review can also be intalled on Ubuntu by executing:
117
+Git-review can also be installed on Ubuntu by executing:
118 118
 
119 119
 .. code-block:: bash
120 120
 
@@ -138,7 +138,7 @@ connecting-to-github-with-ssh/>`_.
138 138
 
139 139
 If you require authentication over HTTPS, you will need to generate an
140 140
 `HTTPS password <https://review.gerrithub.io/#/settings/http-password>`_.
141
-Once you have generated an HTTPS passowrd, add the repository to your remote
141
+Once you have generated an HTTPS password, add the repository to your remote
142 142
 repositories
143 143
 
144 144
 .. code-block:: bash
@@ -178,7 +178,7 @@ Armada uses Karma inspired `Semantic Commit Messages
178 178
 
179 179
 In the above template, `TYPE` refers to the type of change, `SCOPE` refers to
180 180
 the area where the change occurs (i.e. api, cli, source), `TITLE` is the title
181
-of the commit message, `DESCRIPTION` is a desription of the change, and
181
+of the commit message, `DESCRIPTION` is a description of the change, and
182 182
 `ISSUE-REFERENCE` is a link to the GitHub issue the change addresses.
183 183
 
184 184
 Below is a list of possible types:
@@ -201,7 +201,7 @@ Below is a list of possible types:
201 201
 
202 202
 .. NOTE::
203 203
 
204
-    The scope component of a commit message may be ommited if the change
204
+    The scope component of a commit message may be committed if the change
205 205
     covers more than a single component of Armada.
206 206
 
207 207
 An commit message for a change that adds a new API endpoint might resemble the
@@ -218,7 +218,7 @@ following example:
218 218
 .. NOTE::
219 219
 
220 220
     It is necessary to leave a blank line between the commit title and
221
-    desciption in order for a change to appear properly on GerritHub.
221
+    description in order for a change to appear properly on GerritHub.
222 222
 
223 223
 Since each commit is represented as a "change" in GerritHub, multiple commits
224 224
 should be squashed into one commit before pushing to GerritHub for review. To
@@ -241,7 +241,7 @@ Your change will now be visible on GerritHub for review. In order to amend your
241 241
 change after pushing it for review, you will need to create additional
242 242
 patch sets.
243 243
 
244
-In order to create an additional patch set, modify your exisiting commit and
244
+In order to create an additional patch set, modify your existing commit and
245 245
 push your new changes for review
246 246
 
247 247
 .. code-block:: bash
@@ -304,5 +304,5 @@ and conforms to the PEP8 style guide, execute:
304 304
 .. code-block:: bash
305 305
 
306 306
     tox -e pep8
307
-    tox -e py27,py35
307
+    tox -e py35
308 308
     tox -e coverage

+ 5
- 5
Dockerfile View File

@@ -12,17 +12,17 @@ RUN pip3 install -r /tmp/requirements.txt
12 12
 COPY . /armada
13 13
 RUN apt-get update && \
14 14
     apt-get install -y --no-install-recommends \
15
-      netbase \
16
-      curl \
17
-      git && \
15
+        netbase \
16
+        curl \
17
+        git && \
18 18
     useradd -u 1000 -g users -d /armada armada && \
19 19
     chown -R armada:users /armada && \
20 20
     mv /armada/etc/armada /etc/ && \
21 21
     cd /armada && \
22 22
     python3 setup.py install && \
23 23
     rm -rf \
24
-      /root/.cache \
25
-      /var/lib/apt/lists/*
24
+        /root/.cache \
25
+        /var/lib/apt/lists/*
26 26
 
27 27
 EXPOSE 8000
28 28
 

+ 0
- 4
Makefile View File

@@ -62,7 +62,6 @@ check-tox:
62 62
 images: check-docker
63 63
 	docker build --rm -t ${IMAGE} .
64 64
 
65
-
66 65
 .PHONY: dry-run
67 66
 dry-run: clean
68 67
 	tools/helm_tk.sh $(HELM)
@@ -107,10 +106,7 @@ helm_lint:
107 106
 	@tools/helm_tk.sh $(HELM)
108 107
 	$(HELM) lint $(CHART)
109 108
 
110
-
111 109
 .PHONY: charts
112 110
 charts: clean
113 111
 	$(HELM) dep up $(CHART)
114 112
 	$(HELM) package $(CHART)
115
-
116
-

+ 0
- 9
OWNERS View File

@@ -1,9 +0,0 @@
1
-reviewers:
2
-  - alanmeadows
3
-  - v1k0d3n
4
-  - intlabs
5
-  - wilkers-steve
6
-  - larryrensing
7
-approvers:
8
-  - alanmeadows
9
-  - v1k0d3n

+ 2
- 4
README.rst View File

@@ -1,7 +1,7 @@
1 1
 Armada
2 2
 ======
3 3
 
4
-|Docker Repository on Quay| |Build Status| |Doc Status|
4
+|Docker Repository on Quay| |Doc Status|
5 5
 
6 6
 Armada is a tool for managing multiple Helm charts with dependencies by
7 7
 centralizing all configurations in a single Armada YAML and providing
@@ -83,7 +83,7 @@ Usage
83 83
 To run Armada, simply supply it with your YAML-based intention for any
84 84
 number of charts::
85 85
 
86
-  $ armada apply examples/openstack-helm.yaml [--debug-loggging ]
86
+  $ armada apply examples/openstack-helm.yaml [ --debug ]
87 87
 
88 88
 Which should output something like this::
89 89
 
@@ -121,7 +121,5 @@ Further Reading
121 121
 
122 122
 .. |Docker Repository on Quay| image:: https://quay.io/repository/attcomdev/armada/status
123 123
    :target: https://quay.io/repository/attcomdev/armada
124
-.. |Build Status| image:: https://travis-ci.org/att-comdev/armada.svg?branch=master
125
-   :target: https://travis-ci.org/att-comdev/armada
126 124
 .. |Doc Status| image:: https://readthedocs.org/projects/armada-helm/badge/?version=latest
127 125
    :target: http://armada-helm.readthedocs.io/

+ 13
- 13
armada/cli/apply.py View File

@@ -33,11 +33,11 @@ def apply():
33 33
 
34 34
 
35 35
 DESC = """
36
-This command install and updates charts defined in armada manifest
36
+This command installs and updates charts defined in Armada manifest.
37 37
 
38 38
 The apply argument must be relative path to Armada Manifest. Executing apply
39
-commnad once will install all charts defined in manifest. Re-executing apply
40
-commnad will execute upgrade.
39
+command once will install all charts defined in manifest. Re-executing apply
40
+command will execute upgrade.
41 41
 
42 42
 To see how to create an Armada manifest:
43 43
     http://armada-helm.readthedocs.io/en/latest/operations/
@@ -51,7 +51,7 @@ To obtain override manifest:
51 51
 
52 52
     \b
53 53
     $ armada apply examples/simple.yaml \
54
---set manifest:simple-armada:relase_name="wordpress"
54
+--set manifest:simple-armada:release_name="wordpress"
55 55
 
56 56
     \b
57 57
     or
@@ -62,13 +62,14 @@ To obtain override manifest:
62 62
 
63 63
 """
64 64
 
65
-SHORT_DESC = "command install manifest charts"
65
+SHORT_DESC = "Command installs manifest charts."
66 66
 
67 67
 
68 68
 @apply.command(name='apply',
69 69
                help=DESC,
70 70
                short_help=SHORT_DESC)
71
-@click.argument('locations', nargs=-1)
71
+@click.argument('locations',
72
+                nargs=-1)
72 73
 @click.option('--api',
73 74
               help="Contacts service endpoint.",
74 75
               is_flag=True)
@@ -105,8 +106,7 @@ SHORT_DESC = "command install manifest charts"
105 106
               help="Specifies time to wait for charts to deploy.",
106 107
               type=int,
107 108
               default=3600)
108
-@click.option('--values',
109
-              '-f',
109
+@click.option('--values', '-f',
110 110
               help=("Use to override multiple Armada Manifest values by "
111 111
                     "reading overrides from a values.yaml-type file."),
112 112
               multiple=True,
@@ -116,12 +116,12 @@ SHORT_DESC = "command install manifest charts"
116 116
               help="Wait until all charts deployed.",
117 117
               is_flag=True)
118 118
 @click.option('--target-manifest',
119
-              help=('The target manifest to run. Required for specifying '
120
-                    'which manifest to run when multiple are available.'),
119
+              help=("The target manifest to run. Required for specifying "
120
+                    "which manifest to run when multiple are available."),
121 121
               default=None)
122
-@click.option('--debug/--no-debug',
123
-              help='Enable or disable debugging.',
124
-              default=False)
122
+@click.option('--debug',
123
+              help="Enable debug logging.",
124
+              is_flag=True)
125 125
 @click.pass_context
126 126
 def apply_create(ctx, locations, api, disable_update_post, disable_update_pre,
127 127
                  dry_run, enable_chart_cleanup, set, tiller_host, tiller_port,

+ 22
- 13
armada/cli/delete.py View File

@@ -36,7 +36,7 @@ This command deletes releases.
36 36
 The delete command will delete the releases either via a manifest
37 37
 or by targeting specific releases.
38 38
 
39
-To delete all the releases that are created by the armada manifest:
39
+To delete all the releases that are created by the Armada manifest:
40 40
 
41 41
     $ armada delete --manifest examples/simple.yaml
42 42
 
@@ -50,18 +50,27 @@ To delete releases by the name:
50 50
 
51 51
 """
52 52
 
53
-SHORT_DESC = "command delete releases"
54
-
55
-
56
-@delete.command(name='delete', help=DESC, short_help=SHORT_DESC)
57
-@click.option('--manifest', help='Armada manifest file', type=str)
58
-@click.option(
59
-    '--releases', help='Comma-separated list of release names', type=str)
60
-@click.option(
61
-    '--no-purge', help="Deletes release without purge option", is_flag=True)
62
-@click.option('--tiller-host', help="Tiller Host IP")
63
-@click.option(
64
-    '--tiller-port', help="Tiller host Port", type=int, default=44134)
53
+SHORT_DESC = "Command deletes releases."
54
+
55
+
56
+@delete.command(name='delete',
57
+                help=DESC,
58
+                short_help=SHORT_DESC)
59
+@click.option('--manifest',
60
+              help="Armada Manifest file.",
61
+              type=str)
62
+@click.option('--releases',
63
+              help="Comma-separated list of release names.",
64
+              type=str)
65
+@click.option('--no-purge',
66
+              help="Deletes release without purge option.",
67
+              is_flag=True)
68
+@click.option('--tiller-host',
69
+              help="Tiller host IP.")
70
+@click.option('--tiller-port',
71
+              help="Tiller host port.",
72
+              type=int,
73
+              default=44134)
65 74
 @click.pass_context
66 75
 def delete_charts(ctx, manifest, releases, no_purge, tiller_host, tiller_port):
67 76
     DeleteChartManifest(

+ 27
- 17
armada/cli/test.py View File

@@ -34,13 +34,13 @@ def test():
34 34
 
35 35
 
36 36
 DESC = """
37
-This command test deployed charts
37
+This command tests deployed charts.
38 38
 
39
-The tiller command uses flags to obtain information from tiller services.
39
+The tiller command uses flags to obtain information from Tiller services.
40 40
 The test command will run the release chart tests either via a the manifest or
41
-by targetings a relase.
41
+by targeting a release.
42 42
 
43
-To test armada deployed releases:
43
+To test Armada deployed releases:
44 44
 
45 45
     $ armada test --file examples/simple.yaml
46 46
 
@@ -50,22 +50,32 @@ To test release:
50 50
 
51 51
 """
52 52
 
53
-SHORT_DESC = "command test releases"
53
+SHORT_DESC = "Command tests releases."
54 54
 
55 55
 
56
-@test.command(name='test', help=DESC, short_help=SHORT_DESC)
57
-@click.option('--file', help='armada manifest', type=str)
58
-@click.option('--release', help='helm release', type=str)
59
-@click.option('--tiller-host', help="Tiller Host IP", default=None)
60
-@click.option(
61
-    '--tiller-port', help="Tiller Host Port", type=int,
62
-    default=CONF.tiller_port)
63
-@click.option(
64
-    '--tiller-namespace', '-tn', help="Tiller Namespace", type=str,
65
-    default=CONF.tiller_namespace)
56
+@test.command(name='test',
57
+              help=DESC,
58
+              short_help=SHORT_DESC)
59
+@click.option('--file',
60
+              help="Armada manifest.",
61
+              type=str)
62
+@click.option('--release',
63
+              help="Helm release.",
64
+              type=str)
65
+@click.option('--tiller-host',
66
+              help="Tiller host IP.",
67
+              default=None)
68
+@click.option('--tiller-port',
69
+              help="Tiller host port.",
70
+              type=int,
71
+              default=CONF.tiller_port)
72
+@click.option('--tiller-namespace', '-tn',
73
+              help="Tiller Namespace.",
74
+              type=str,
75
+              default=CONF.tiller_namespace)
66 76
 @click.option('--target-manifest',
67
-              help=('The target manifest to run. Required for specifying '
68
-                    'which manifest to run when multiple are available.'),
77
+              help=("The target manifest to run. Required for specifying "
78
+                    "which manifest to run when multiple are available."),
69 79
               default=None)
70 80
 @click.pass_context
71 81
 def test_charts(ctx, file, release, tiller_host, tiller_port, tiller_namespace,

+ 27
- 17
armada/cli/tiller.py View File

@@ -30,33 +30,43 @@ def tiller():
30 30
 
31 31
 
32 32
 DESC = """
33
-This command gets tiller information
33
+This command gets Tiller information
34 34
 
35
-The tiller command uses flags to obtain information from tiller services
35
+The tiller command uses flags to obtain information from Tiller services
36 36
 
37
-To obtain armada deployed releases:
37
+To obtain Armada deployed releases:
38 38
 
39 39
     $ armada tiller --releases
40 40
 
41
-To obtain tiller service status/information:
41
+To obtain Tiller service status/information:
42 42
 
43 43
     $ armada tiller --status
44 44
 
45 45
 """
46 46
 
47
-SHORT_DESC = "command gets tiller infromation"
48
-
49
-
50
-@tiller.command(name='tiller', help=DESC, short_help=SHORT_DESC)
51
-@click.option('--tiller-host', help="Tiller host ip", default=None)
52
-@click.option(
53
-    '--tiller-port', help="Tiller host port", type=int,
54
-    default=CONF.tiller_port)
55
-@click.option(
56
-    '--tiller-namespace', '-tn', help="Tiller namespace", type=str,
57
-    default=CONF.tiller_namespace)
58
-@click.option('--releases', help="list of deployed releses", is_flag=True)
59
-@click.option('--status', help="Status of Armada services", is_flag=True)
47
+SHORT_DESC = "Command gets Tiller information."
48
+
49
+
50
+@tiller.command(name='tiller',
51
+                help=DESC,
52
+                short_help=SHORT_DESC)
53
+@click.option('--tiller-host',
54
+              help="Tiller host IP.",
55
+              default=None)
56
+@click.option('--tiller-port',
57
+              help="Tiller host port.",
58
+              type=int,
59
+              default=CONF.tiller_port)
60
+@click.option('--tiller-namespace', '-tn',
61
+              help="Tiller namespace.",
62
+              type=str,
63
+              default=CONF.tiller_namespace)
64
+@click.option('--releases',
65
+              help="List of deployed releases.",
66
+              is_flag=True)
67
+@click.option('--status',
68
+              help="Status of Armada services.",
69
+              is_flag=True)
60 70
 @click.pass_context
61 71
 def tiller_service(ctx, tiller_host, tiller_port, tiller_namespace, releases,
62 72
                    status):

+ 7
- 4
armada/cli/validate.py View File

@@ -30,7 +30,7 @@ def validate():
30 30
 
31 31
 
32 32
 DESC = """
33
-This command validates Armada Manifest
33
+This command validates an Armada Manifest.
34 34
 
35 35
 The validate argument must be a relative path to Armada manifest
36 36
 
@@ -38,11 +38,14 @@ The validate argument must be a relative path to Armada manifest
38 38
 
39 39
 """
40 40
 
41
-SHORT_DESC = "command validates Armada Manifest"
41
+SHORT_DESC = "Command validates Armada Manifest."
42 42
 
43 43
 
44
-@validate.command(name='validate', help=DESC, short_help=SHORT_DESC)
45
-@click.argument('locations', nargs=-1)
44
+@validate.command(name='validate',
45
+                  help=DESC,
46
+                  short_help=SHORT_DESC)
47
+@click.argument('locations',
48
+                nargs=-1)
46 49
 @click.pass_context
47 50
 def validate_manifest(ctx, locations):
48 51
     ValidateManifest(ctx, locations).invoke()

+ 2
- 2
armada/common/policies/tiller.py View File

@@ -19,13 +19,13 @@ tiller_policies = [
19 19
     policy.DocumentedRuleDefault(
20 20
         name=base.TILLER % 'get_status',
21 21
         check_str=base.RULE_ADMIN_REQUIRED,
22
-        description='Get tiller status',
22
+        description='Get Tiller status',
23 23
         operations=[{'path': '/api/v1.0/status/', 'method': 'GET'}]),
24 24
 
25 25
     policy.DocumentedRuleDefault(
26 26
         name=base.TILLER % 'get_release',
27 27
         check_str=base.RULE_ADMIN_REQUIRED,
28
-        description='Get tiller release',
28
+        description='Get Tiller release',
29 29
         operations=[{'path': '/api/v1.0/releases/', 'method': 'GET'}]),
30 30
 ]
31 31
 

+ 3
- 3
armada/conf/default.py View File

@@ -69,17 +69,17 @@ The Keystone project domain name used for authentication.
69 69
     cfg.StrOpt(
70 70
         'tiller_pod_labels',
71 71
         default='app=helm,name=tiller',
72
-        help=utils.fmt('Labels for the tiller pod.')),
72
+        help=utils.fmt('Labels for the Tiller pod.')),
73 73
 
74 74
     cfg.StrOpt(
75 75
         'tiller_namespace',
76 76
         default='kube-system',
77
-        help=utils.fmt('Namespace for the tiller pod.')),
77
+        help=utils.fmt('Namespace for the Tiller pod.')),
78 78
 
79 79
     cfg.IntOpt(
80 80
         'tiller_port',
81 81
         default=44134,
82
-        help=utils.fmt('Port for the tiller pod.')),
82
+        help=utils.fmt('Port for the Tiller pod.')),
83 83
 
84 84
     cfg.ListOpt(
85 85
         'tiller_release_roles',

+ 5
- 5
armada/exceptions/api_exceptions.py View File

@@ -24,28 +24,28 @@ class ApiException(base.ArmadaBaseException):
24 24
 class ApiBaseException(ApiException):
25 25
     '''Exception that occurs during chart cleanup.'''
26 26
 
27
-    message = 'There was an error listing the helm chart releases.'
27
+    message = 'There was an error listing the Helm chart releases.'
28 28
 
29 29
 
30 30
 class ApiJsonException(ApiException):
31 31
     '''Exception that occurs during chart cleanup.'''
32 32
 
33
-    message = 'There was an error listing the helm chart releases.'
33
+    message = 'There was an error listing the Helm chart releases.'
34 34
 
35 35
 
36 36
 class ClientUnauthorizedError(ApiException):
37 37
     '''Exception that occurs during chart cleanup.'''
38 38
 
39
-    message = 'There was an error listing the helm chart releases.'
39
+    message = 'There was an error listing the Helm chart releases.'
40 40
 
41 41
 
42 42
 class ClientForbiddenError(ApiException):
43 43
     '''Exception that occurs during chart cleanup.'''
44 44
 
45
-    message = 'There was an error listing the helm chart releases.'
45
+    message = 'There was an error listing the Helm chart releases.'
46 46
 
47 47
 
48 48
 class ClientError(ApiException):
49 49
     '''Exception that occurs during chart cleanup.'''
50 50
 
51
-    message = 'There was an error listing the helm chart releases.'
51
+    message = 'There was an error listing the Helm chart releases.'

+ 10
- 10
armada/exceptions/tiller_exceptions.py View File

@@ -18,20 +18,20 @@ from armada.exceptions.base_exception import ArmadaBaseException as ex
18 18
 class TillerException(ex):
19 19
     '''Base class for Tiller exceptions and error handling.'''
20 20
 
21
-    message = 'An unknown Tiller error occured.'
21
+    message = 'An unknown Tiller error occurred.'
22 22
 
23 23
 
24 24
 class TillerServicesUnavailableException(TillerException):
25
-    '''Exception for tiller services unavailable.'''
25
+    '''Exception for Tiller services unavailable.'''
26 26
 
27 27
     message = 'Tiller services unavailable.'
28 28
 
29 29
 
30 30
 class ChartCleanupException(TillerException):
31
-    '''Exception that occures during chart cleanup.'''
31
+    '''Exception that occurs during chart cleanup.'''
32 32
 
33 33
     def __init__(self, chart_name):
34
-        message = 'An error occred during cleanup while removing {}'.format(
34
+        message = 'An error occurred during cleanup while removing {}'.format(
35 35
             chart_name)
36 36
         super(ChartCleanupException, self).__init__(message)
37 37
 
@@ -39,7 +39,7 @@ class ChartCleanupException(TillerException):
39 39
 class ListChartsException(TillerException):
40 40
     '''Exception that occurs when listing charts'''
41 41
 
42
-    message = 'There was an error listing the helm chart releases.'
42
+    message = 'There was an error listing the Helm chart releases.'
43 43
 
44 44
 
45 45
 class PostUpdateJobDeleteException(TillerException):
@@ -98,9 +98,9 @@ class ReleaseException(TillerException):
98 98
 
99 99
 
100 100
 class ChannelException(TillerException):
101
-    '''Exception that occurs during a failed GRPC channel creation'''
101
+    '''Exception that occurs during a failed gRPC channel creation'''
102 102
 
103
-    message = 'Failed to create GRPC channel.'
103
+    message = 'Failed to create gRPC channel.'
104 104
 
105 105
 
106 106
 class GetReleaseStatusException(TillerException):
@@ -129,15 +129,15 @@ class TillerPodNotFoundException(TillerException):
129 129
     '''
130 130
 
131 131
     def __init__(self, labels):
132
-        message = 'Could not find tiller pod with labels "{}"'.format(labels)
132
+        message = 'Could not find Tiller pod with labels "{}"'.format(labels)
133 133
 
134 134
         super(TillerPodNotFoundException, self).__init__(message)
135 135
 
136 136
 
137 137
 class TillerPodNotRunningException(TillerException):
138
-    '''Exception that occurs when no tiller pod is found in a running state'''
138
+    '''Exception that occurs when no Tiller pod is found in a running state'''
139 139
 
140
-    message = 'No tiller pods found in running state'
140
+    message = 'No Tiller pods found in running state'
141 141
 
142 142
 
143 143
 class TillerVersionException(TillerException):

+ 5
- 4
armada/handlers/armada.py View File

@@ -184,9 +184,10 @@ class Armada(object):
184 184
 
185 185
             if repo_branch not in repos:
186 186
                 try:
187
-                    LOG.info('Cloning repo: %s branch: %s', *repo_branch)
187
+                    logstr = 'Cloning repo: {} branch: {}'.format(*repo_branch)
188 188
                     if proxy_server:
189
-                        LOG.info('Using proxy to clone: %s', proxy_server)
189
+                        logstr += ' proxy: {}'.format(proxy_server)
190
+                    LOG.info(logstr)
190 191
                     repo_dir = source.git_clone(*repo_branch, proxy_server)
191 192
                 except Exception:
192 193
                     raise source_exceptions.GitException(
@@ -216,7 +217,7 @@ class Armada(object):
216 217
 
217 218
     def sync(self):
218 219
         '''
219
-        Syncronize Helm with the Armada Config(s)
220
+        Synchronize Helm with the Armada Config(s)
220 221
         '''
221 222
 
222 223
         msg = {'install': [], 'upgrade': [], 'diff': []}
@@ -235,7 +236,7 @@ class Armada(object):
235 236
             raise armada_exceptions.KnownReleasesException()
236 237
 
237 238
         for release in known_releases:
238
-            LOG.debug("Release %s, Version %s found on tiller", release[0],
239
+            LOG.debug("Release %s, Version %s found on Tiller", release[0],
239 240
                       release[1])
240 241
 
241 242
         for entry in self.config[const.KEYWORD_ARMADA][const.KEYWORD_GROUPS]:

+ 14
- 9
armada/shell.py View File

@@ -30,15 +30,20 @@ CONF = cfg.CONF
30 30
 
31 31
 
32 32
 @click.group()
33
-@click.option(
34
-    '--debug/--no-debug', help='Enable or disable debugging', default=False)
35
-@click.option(
36
-    '--api/--no-api', help='Execute service endpoints. (requires url option)',
37
-    default=False)
38
-@click.option(
39
-    '--url', help='Armada Service Endpoint', envvar='HOST', default=None)
40
-@click.option(
41
-    '--token', help='Keystone Service Token', envvar='TOKEN', default=None)
33
+@click.option('--debug',
34
+              help="Enable debug logging",
35
+              is_flag=True)
36
+@click.option('--api/--no-api',
37
+              help="Execute service endpoints. (requires url option)",
38
+              default=False)
39
+@click.option('--url',
40
+              help="Armada Service Endpoint",
41
+              envvar='HOST',
42
+              default=None)
43
+@click.option('--token',
44
+              help="Keystone Service Token",
45
+              envvar='TOKEN',
46
+              default=None)
42 47
 @click.pass_context
43 48
 def main(ctx, debug, api, url, token):
44 49
     """

+ 2
- 2
armada/utils/source.py View File

@@ -47,11 +47,11 @@ def git_clone(repo_url, ref='master', proxy_server=None):
47 47
 
48 48
     try:
49 49
         if proxy_server:
50
-            LOG.info('Cloning [%s] with proxy [%s]', repo_url, proxy_server)
50
+            LOG.debug('Cloning [%s] with proxy [%s]', repo_url, proxy_server)
51 51
             repo = Repo.clone_from(repo_url, _tmp_dir,
52 52
                                    config='http.proxy=%s' % proxy_server)
53 53
         else:
54
-            LOG.info('Cloning [%s]', repo_url)
54
+            LOG.debug('Cloning [%s]', repo_url)
55 55
             repo = Repo.clone_from(repo_url, _tmp_dir)
56 56
 
57 57
         repo.remotes.origin.fetch(ref)

+ 0
- 1
charts/armada/templates/job-ks-user.yaml View File

@@ -65,4 +65,3 @@ spec:
65 65
             name: armada-bin
66 66
             defaultMode: 0555
67 67
 {{- end }}
68
-

+ 0
- 1
charts/armada/templates/secret-keystone-env.yaml View File

@@ -28,4 +28,3 @@ data:
28 28
 {{- tuple $userClass "internal" $envAll | include "helm-toolkit.snippets.keystone_secret_openrc" | indent 2 -}}
29 29
 {{- end }}
30 30
 {{- end }}
31
-

+ 1
- 1
charts/tiller/values.yaml View File

@@ -24,7 +24,7 @@ images:
24 24
   pull_policy: "IfNotPresent"
25 25
 
26 26
 deployment:
27
-  # NOTE: CUrrent replica is hard-coded to 1. This is a placeholder variable
27
+  # NOTE: Current replica is hard-coded to 1. This is a placeholder variable
28 28
   # for future usage. Updates will be made to the chart when we know that
29 29
   # tiller is stable with multiple instances.
30 30
   replicas: 1

+ 16
- 17
controller.sh View File

@@ -7,31 +7,30 @@ clean_container(){
7 7
 }
8 8
 
9 9
 readlink(){
10
-  (
11
-  cd $(dirname $1)
12
-  echo $PWD/$(basename $1)
13
-  )
10
+    (
11
+    cd $(dirname $1)
12
+    echo $PWD/$(basename $1)
13
+    )
14 14
 }
15 15
 
16 16
 # Check to see if the aramada container exists
17 17
 if [ -n "$( sudo docker ps -a | grep quay.io/attcomdev/armada )" ]; then
18
-  echo "Armada container already exists..."
19
-  clean_container armada
18
+    echo "Armada container already exists..."
19
+    clean_container armada
20 20
 fi
21 21
 
22 22
 # Check to see if the user is trying to apply a chart
23 23
 if [ $1 = "apply" ]; then
24
-  # TODO Handle erroneous or missing inputs
25
-  # Bring up a new armada container with passed in yaml mounted to the container
26
-  echo "Creating an Armada container..."
27
-  docker run -d --net host -p 8000:8000 --name armada  -v $(readlink $(dirname $2)):$(readlink $(dirname $2)) -v ~/.kube/config:/armada/.kube/config -v ~/.kube/plugins/armada/examples/:/examples quay.io/attcomdev/armada:latest
28
-  docker exec armada armada apply $(readlink $2)
24
+    # TODO Handle erroneous or missing inputs
25
+    # Bring up a new armada container with passed in yaml mounted to the container
26
+    echo "Creating an Armada container..."
27
+    docker run -d --net host -p 8000:8000 --name armada -v $(readlink $(dirname $2)):$(readlink $(dirname $2)) -v ~/.kube/config:/armada/.kube/config -v ~/.kube/plugins/armada/examples/:/examples quay.io/attcomdev/armada:latest
28
+    docker exec armada armada apply $(readlink $2)
29 29
 else
30
-  # For any other command the chart does not need to be mounted to the container
31
-  # Bring up a new armada container
32
-  echo "Creating an Armada container..."
33
-  docker run -d --net host -p 8000:8000 --name armada -v ~/.kube/config:/armada/.kube/config -v ~/.kube/plugins/armada/examples/:/examples quay.io/attcomdev/armada:latest
34
-  docker exec armada armada "$@"
30
+    # For any other command the chart does not need to be mounted to the container
31
+    # Bring up a new armada container
32
+    echo "Creating an Armada container..."
33
+    docker run -d --net host -p 8000:8000 --name armada -v ~/.kube/config:/armada/.kube/config -v ~/.kube/plugins/armada/examples/:/examples quay.io/attcomdev/armada:latest
34
+    docker exec armada armada "$@"
35 35
 fi
36 36
 clean_container armada
37
-

+ 3
- 3
docs/source/commands/apply.rst View File

@@ -24,7 +24,7 @@ Commands
24 24
 
25 25
       To obtain override manifest:
26 26
 
27
-          $ armada apply examples/simple.yaml --set manifest:simple-armada:relase_name="wordpress"
27
+          $ armada apply examples/simple.yaml --set manifest:simple-armada:release_name="wordpress"
28 28
 
29 29
           or
30 30
 
@@ -50,7 +50,7 @@ Commands
50 50
       --target-manifest TEXT        The target manifest to run. Required for
51 51
                                     specifying which manifest to run when multiple
52 52
                                     are available.
53
-      --debug / --no-debug          Enable or disable debugging.
53
+      --debug                       Enable debug logging.
54 54
       --help                        Show this message and exit.
55 55
 
56 56
 Synopsis
@@ -61,7 +61,7 @@ that it will deploy into the tiller service in your Kubernetes cluster.
61 61
 Executing the ``armada apply`` again on existing armada deployment will start
62 62
 an update of the armada deployed charts.
63 63
 
64
-``armada apply armada-manifest.yaml [--debug-logging]``
64
+``armada apply armada-manifest.yaml [--debug]``
65 65
 
66 66
 If you remove ``armada/Charts/v1`` from the ``armada/ChartGroups/v1`` in the armada
67 67
 manifest and execute an ``armada apply`` with the  ``--enable-chart-cleanup`` flag.

+ 0
- 1
etc/armada/policy.yaml View File

@@ -30,4 +30,3 @@
30 30
 # Get tiller release
31 31
 # GET  /api/v1.0/releases/
32 32
 #"tiller:get_release": "rule:admin_required"
33
-

+ 2
- 2
plugin.yaml View File

@@ -1,8 +1,8 @@
1 1
 name: "armada"
2 2
 version: "0.0.3"
3
-usage: "Manages multiple helm charts with a centralized armada yaml"
3
+usage: "Manages multiple Helm charts with a centralized Armada yaml"
4 4
 description: |-
5
-  This plugin provides helm access to armada. A tool for managing multiple helm charts with dependencies by centralizing all configurations in a single Armada yaml and providing lifecycle hooks for all helm releases
5
+  This plugin provides Helm access to Armada. A tool for managing multiple Helm charts with dependencies by centralizing all configurations in a single Armada yaml and providing lifecycle hooks for all Helm releases
6 6
   usage:
7 7
     $ helm armada tiller --status
8 8
     $ helm armada apply /examples/openstack-helm.yaml

+ 2
- 4
setup.cfg View File

@@ -1,6 +1,6 @@
1 1
 [metadata]
2 2
 name = armada
3
-summary = tool for managing multiple chart ocherstartion lifecycle
3
+summary = tool for managing multiple chart orchestration lifecycle
4 4
 description-file = README.rst
5 5
 
6 6
 author = armada team
@@ -11,8 +11,6 @@ classifier =
11 11
     License :: OSI Approved :: Apache Software License
12 12
     Operating System :: POSIX :: Linux
13 13
     Programming Language :: Python
14
-    Programming Language :: Python :: 2
15
-    Programming Language :: Python :: 2.7
16 14
     Programming Language :: Python :: 3
17 15
     Programming Language :: Python :: 3.5
18 16
 
@@ -43,7 +41,7 @@ console_scripts =
43 41
 oslo.config.opts =
44 42
     armada.conf = armada.conf.opts:list_opts
45 43
 oslo.policy.policies =
46
-  armada = armada.common.policies:list_rules
44
+    armada = armada.common.policies:list_rules
47 45
 
48 46
 [pbr]
49 47
 warnerrors = True

+ 18
- 18
tools/helm_tk.sh View File

@@ -20,26 +20,26 @@ HELM=$1
20 20
 set -x
21 21
 
22 22
 function helm_serve {
23
-  if [[ -d "$HOME/.helm" ]]; then
24
-     echo ".helm directory found"
25
-  else
26
-     ${HELM} init --client-only
27
-  fi
28
-  if [[ -z $(curl -s 127.0.0.1:8879 | grep 'Helm Repository') ]]; then
29
-     ${HELM} serve & > /dev/null
30
-     while [[ -z $(curl -s 127.0.0.1:8879 | grep 'Helm Repository') ]]; do
31
-        sleep 1
32
-        echo "Waiting for Helm Repository"
33
-     done
34
-  else
35
-     echo "Helm serve already running"
36
-  fi
23
+    if [[ -d "$HOME/.helm" ]]; then
24
+        echo ".helm directory found"
25
+    else
26
+        ${HELM} init --client-only
27
+    fi
28
+    if [[ -z $(curl -s 127.0.0.1:8879 | grep 'Helm Repository') ]]; then
29
+        ${HELM} serve & > /dev/null
30
+        while [[ -z $(curl -s 127.0.0.1:8879 | grep 'Helm Repository') ]]; do
31
+            sleep 1
32
+            echo "Waiting for Helm Repository"
33
+        done
34
+    else
35
+        echo "Helm serve already running"
36
+    fi
37 37
 
38
-  if ${HELM} repo list | grep -q "^stable" ; then
39
-     ${HELM} repo remove stable
40
-  fi
38
+    if ${HELM} repo list | grep -q "^stable" ; then
39
+        ${HELM} repo remove stable
40
+    fi
41 41
 
42
-  ${HELM} repo add local http://localhost:8879/charts
42
+    ${HELM} repo add local http://localhost:8879/charts
43 43
 }
44 44
 
45 45
 mkdir -p build

+ 14
- 13
tox.ini View File

@@ -4,47 +4,48 @@ envlist = py35, pep8, coverage, bandit
4 4
 
5 5
 [testenv]
6 6
 deps=
7
-  -r{toxinidir}/requirements.txt
8
-  -r{toxinidir}/test-requirements.txt
7
+    -r{toxinidir}/requirements.txt
8
+    -r{toxinidir}/test-requirements.txt
9 9
 passenv=HTTP_PROXY HTTPS_PROXY http_proxy https_proxy NO_PROXY no_proxy
10 10
 setenv=
11 11
     VIRTUAL_ENV={envdir}
12 12
 basepython = python3.5
13 13
 usedevelop = True
14 14
 install_command = pip install {opts} {packages}
15
-whitelist_externals = find
16
-                      flake8
15
+whitelist_externals =
16
+    find
17
+    flake8
17 18
 commands =
18
-  find . -type f -name "*.pyc" -delete
19
-  python -V
20
-  {toxinidir}/tools/run-unit-tests.sh {posargs}
19
+    find . -type f -name "*.pyc" -delete
20
+    python -V
21
+    {toxinidir}/tools/run-unit-tests.sh {posargs}
21 22
 
22 23
 [testenv:docs]
23 24
 commands =
24
-  python setup.py build_sphinx
25
+    python setup.py build_sphinx
25 26
 
26 27
 [testenv:genconfig]
27 28
 commands =
28
-  oslo-config-generator --config-file=etc/armada/config-generator.conf
29
+    oslo-config-generator --config-file=etc/armada/config-generator.conf
29 30
 
30 31
 [testenv:genpolicy]
31 32
 commands =
32
-  oslopolicy-sample-generator --config-file=etc/armada/policy-generator.conf
33
+    oslopolicy-sample-generator --config-file=etc/armada/policy-generator.conf
33 34
 
34 35
 [testenv:pep8]
35 36
 commands =
36
-  flake8 {posargs}
37
+    flake8 {posargs}
37 38
 
38 39
 [testenv:bandit]
39 40
 commands =
40
-  bandit -r armada -x armada/tests -n 5
41
+    bandit -r armada -x armada/tests -n 5
41 42
 
42 43
 [testenv:coverage]
43 44
 passenv=http_proxy https_proxy no_proxy HTTP_PROXY HTTPS_PROXY NO_PROXY
44 45
 setenv=
45 46
     VIRTUAL_ENV={envdir}
46 47
 commands =
47
-  python -m pytest \
48
+    python -m pytest \
48 49
     --cov-branch \
49 50
     --cov-report term-missing:skip-covered \
50 51
     --cov-config .coveragerc \

Loading…
Cancel
Save