Commit graph

60 commits

Author SHA1 Message Date
Erin Call 588c7cb9f7
Initialize Steps with a NewSTEPNAME function [#67]
This seems to be be a more natural separation of concerns--the knowledge
of which config fields map to which parts of a Step belong to the Step,
not to the Plan.
2020-01-16 13:50:04 -08:00
Erin Call 16117eea2f
Put the Config in a new env package [#67]
I'd like to be able to make calls like NewUpgrade(cfg) rather than
Upgrade{...}.Prepare, but I wouldn't be able to define a NewUpgrade
function while Config is in the helm package; there would be a circular
import when Plan tried to import run.
2020-01-14 10:32:20 -08:00
Erin Call a826f66425
Test settings aliases without the plugin_ prefix [#66] 2020-01-08 12:37:34 -08:00
Erin Call cfd8e33995
Use "backward-compatible", not "backwardS"
While writing docs in the previous commit, I noticed that we'd been
inconsistent in the naming scheme. Wikipedia's back-compat article
redirects from "backwards" to "backward", so I figure that's a
reasonable source of authority for which form to use.
2020-01-08 11:04:30 -08:00
Erin Call a5342d7bac
Default to the canonical setting names [#66]
The goal with these changes was to give users a clearer, more readable
interface, so we should present that interface up front and only
document the aliases as a backward-compatibility option.

I've renamed the envconfig tags to reflect the switch, but I left the
actual field names the same. I think they're sufficiently meaningful
inside the code, and leaving them unchanged avoids making a bunch of
churn in the rest of the code.
2020-01-08 11:02:29 -08:00
Erin Call 6aa1d79d56
Stabilize the logic for setting-alias conflicts [#66]
This includes a refactor to the way aliases are processed. I had been
thinking in terms of locking down the aliases names pretty tightly, in
order to provide an error if there are conflicts. After discussion with
@josmo, though, it seems like we can do it the same way we do for
"PLUGIN_"/non-prefixed variables, i.e. quietly override them.
2020-01-08 09:35:14 -08:00
Erin Call 1d1117ba49
Use "kube" in setting aliases [#66]
Nobody likes typing "kubernetes"! Writing out that whole word without
typos is the third hard problem in computer science.
2020-01-07 15:40:58 -08:00
Erin Call 04de280821
Rough draft of aliased settings [#66] 2020-01-07 15:25:54 -08:00
Erin Call b6ba856c31
Pass CleanupOnFail to the Upgrade Step [#65]
I don't love the mismatch between the helm.Config field (CleanupOnFail)
and the setting name (cleanup_failed_upgrade). I do think the setting
name should contain "upgrade" since it's specific to the upgrade command,
but if I make the config field CleanupFailedUpgrade, it becomes the new
longest field name, and gofmt creates a bunch of churn. Is that a good
enough reason...?
2020-01-07 12:56:51 -08:00
Erin Call c8b4ad4c46
Pass an atomic_upgrade setting to the Upgrade step [#64] 2020-01-07 12:21:55 -08:00
Erin Call 8d8bcf78a7
Merge branch 'master' into keep-history 2020-01-02 13:26:53 -08:00
Erin Call 45428a2e25
Merge branch 'master' into keep-history 2020-01-02 12:29:32 -08:00
Erin Call 7b816ea257
Merge branch 'master' into values-arent-global 2020-01-02 12:29:15 -08:00
Erin Call 4330728215
Put step-specific config in those steps [#61]
This is just something that's been bugging me for a while--they're
specific to Lint and Upgrade, so that's where they belong.
2020-01-02 11:38:41 -08:00
Erin Call 3ae13d4b3c
Pass --strict to helm lint when so instructed [#28] 2020-01-02 11:25:13 -08:00
Erin Call 17724e7015
Pass --keep-history when so instructed [#24] 2020-01-02 10:58:58 -08:00
Joachim Hill-Grannec 3bf73acb42
Merge branch 'master' into deprecation-warnings 2019-12-31 18:03:00 -05:00
Erin Call 7cd46bb8b1
Emit warnings about deprecated settings [#10]
These aren't an error case--the plugin will work just fine--but users
should be aware they (the settings) aren't being respected.
2019-12-31 10:03:53 -08:00
Erin Call ab7abb699a
Remove support for the prefix setting [#48]
The setting isn't necessary with modern versions of Drone, and it
creates a lot of edge-cases. The use-case doesn't justify the added
complexity.
2019-12-31 09:28:42 -08:00
Erin Call 3985ec8faa
Merge branch 'master' into helm-repos 2019-12-30 13:29:23 -08:00
Erin Call 499ab6877f
Do repo error-checking in AddRepo.Prepare [#26] 2019-12-30 13:24:57 -08:00
Erin Call 48b6b3f5b3
Create AddRepo steps when there are repos to add [#26] 2019-12-30 11:57:19 -08:00
Joachim Hill-Grannec eb1834df49
Merge branch 'master' into help-by-default 2019-12-28 09:31:04 -07:00
Joachim Hill-Grannec 0f8657b1c2
Merge branch 'master' into update-dependencies 2019-12-28 09:29:53 -07:00
Erin Call d5a59590a1
Shim bare numbers into duration strings [#39]
Helm2's --timeout took a number of seconds, rather than the
ParseDuration-compatible string that helm3 uses. For backward-
compatibility, update a bare number into a duration string.
2019-12-27 16:20:32 -08:00
Erin Call 181165cc51
Call helm dependency update when so instructed [#25]
As with Lint, I have no idea whether the --namespace flag actually
matters here. I don't think it will hurt, though!
2019-12-27 15:06:32 -08:00
Erin Call 232bb5eb96
Rely on the PR template for docs/code consistency [#12]
These comments were a reasonable attempt at ensuring the documentation
matched reality, but the checkbox in the pull request template is much
more likely to produce results.
2019-12-26 13:03:53 -08:00
Erin Call 818c0246fa
Merge branch 'master' into help-by-default 2019-12-26 13:00:13 -08:00
Erin Call d53a1ed942
Merge branch 'master' into testplan 2019-12-26 12:26:07 -08:00
Erin Call 167b53691b
Put HelmCommand in Help, not run.Config [#15] 2019-12-26 12:23:56 -08:00
Erin Call b1899dee56
Merge remote-tracking branch 'origin/master' into help-by-default 2019-12-26 12:23:14 -08:00
Erin Call 8f2d4bec49
Merge branch 'master' into testplan 2019-12-26 12:08:30 -08:00
Joachim Hill-Grannec 253a4465f8
Merge branch 'master' into config-fixup 2019-12-26 11:36:55 -08:00
Erin Call 6d28b7b28a
Return an error on unknown commands [#15]
I'm probably overthinking this--explicitly calling help is a strange and
unusual case--but it doesn't really hurt, so I'm going for it.
2019-12-26 11:29:33 -08:00
Erin Call 34b9ec1c4c
Run the Help step by default [#15] 2019-12-26 10:47:42 -08:00
Erin Call cb58b5a021
Phrase errors in Execute the same as in Prepare [#33] 2019-12-24 15:49:47 -08:00
Erin Call d86ac72529
Test Plan.Execute [#33] 2019-12-24 15:47:26 -08:00
Erin Call 52c9fb552c
Ensure the plan test mocks' expectations are met [#33] 2019-12-24 15:33:50 -08:00
Erin Call 08ddf5e27a
Log debug output in helm.Config [#9]
Redacting KubeToken may not be sufficient, since it's possible that
someone would put secrets in Values or StringValues. Unilaterally
redacting those seems unhelpful, though, since they may be the very
thing the user is trying to debug. I've settled on redacting the obvious
field without trying to promise that all sensitive data will be hidden.
2019-12-24 11:08:09 -08:00
Erin Call 4ba1e694d9
Use a go-idiomatic constructor for helm.Config [#9] 2019-12-24 10:41:01 -08:00
Erin Call 10e7e7fee5
Document the Config struct's behavior correctly [#19] [#9] 2019-12-23 16:45:09 -08:00
Erin Call 285e9d98a4
Allow a configurable env var prefix [#19]
I'd like to keep Prefix's scope fairly limited, because it has potential
to spiral into something magnificently complex. You get one prefix
setting, it goes in `settings` not `environment`, end of feature.
2019-12-23 16:36:37 -08:00
Erin Call db87bd0507
Require no-error in config tests [#9] 2019-12-23 15:52:01 -08:00
Erin Call e2f53f3b08
Process non-prefixed forms of all config settings [#9]
Trying to guess in advance which part of the config a user will put in
the `settings` section and which they'll put in `environment` is a
fool's errand. Just let everything go in either place.

The ServiceAccount field only had an `envconfig` tag (as opposed to
`split_words`) because that triggered envconfig to look for the non-
prefixed form. Now that we're finding non-prefixed forms of everything,
we can use the clearer/more concise tag.

Note that TestPopulateWithConflictingVariables isn't meant to say
"here's what behavior we *want*" so much as "here's what the behavior
*is*." I don't think one thing is any better than the other, but we
should know which one we're getting.
2019-12-23 15:34:08 -08:00
Erin Call c4c136b021
Do envconfig-loading in config.go (and test it!) [#9] 2019-12-23 15:10:00 -08:00
Erin Call ef4db923cd
Use a plain string for helm.Config.Command [#9]
I'm leaving the no-op test file in place because my next step is to add
new behavior that will require testing.
2019-12-23 14:06:05 -08:00
Erin Call ae9cb59a1f
No typo inthe helm.Config docs [#9] 2019-12-23 14:03:51 -08:00
Erin Call ad5baea3e6
Document helm.Config's struct fields more clearly [#9] 2019-12-23 14:02:46 -08:00
Erin Call 4755f502b5
Always use the default kubeconfig file path [#20] 2019-12-23 12:47:16 -08:00
Erin Call 3eb90651d1
Rough-draft upgrade settings documentation [#8] 2019-12-23 09:49:01 -08:00