It's much easier to see the order of actions when the events are sorted
by lastTimestamp. This adds that flag to the GetEvents function.
Signed-off-by: Joe Julian <me@joejulian.name>
* feat: verify if targetBranch is present in git repo
If a targetBranch is not present in the git repository the `ct list-changed` command will fail.
The error message for this is not really meaningful.
This commit will validate if the branch exists and throw a error message which the user will understand.
closes #330
Signed-off-by: Marco Lecheler <marco@task.media>
* chore(test): mocking test for chart.BranchExists()
Signed-off-by: Marco Lecheler <marco@task.media>
* fix(lint): use fmt.Errorf for error msg
Signed-off-by: Marco Lecheler <marco@task.media>
---------
Signed-off-by: Marco Lecheler <marco@task.media>
* feat: add kubectl timeout value to configuration
Signed-off-by: Scott Leggett <scott@sl.id.au>
* fix: set a request timeout on kubectl commands
Simple kubectl commands such as get, describe, and logs should return
quickly, but kubectl does not set a timeout on requests by default.
This can mean kubectl hangs forever if the kubernetes API stops
responding during a request, which is quite possible in CI environments
where jobs may cancelled and kubernetes clusters torn down while ct is
running.
This change sets a configurable timeout on such kubectl commands, with a
default value of 30s.
Signed-off-by: Scott Leggett <scott@sl.id.au>
* chore: update integration test for new kubectl API
Signed-off-by: Scott Leggett <scott@sl.id.au>
Helm v3.4.0 logs a warning about URL deprecation which causes semver
parsing to fail. We need to only read stdout and ignore stderr here.
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
* support execution of additional commands for lint
Given that helm unittest is installed locally or mounted into the chart
testing container one could use this to run helm unittest for each
chart.
```
additional-commands:
- helm unittest --helm3 -f tests/*.yaml {{ .Path }}
```
The command is treated as a go template. Like this it's possible to get
the path to the chart as in the example. It would also be open for
further extension if needed.
Signed-off-by: Torsten Walter <mail@torstenwalter.de>
* Use sh to execute command
Signed-off-by: Torsten Walter <mail@torstenwalter.de>
Co-authored-by: Reinhard Nägele <unguiculus@gmail.com>
* rename function to NewCmdTemplateExecutor
Signed-off-by: Torsten Walter <mail@torstenwalter.de>
* add error handling
Signed-off-by: Torsten Walter <mail@torstenwalter.de>
* add documentation
Signed-off-by: Torsten Walter <mail@torstenwalter.de>
* use go-shellwords to split rendered command
Signed-off-by: Torsten Walter <mail@torstenwalter.de>
* Update pkg/tool/cmdexecutor.go
Signed-off-by: Torsten Walter <mail@torstenwalter.de>
Co-authored-by: Reinhard Nägele <unguiculus@gmail.com>
* add unit tests
Signed-off-by: Torsten Walter <mail@torstenwalter.de>
Co-authored-by: Reinhard Nägele <unguiculus@gmail.com>
* Migrate to Go modules
Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>
* Add 'go mod download'
Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>
* Update machine image
Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>
* Install Go
Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>
* Fix Go installation
Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>
* Fix Go installation
Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>
* Override Go link
Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>
* Do checkout first
Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>
* Fix link
Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>
* Copy go 1.13 binary in place of circle image default binary
Signed-off-by: Scott Rigby <scott@r6by.com>
* Use latest helm v3 version, and remove install_tiller function
Signed-off-by: Scott Rigby <scott@r6by.com>
* Revert "Use latest helm v3 version, and remove install_tiller function"
This reverts commit 63dedab3a2.
Signed-off-by: Scott Rigby <scott@r6by.com>
* Copy full go 1.13 dir into the circle machine default location after deleting initial install
Signed-off-by: Scott Rigby <scott@r6by.com>
* Test chart upgrades against previous version
Upgrade testing will be run if the --upgrade flag is set (default true)
and chart version increment does not indicate a breaking change
according to the SemVer 2.0 spec.
Any releases associated with previous chart versions which fail to roll
out or for which an initial `helm test` fails will be ignored.
Signed-off-by: Jacob LeGrone <git@jacob.work>
* fix(dep): add version constraint for github.com/otiai10/copy
Signed-off-by: Jacob LeGrone <git@jacob.work>
* refactor(git): checkout whole repository with worktree
Signed-off-by: Jacob LeGrone <git@jacob.work>
* Rename test* to do*
Signed-off-by: Jacob LeGrone <git@jacob.work>
* Return bool, error from BreakingChangeAllowed
Signed-off-by: Jacob LeGrone <git@jacob.work>
* Use errors.Wrapf
Co-Authored-By: jlegrone <jlegrone@users.noreply.github.com>
Signed-off-by: Jacob LeGrone <git@jacob.work>
* Explicitly disable upgrade when not install
Signed-off-by: Jacob LeGrone <git@jacob.work>
This PR adds two flags to the `install` command: `namespace` and `release-label`. If `namespace` is specified, releases will target that namespace and `release-label` will be used to select deployments and pods for readiness and reading log output.
Fixes #34
Readiness check should happen before tests are executed. Otherwise
the fails if there are tests and test pods match the label selectors
that identify pods. Since test pods have status Completed, they
cause the readiness check to fail.
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>