Commit graph

101 commits

Author SHA1 Message Date
Erin Call 197a377a82
Prod maintainers to keep the docs and code in sync [#8]
Offhand I don't see a way to ensure it programmatically, but I feel like
I should at least make an attempt.
2019-12-20 10:05:50 -08:00
Erin Call aed59c251e
Namespace is relevant in helm lint [#8]
...Or at least, the namespace is passed around in helm's linting code. I
haven't proven that there's a case where omitting the namespace can
cause a linting problem, but I've seen enough to go ahead and document
the setting.
2019-12-20 09:56:51 -08:00
Erin Call 2d4688f99b
Merge branch 'master' into useful-readme 2019-12-20 09:42:28 -08:00
Erin Call 420014f9e5
Rename the setting description files to _settings [#8] 2019-12-20 09:41:36 -08:00
Erin Call 285af8a317
Rough draft of an example lint stanza [#8] 2019-12-19 16:37:04 -08:00
Erin Call 485eb4375c
Rename "delete" to "uninstall" [#8]
Helm 3 renamed the command, and I didn't realize it until just now.

See also 161960e, where it was renamed in the code.
2019-12-19 15:24:11 -08:00
Erin Call 80b26434f5
Merge pull request #21 from pelotech/helm-delete
Run the `helm delete` command when HELM_COMMAND or DRONE_EVENT is "delete"
2019-12-19 15:19:44 -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 5e2f2f3dc6
First draft of a useful README [#8] 2019-12-19 14:53:53 -08:00
Erin Call f373004bd2
Merge branch 'master' into helm-delete 2019-12-19 14:49:55 -08:00
Joachim Hill-Grannec 0c5576164d
Merge pull request #22 from pelotech/no-license
Remove LICENSE
2019-12-19 13:45:33 -08:00
Erin Call f4ce27f40e
Merge branch 'master' into no-license 2019-12-19 13:43:47 -08:00
Joachim Hill-Grannec 6452a01c82
update drone.yml to publish to docker hub 2019-12-19 13:38:04 -08:00
Erin Call b091bc2a95
No license until there's consensus on which to use 2019-12-19 13:35:09 -08:00
Erin Call 68a2c3cc86
Merge branch 'master' into helm-delete 2019-12-19 11:34:44 -08:00
Erin Call 6acad85bed
Merge pull request #18 from pelotech/helm-lint
Run the `helm lint` command when HELM_COMMAND=lint
2019-12-19 11:33:01 -08:00
Erin Call 7849b28532
Format the Delete struct less weirdly [#4]
I thought it was a golang style convention to put a blank line between
public and private struct fields, but apparently I imagined that.
2019-12-19 11:11:50 -08:00
Erin Call c033c8c45e
Format the Lint struct non-weirdly [#3]
I thought it was a golang style convention to put a blank line between
public and private struct fields, but apparently I imagined that.
2019-12-19 11:09:39 -08:00
Erin Call 30e1e3b99f
Assert that Lint.Prepare sets cmd.Stdout/Stderr [#3] 2019-12-19 10:26:33 -08:00
Erin Call b93917c857
Use better expectations in lint_test [#3]
The tests need to allow calls to Stdout/Stderr so they don't get
"Unexpected call" errors from gomock, but these tests aren't meant to
assert that the calls actually happened. Using .AnyTimes allows 0 or
more calls.
2019-12-19 10:21:11 -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 a21d6ad61f
Implement a Delete Step [#4] 2019-12-18 11:47:15 -08:00
Erin Call 84ac019838
Add the --namespace flag in Lint.Prepare [#3]
I don't know whether this is necessary; I'm just following drone-helm's
lead. At worst, helm will accept the flag, so it's at least *safe* to
include.
2019-12-18 10:38:33 -08:00
Erin Call 9b3616613b
Merge pull request #17 from pelotech/no-todos
Remove the TODO list from README.md
2019-12-18 08:09:38 -08:00
Erin Call 7e24756ad8
Instantiate a Lint when cfg.Command is "lint" [#3] 2019-12-17 17:14:39 -08:00
Erin Call a6a2d6e6a3
Require a nonempty chart in Lint.Prepare [#3] 2019-12-17 17:01:22 -08:00
Erin Call a6b7e06bd2
Implement the debug flag in lint [#3] 2019-12-17 17:01:18 -08:00
Erin Call 51800c18d7
Implement the various values flags in lint [#3] 2019-12-17 17:01:11 -08:00
Erin Call 991bbf97b4
Create a Lint step [#3]
Still need global flags and checks for mandatory settings, but the basic
functionality is there.
2019-12-17 17:01:06 -08:00
Erin Call f3039ee35d
Merge branch 'master' into no-todos 2019-12-17 15:35:28 -08:00
Erin Call 09e4869b2c
Merge pull request #2 from pelotech/flesh-out-upgrade
Build out the rest of the upgrade Step
2019-12-17 15:34:08 -08:00
Erin Call c641c1a326
Remove the TODO list from README.md
Everything on the checklist has been converted to a github issue, so
it's redundant.
2019-12-17 15:23:42 -08:00
Erin Call aa04830600
Populate DryRun when building an Upgrade step 2019-12-17 09:23:44 -08:00
Erin Call c585d8a22b
More TODOs in the README 2019-12-16 17:07:33 -08:00
Erin Call 1560c05100
Fail early if chart or release is missing 2019-12-16 17:02:56 -08:00
Erin Call e4fa70239e
Implement config flags for helm upgrade 2019-12-16 16:55:05 -08:00
Erin Call c08b2035a8
Merge pull request #1 from pelotech/assorted-cleanups
Assorted cleanups
2019-12-16 15:48:27 -08:00
Erin Call 9797f5c8a2
Non-0 exit status on error 2019-12-16 15:46:37 -08:00
Erin Call 173cf374f9
Run linting on an image with golint preinstalled
Running `go get` adds a line to `go.mod` every time, so using a
preinstalled golint avoids churn.
2019-12-16 15:44:46 -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 446c6f1761
Run golint during drone builds 2019-12-09 15:27:56 -08:00
Erin Call dad866582a
Further todo list 2019-12-09 10:53:42 -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
Erin Call 238ede6f9e
Actual drone-invokable helm commands 2019-12-05 14:35:25 -08:00
Erin Call e77f6842b9
Non-DI approach to the exec.Command mocking 2019-12-05 09:57:59 -08:00
Erin Call 990d1856d8
Very rough code that can helm install
The recommended way to test code that uses exec.Cmd involves setting up
a real exec.Cmd that invokes `go test` with additional arguments that
fire off a specially-constructed test that behaves the way the mocked-
out script would be expected to do. It's a sensible way to test exec.Cmd
itself, but for code that merely invokes it, I think it makes more sense
to use actual mocks.
2019-12-04 12:41:37 -08:00
Erin Call ba75a9b1d8
Initial config for building the plugin itself 2019-12-03 09:50:15 -08:00