Following tests were failing unnoticed
- [ ] TestUpdateRelease_VerifyOptions
- [ ] TestUpdateRelease_VerifyOptions
Fixed those tests for the reason of failure.
Also added error checking to rest of the tests in same test-file,
so that new failures do not un-noticed.
The following kinds are newly addressed:
CronJob
LimitRange
ReplicaSet
ResourceQuota
StatefulSet
Furthermore, adjust the installation and uninstallation order to
better respect likely dependencies. Bare pods remain a difficult one
to place properly in both sequences.
During installation and uninstallation, handle the RBAC-related
ClusterRole, ClusterRoleBinding, Role, and RoleBinding kinds in an
order that respects their potential referential integrity, namely that
ClusterRoleBindings can refer to ClusterRoles and ServiceAccounts, and
RoleBindings can refer to ClusterRoles, Roles, and ServiceAccounts.
Fixes#2199.
closes#2136
* Adds new annotation `helm.sh/hookWeight`
* Sorts executing hooks of similar kind in ascending order
* There is no upper or lower bounds on the weights
This fixes a bug in which 'helm status' fails if any of the expected
resources are missing in Kubernetes. Now it prints a list of missing
resources at the end of the status report.
Closes#2118
In the TestLoadDir test case, currently reflect.DeepEqual is expected to fail by error. Expected metadata is different than in the fixture yaml. Also, the type of the struct is mismatching in DeepEqual call (struct vs pointer to struct).
Headless services (with `clusterIP` set to `None`) were reporting
as not being ready because they didn't have an IP address. This adds
a logic check to ignore those services.
Adds the `required` function in enginge.go to support required
properties in values.yml. When a chart developer wishes to specify
intent in requiring a value, they can use this function to declare
an error message that gets returned when chart rendering fails
when a required value is not present in values.yml.
Closes#1580
When downloader package moved to under /pkg, helmpath functions got called still from it, while it is under /cmd. This commit fixes the issue by moving helmpath after the downloader to have only cmd->pkg and pkg->pkg calls.
Most newcomers hit helm's 'feature' there deleted instalations are not really deleted.
Use-case
# helm install --name gitlab-ce-1 ./stable/gitlab-ce
# helm delete gitlab-ce-1
# helm list
# helm install --name gitlab-ce-1 ./stable/gitlab-ce
Error: a release named "gitlab-ce-1" already exists
There is a lot duplicated bugs in bugzilla which simply explains that packages
should be deleted with --pure flag. But such bugs appeared again and again
because this behavior is not obvious.
Let's help user to figure out what happens ASAP.
When manifests do not change, they didn't get populated with the
latest label info from the API server and then panic'd. This resolves
that bug
Closes#2043
In third-party libraries, charts can be embedded in memory rather than in files, directories or
tarballs. Exposing LoadFiles allows a third-party library the ability to load static templates
in and spit out a *chart.Chart.
This makes it possible to do a `dep up` without refetching all of
the repositories.While it's less safe, it's useful when doing many
updates in a short period of time (such as in a CI/CD setting)
Closes#2019
A regression was committed during 2.2.0 that broke the repositories.yaml
file format, switching the cache path from relative to absolute. This
fixes the error.
Closes#1974
The following commands:
helm dep update
helm dep build
are now able to take a requirements.yaml with dependency charts' repo defined as:
file://../local/path or file:///root/path
closes: #1884
This feature adds the ability to selectively control the loading of charts using entries in top chart's values.
When 'helm install --set tags.mytag=true', charts with that tag will be enabled unless disabled in parent by condition.
When 'helm install --set mychart.enabled=true', charts with that yaml path specified will be enabled.
Closes#1837
Protobuf 3.2 was recently released and generates a slightly different
file from the protobuf definitions. These were all changes to the
autogenerated byte array.
Users can now specify a namespace filter for 'helm list'. Only the
releases within the specified namespace will be shown. For example,
'helm list --namespace foo' will only show releases for the 'foo'
namespace. Also added a namespace field to the table view.
Closes#1563
At the present time, PersistentVolumeClaims are not a recognized object so it is installed last.
PVCs should be installed shortly after PersistentVolumes have been bound.
* This is a simple mvp which processes a test definition with the
hook annotation for test when you run `helm test [release]`
* helm client cmd, proto def, tiller logic
When using pkg/helm as a third party client, I am using chartutil.LoadArchive()
to load a chart from an io.Reader. After that is loaded I wish to install/update that
chart, however InstallRelease and UpdateRelease only accepts a path rather than
something of type *chart.Chart. This adds a new function called InstallReleaseFromChart
which allows one to load a chart separate from the path, then install said chart.
since kubernetes 1.4, the upper limit for resource name is 63 characters,
so it is better to change the template when running `helm create` accordingly.
The --reset-values flag on upgrade instructs Tiller to reset the
upgraded release to the chart's built-in values.yaml, and ignore the
last install's overridden values.
Closes#1569
This adds the {{.Capabilities}} object to the template variables so that
chart authors can write charts that are aware of teh Kubernetes
capabilities of the current cluster.
Closes#1608
Installs, rollback, upgrade, and delete now accept a `--timeout` flag
that allows the user to specify the maximum number of seconds that
any kubernetes command can take.
Closes#1678
It is unnecessary to create a namespace just to test that it exists.
Roles that don't have post namespace will error out even if the namespace exists
and it is possible to install the package anyway. This patch Gets a namespace and
only creates one if it doesn't exist.
There are some places where releases are only located if they are in the
state DEPLOYED. That particular logic was incorrectly used for upgrades.
That caused #1566. While fixing that issue, I found that this was also
the root cause of #1587 (though because it was off by one). I added a
generic method to get the last release, regardless of its status.
This allows some behaviors that previously failed:
- 'helm upgrade' can now be performed on a DELETED release
- 'helm rollback' can now be performed on a DELETED release even if
there is only one revision of that release history.
Closes#1566Closes#1587
This adds a hidden 'helm doc' command that generates documentation out
of the Helm help text.
Currently it can create:
- man pages for HELM(1)
- Markdown documentation
- bash autocompletions
Those are the three built-ins for Cobra.
The command is hidden so that it doesn't show up to the regular user,
since this is really a specialized task. It has the advantage of making
it trivially easy to install man pages and bash completion at installation time.
There were several places where an invalid name could be interpreted
into a wild-card by Kubernetes. That allows Bad Things.
This fix requires names to match the Kubernetes pattern for naming.
Closes#1594
Adds validation against the swagger schema.
Example error:
Error: release telling-wildebeest failed: error validating "": error
validating data: expected type int, for field
spec.template.spec.containers[0].ports[0].containerPort, got string
Current error:
unable to decode "": [pos 177]: json: expect char '"' but got char 'n'"'
This does the following to improve deletion failure handling:
- In an UninstallRelease operation, the release is marked DELETED
as soon as the basic checks are passed. This resolves 1508. I filed a
followup issue for doing this even better when we can modify protos
again.
- If a YAML manifest fails to parse, the error messages now suggests
that the record is corrupt, and the resources must be manually
deleted.
- If a resource is missing during deletion, the error messages now make
it clear that an object was skipped, but that the deletion continued.
Closes#1508
Long ago, Helm did not support cross-namespace installs. There was a
linter rule to catch this. When we changed the way Helm worked, we did
not remove the linter rule. This commit removes that linter rule.
Closes#1489
For archived files the Chart.yaml file should be contained in a base
directory. This commit adds an error when the Chart.yaml file is found
in the root directory.
Fixes#1171
This feature has been disabled in the past because simply enabling the
feature causes the Kubernetes library to make requests to a server.
Thus, running any tests that use the 'pkg/kube' library has required
running a kube API server.
This patch makes it possible to selectively activate 3rdParty API
support, and then disables that support during testing.
Future versions of the Kubernetes library appear to make it easier to
configure and mock this behavior, so this is most likely a stop-gap
measure. (Famous last words.)
Closes#1472
This switches the local chart repo to use 127.0.0.1 instead of localhost
so that the net library does not negotiate localhost to an IPv6 address,
which is known to cause issues in some Docker containers.
Breaking Change: When testing on a system that does NOT have IPv4
configured, this will break 'helm serve'. We estimate this will impact
none of the current user base.
Closes#1410
This commit changes the configmap storage driver to compress
the serialized release before storing it as a base64 encoded string.
This change is backward compatible as it handles existing releases
gracefully by skipping the decompression step when the gzip magic
header is not present.
Previous versions of Helm had placeholder text in the index.yaml file.
This generates an HTML index for 'helm serve'. It also has a
refactoring of the server so that the server can be tested.
Closes#1397
This prevents the index command from recursing through directories.
Behind the scenes, it swaps out the repository logic for the index file
logic.
Closes#1328
This adds a function engine.FuncMap that returns a function mapping that
better represents the functions passed to a template. The linting logic
is reconfigured to use this function instead of the sprig.FuncMap
function.
Closes#1366
The YAML validation was broken because the renderedContentMap has keys
with the path to the template including the chart directory, whereas the
linter was trying to access it relative from the chart directory.
For example, the hash key was `drupal/templates/deployment.yaml` but the
linter was trying to access `templates/deployment.yaml`. This commit
fixes the key used to access the rendered content.
Between Alpha.4 and Alpha.5 there was a change in the indexing logic.
This prevent indices from being appended to (because those index files
were often broken). This change allows the user to explicitly merge an
existing index and a generated index.
Closes#1334
- decouple tunnel from kube client
- add context switching for init cmd
- add unit tests for installer and init command
- refactor installer and remove unused code
This causes 'helm dep [up|install]' to ignore files in charts/ that
start with either a dot or an underscore. It also changes the
chartloader to ignore those files.
Also, if a 'helm dep up' does not find a charts/ directory, it creates
one.
Closes#1342
I wrote urlJoin to fix URL joining, but I put it in the wrong place and
never used it. This moves it to the right place, and replaces the hacky
previous solution.
This removes the requirement that a fetch or install command must
explicitly state the version number to install. Instead, this goes to
the strategy used by OS package managers: Install the latest until told
to do otherwise.
Closes#1198
This performs a relatively weak in-memory translation of index file
data. It does not, in most cases, write the corrected data to disk, and
it emits a warning directly to STDERR each time it loads a deprecated
index.
Known limitations:
- It cannot recover certain bogus records that earlier alpha releases
generated (notably, where all chartfile data is missing)
- In some cases, it has to parse a filename to get version info. This is
lossy.
- Because it takes three passes through the YAML and JSON unmarshal, it
is not performant.
This feature is transitional and should be removed during the Beta
cycle, prior to the release of 2.0.0.
Closes#1265
When `helm install -f foo.yaml bar` is called, and then the release is
upgraded with `helm upgrade happy-panda bar`, this will now re-use the
values that were submitted with `-f foo.yaml`. The same is true for
values specified with `--set`.
Closes#1227
There was a bug in the repo tests that caused them to overwrite the
repositories.yaml file in that directory. Now, the entire tests (server
and client-side) run inside of a temp directory.
This implements a new index file format for repository indices. It also
implements a new format for requirements.yaml.
Breaking change: This will break all previous versions of Helm, and will
impact helm search, repo, serve, and fetch functions.
Closes#1197
Some fields were introduced to Chart metadata after Alpha.4, but are not
going to be used ever. So we made the decision to remove them before we
get stuck with ugliness.
This should not break compatibility, since these fields were not used.
This also refactors significant portions of the CLI, moving much of the
shared code into a library.
Also in this release, a testing repository server has been added.
This is a minor refactor to move a leftover from Ancient Helm into the
current design. Specifically, the code to install Tiller from the Helm
client is now in `cmd/helm/installer`.
Closes#1033
This adds support for the following 'helm list' flags:
- all: show all release types
- deleted: show deleted releases
- deployed: show deployed releases
- failed: show failed releases
These flags can be toggled. Only '--deployed' is turned on by default.
On the server side, Tiller's list function can now filter based on a
slice of release.Status_Code filters. While the client only supports a
subset, the server supports all known release.Status_Code types.
Closes#973
Currently, delete returns an error if a resource is not found.
That is a bit confusing because if you delete something that
is not found, the end state is not really an error. The end
state is what you wanted to do in the first place. This type
of error is not propogated from the kube client but it is logged
in tiller. We could also change this to keep returning errors
(even the not found) and filter it out in the release server.
This adds the --verify and --keyring flags to:
helm fetch
helm inspect
helm install
helm upgrade
Each of these commands can now make cryptographic verification a
prerequisite for using a chart.
This adds support for OpenPGP signatures containing provenance data.
Such information can be used to verify the integrity of a Chart by
testing that its file hash, metadata, and images are correct.
This first PR does not contain all of the tooling necessary for
end-to-end chart integrity. It contains just the library.
See #983
This adds a few extra settings to the default .helmignore file. In
doing this, I found a bug that some directory patterns are not
evaluated correctly. Fixed that and added tests.
Closes#989Closes#1027
This commit adds an Update function to the client.
The Update function takes in the modified manifests and
the original manifests. It then iterates through the modified
objects, creates objects not found in kubernetes, and updates
objects that exists but have been modified. Finally, it
iterates through the original resources and checks to see if
they have been deleted in the modified configuration and then
proceeds to delete them. #690
This changes "pkg/chartutil".Files.Get to return a string, removes
"pkg/chartutil".Files.GetString, and adds
"pkg/chartutil".Files.GetBytes.
Closes#1020
This adds a context-aware template function called 'partial' that will
allow rendering other templates in a chart into a string value, which
can then be piped to other functions. Usage is something like
'{{partial 'path/to/template.yaml' | indent 2}}'
This might be a bad idea.
Closes#1005
This fixes a bug in which passed-in values files were not correctly
merged into the chart's default values YAML data. I believe it also
fixes some other prioritization bugs in values merging.
The existing unit test was wrong (see TestCoalesceValues). It is
fixed now. Also added more tests to simulate issue #971.
In the course of writing this, I removed some vestigial code as
mentioned in #920.
Closes#971Closes#920
This includes a substantial bit of unit test improvements. Also, in
order to allow us to tests command line args (which translate to
helm.Option objects), I had to add a new interface to pkg/helm.
Template paths were relative to the chart that contained them, which
meant that all templates were named 'template/SOMETHING'. This made it
trivially easy to hit namespace collisions as in #933.
Template path names are essentially opaque strings so this patch simply
changes them to be qualified by parent chart.
Handle a previously unhandled error in the linter. This simply bails out
if a chart's values files do not parse.
Also, changed the implementation of CoalesceValues to return a map even
on error.
This allows templates to access information about the template file.
Right now, the template can only access the .Template.Name, which is the
chart-relative path to the current template.
Closes#894
Instead of printing "no value", this prints an empty string by
default, but adds a Strict flag on the engine, which (if true)
will cause a template render to error out if a value is not supplied.
Strict is set to false so that developers can instead use `default` to
set default values.
This makes the Table() method more flexible than the original version.
It allows either a map[string]interface{} or a chartutil.Values to be
treated as a table.
Template rules
Adding chart errors
Added function that checks the existence of all the values in the templates
Adding chartfile unit tests
Testing runLinterRule
Fixing out of range
Fixing out of range
Improving quote detector
Fixed tests
Adding chart name linter
Add lint error
Moving to blocks
Moving to method
Moved lint rules to functions
Semantic version validation
Linting engine
Adding sources and home validations
Sharing file loading
Sharing file loading
Rolling back readme
Rewriting other linters
Fixing tests
Typo
Using chart.Metadata
Fixing format
Adding UNKNOWN in Engine
Adding tabs
Fixing tabs
This adds support for .helmignore files. These files roughly follow
the conventions established for .gitignore files:
https://git-scm.com/docs/gitignoreCloses#748
This provides support for "global" variables. It does this by
declaring "global" to be a special namespace. It then copies this
namespace into every subchart, coalescing it into any "global"
namespace found there.
The net result is that if "global.foo" is set in the YAML file, it
will be available to every chart/subchart as ".global.foo" regardless of
where that chart is in the subchart tree.