* 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>
* 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>
* feat(upgrade): allow skipping missing values files
This allows fixing previous chart versions in a single pull request
without applying a major version bump to the chart version.
Signed-off-by: Jacob LeGrone <git@jacob.work>
* test(skip-missing-values): validate config and HasCIValuesFile method
Signed-off-by: Jacob LeGrone <git@jacob.work>
* docs(skip-missing-values): generate documentation
Signed-off-by: Jacob LeGrone <git@jacob.work>
* fix(chart): switch to filepath from path
Signed-off-by: Jacob LeGrone <git@jacob.work>
* Add helm/kubectl integration test
Signed-off-by: Jacob LeGrone <git@jacob.work>
* Use Chart type from integration tests
Signed-off-by: Jacob LeGrone <git@jacob.work>
* Update .circleci/config.yml
Co-Authored-By: jlegrone <jlegrone@users.noreply.github.com>
Signed-off-by: Jacob LeGrone <git@jacob.work>
* Remove extraneous test chart files
Signed-off-by: Jacob LeGrone <git@jacob.work>
* Fix shellcheck lint
Signed-off-by: Jacob LeGrone <git@jacob.work>
* Remove example kind config from e2e tests
Signed-off-by: Jacob LeGrone <git@jacob.work>
* Remove breaking semver test
This wasn't super clear and was no longer working properly
after the switch to git-worktree.
Signed-off-by: Jacob LeGrone <git@jacob.work>
* Bump kind version
Signed-off-by: Jacob LeGrone <git@jacob.work>
* 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>
Allows to identify chart changes before actually running
lint or install commands. This can be useful in the following
cases:
* In a CI setup where kind clusters are spun up on the fly,
this makes it possible to decide whether a cluster is necessary
at all. A PR may only contain changes that are not relevant
to any charts.
* By knowing upfront which charts have changed, it is
possible to load a per-chart CI configuration which would
allows us to determine the number of nodes needed in a kind
cluster. For most charts, one node is enough, but in certain
scenarios, especially for StatefulSets, we may want to test
with pod anti-affinity where replicas have to be spread across
multiple nodes.
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
Simplifies the logic and no longer requires that flags be
listed individually in order to get bound.
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
Fixes a regression introduced in #73 so that chart directories were no longer required to be in a direct subdirectory of configured chart directories.
This caused problems in https://github.com/helm/charts/pull/10830.
cc @munnerz
* Fix regression in changed chart detection
Please enter the commit message for your changes. Lines starting
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
* Refactor to consider charts at root
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
* Make sure charts are processed only once
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
* Fix typo
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
There are charts with very long names which cause namespace and
release names to exceed the max length of 63 characters. We, thus,
need to truncate long names. Truncation is done from the left in
order to preserve build ids and randomly generated suffixes.
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>