Commit graph

33 commits

Author SHA1 Message Date
Erin Call 48b6b3f5b3
Create AddRepo steps when there are repos to add [#26] 2019-12-30 11:57:19 -08: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 d53a1ed942
Merge branch 'master' into testplan 2019-12-26 12:26:07 -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 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
Erin Call 161960e55e
Rename Delete to Uninstall [#4]
Helm3 renamed its delete command to uninstall. We should still accept
helm_command=delete for drone-helm compatibility, but the internals
should use Helm's preferred name.
2019-12-19 15:04:33 -08:00
Erin Call 68a2c3cc86
Merge branch 'master' into helm-delete 2019-12-19 11:34:44 -08:00
Erin Call 5de156f823
Extract Plan's InitKube creation [#4]
It's `func initKube` rather than `var initKube = func` because initKube
is not meant to be returned by determineSteps.
2019-12-18 17:13:17 -08:00
Erin Call f398ee5724
Instantiate a Delete when appropriate [#4]
"delete" would be a more natural name for the instantiation function,
but that's a reserved word in golang.
2019-12-18 16:58:31 -08:00
Erin Call 7e24756ad8
Instantiate a Lint when cfg.Command is "lint" [#3] 2019-12-17 17:14:39 -08:00
Erin Call aa04830600
Populate DryRun when building an Upgrade step 2019-12-17 09:23:44 -08:00
Erin Call 13c663e906
Initialize kubernetes config on upgrade
This change revealed more about how the system needs to work, so there
are some supporting changes:

* helm.upgrade and helm.help are now vars rather than raw functions.
    This allows unit tests to target the "which step should we run"
    logic directly by comparing function pointers, rather than having to
    configure/prepare a fully-valid Plan and then infer the logic’s
    correctness based on the Plan’s state.
* configuration that's specific to kubeconfig initialization is now part
    of the InitKube struct rather than run.Config, since other steps
    shouldn’t need access to those settings (particularly the secrets).
* Step.Execute now receives a run.Config so it can log debug output.
2019-12-16 15:41:04 -08:00
Erin Call 4cbb4922fb
Implement the debug flag and help command
I'm vacillating about the choice to have separate Config structs in the
`helm` and `run` packages. I can't tell whether it's "good separation of
concerns" or "cumbersome and over-engineered." It seems appropriate at
the moment, though.
2019-12-10 15:33:50 -08:00
Erin Call 8d66036252
Brush all the lint off this code I wrote in a haze 2019-12-09 10:53:32 -08:00
Erin Call e3051ec72e
Replicate most of drone-helm's config 2019-12-09 09:58:42 -08:00