* 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>
* Use kind release from GitHub instead of 'go get sigs.k8s.io/kind'
* Run ct container with '--network host' to avoid patching kubeconfig
* Create multi-node cluster with one master and three worker nodes
so pods with anti-affinity can be tested
* Improve wait logic to cater for multiple nodes
* Add log statements
* Remote unnecessary 'k8s' remote to avoid confusion
* Extract function for 'docker exec' calls
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>
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>