* updates on ci, use go1.25 and update deprecated goreleaser steps
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
* add nolint
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
---------
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
Currently, `helm-extra-set-args` is only available as a command-line
flag, despite being part of the config object. This does not appear to
be documented.
This changes sources the value `extraSetArgs` via the `config` object
rather than the cmd.Flags() only.
Signed-off-by: Dylan Arbour <arbourd@users.noreply.github.com>
* bug(493): Improved git remote parsing
Previously this would fail to parse git remotes like:
ssh://github.com/foo/bar
ssh://github.com:2222/foo/bar
This properly parses hostname from both URLs and scp style remotes.
Signed-off-by: Rickard von Essen <rickard.von.essen@gmail.com>
* Fix lint issue
Signed-off-by: Rickard von Essen <rickard.von.essen@gmail.com>
---------
Signed-off-by: Rickard von Essen <rickard.von.essen@gmail.com>
This should allow defining `helm-extra-set-args` within the config file or as an environment variable.
Signed-off-by: Léo Colombaro <LeoColomb@users.noreply.github.com>
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>
* fix(test): deploment was not installing due to missing selector
Signed-off-by: paologallinaharbur <paologallina1992@gmail.com>
* feat(test): tesi if chart is upgraded and error is triggered
Signed-off-by: paologallinaharbur <paologallina1992@gmail.com>
* update projecto to go 1.17x
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
* add syft to generate the sboms and update goreleaser
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
* add dependabot config
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
* update dokcerfile to fetch the correct binaries for the arch and update base image
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
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>
Usage of filepath vs. path seems to have been pretty random.
With this change, we consistently use filepath which considers
the platform-specific path separator.
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
If directories are deleted from a chart, ct detects them as invalid
chart directories. A log message is printed to stdout which messes up
the regular output. In order to fix this, the message is now logged to
stderr.
*Example:*
```
$ ct list-changed
Directory 'charts/mychart/templates/deleted' is not a valid chart directory. Skipping...
charts/mychart
```
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>
Fixes a regression when the config file used is printed
to stdout even when the list-changed command is run. It is
now only printed when --print-config=true. Also, config printing
is now done to stderr so the flag can also be used in combination
with the list-changed command.
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
By default, ct prints the config on startup. This can be problematic
because it may contain senstivie data when helm-repo-extra-args contains
passwords. The new flag enables turning off config printing and disables
it by default.
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
The Homebrew formula installs the config files to Homebrew's
etc directory, so we add that to the search locations for config files.
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
Adding support for Helm 3 introduced creating namespaces
because Helm does not do this automatically anymore.
However, a regression was introduced that always creates
namespaces, even if a dedicated namespace is provided via
CLI flag.
Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>
* Fix statefulset test
Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>
* Fix deployment apiVersion
Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>
* Create custom namespace before test
Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>