Commit graph

35 commits

Author SHA1 Message Date
Matt Farina
8e6a5149d2
validation fix
Signed-off-by: Matt Farina <matt.farina@suse.com>
2024-02-07 10:54:15 -05:00
Matt Farina
f182ebc11c
Fix issue with unhandled error on Stat
If stat returns an error other than the directory not existing
it was unhandled. When IsDir is called in one of these situations
it causes a panic.

Closes #8181

Signed-off-by: Matt Farina <matt@mattfarina.com>
2020-05-22 12:04:37 -04:00
Matt Butcher
bf9d629dc0
feat: implement deprecation warnings in helm lint (#7986)
* feat: implement deprecation warnings in helm lint

Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>

* added more deprecated APIs

Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
2020-05-01 14:01:15 -06:00
Matt Farina
28b085bed5
Fixing issue where archives created on windows have broken paths
When archives are created on windows the path spearator in the
archive file is \\. This causes issues when the file is unpacked.
For example, on Linux the files are unpacked in a flat structure
and \ is part of the file name. This causes comp issues. In Helm
v2 the path was set as / when the archive was written. This works
on both Windows and POSIX systems.

The fix being implemented is to use the ToSlash function to ensure
/ is used as the separator.

Fixes #7748

Signed-off-by: Matt Farina <matt@mattfarina.com>
2020-03-10 12:30:46 -04:00
Song Shukun
a992464fa2 Save Chart.lock to helm package tar
Signed-off-by: Song Shukun <song.shukun@fujitsu.com>
2020-03-02 19:51:15 +09:00
Matthew Fisher
50dcd39ba5
fix(package): remove --set, --values, etc. flags
These flags snuck in through a feature that was reverted and removed in Helm 2, but snuck into Helm 3.

They were never hooked up or used, so they were a no-op. This shouldn't affect anyone.

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2020-01-27 10:29:15 -08:00
Romain Grenet
8cb3c02c47 Port PR #4161 Fix incorrect timestamp when helm package to Helmv3
Lint CRLF
Signed-off-by: Romain Grenet <romain.grenet@gmail.com>
2019-12-19 13:22:08 -05:00
Josh Soref
02ad2b1187 Spelling (#7258)
* spelling: constraint

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: cryptographic

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: dependency

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: doesnot

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: don't

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unexpected

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: dreadnought

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: default

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: envvars

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: evaluates

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: execute

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: extractor

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: frobnitz

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: generated

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: implementation

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: jabba

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: keywords

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: kubernetes

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: override

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: package

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: parsable

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: progress

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: recursively

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: release

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: cache

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: representing

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: serializer

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: subchart

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: utilities

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2019-12-18 12:04:08 +00:00
Paul "TBBle" Hampson
0cb0eaca94 fix(*): Helm v3 handling of APIVersion v1 charts dependencies (#7009)
* Include requirements.* as Files in APIVersionV1

Fixes #6974.

This ensures that when reading a Chart marked with APIVersion v1, we
maintain the behaviour of Helm v2 and include the requirements.yaml and
requirements.lock in the Files collection, and hence produce charts that
work correctly with Helm v2.

Signed-off-by: Paul "Hampy" Hampson <p_hampson@wargaming.net>

* Write out requirements.lock for APIVersion1 Charts

This keeps the on-disk format consistent after `helm dependency update`
of an APIVersion1 Chart.

Signed-off-by: Paul "Hampy" Hampson <p_hampson@wargaming.net>

* Exclude 'dependencies' from APVersion1 Chart.yaml

This fixes `helm lint` against an APIVersion1 chart packaged with Helm
v3.

Signed-off-by: Paul "Hampy" Hampson <p_hampson@wargaming.net>

* Generate APIVersion v2 charts for dependency tests

As the generated chart contains no requirements.yaml in its files list,
but has dependencies in its metadata, it is not a valid APIVersion v1
chart.

Signed-off-by: Paul "Hampy" Hampson <p_hampson@wargaming.net>

* Generate APIVersion v2 charts for manager tests

Specifically for the charts that have dependencies, the generated chart
contains no requirements.yaml in its files but has dependencies in its
metadata. Hence it is not a valid APIVersion v1 chart.

Signed-off-by: Paul "Hampy" Hampson <p_hampson@wargaming.net>
2019-12-11 17:07:05 +00:00
Simon Alling
a7c285bf7e ref(pkg/chartutil): Improve error handling code in Save
While working on #6519, it took me hours to figure out why the error
returned from `Save` was nil even though `writeTarContents` returned a
non-nil error. I fixed the bug as part of that PR; the purpose of this
commit is to prevent it from happening again.

What made me (as a Go beginner) so confused was the impression that
there was only ever one `err` variable, global to the entire `Save`
function, when in fact there were also several local ones shadowing it.
(I thought := could be used to reassign an existing variable.)

This commit makes it clear that any `err` defined locally in the last
`if` statement will not be returned at the end, and hence must be
explicitly returned in the body of said `if` statement.

(This commit initially was larger; see #6669.)

Signed-off-by: Simon Alling <alling.simon@gmail.com>
2019-10-16 17:27:47 +02:00
Simon Alling
2a462aef2d fix(pkg/chartutil): add tests according to feedback
The seemingly redundant `return filename, err` line is related to how
the name `err` is used throughout the function: there is a "global" (to
the function) `err` variable, as well as several locally block-scoped
ones. It took me hours to understand why my code did not work without
that line, but I decided not to clean up the `err` code in this commit.

Signed-off-by: Simon Alling <alling.simon@gmail.com>
2019-10-11 10:49:43 +02:00
Simon Alling
50675e7cd7 fix(pkg/chartutil): include values.schema.json in packaged chart
Before this commit:

    $ helm lint my-chart            # Finds errors in values.yaml
    $ helm package my-chart
    $ helm lint my-chart-1.0.0.tgz  # Does not find errors in values.yaml

Signed-off-by: Simon Alling <alling.simon@gmail.com>

Co-authored-by: Andreas Lindhé <andreas@lindhe.io>
2019-10-10 20:56:06 +02:00
wxdao
c00890cae1 Fix Save misbehavior on nonexistent directory (#6360)
Signed-off-by: wxdao <waxiadao@gmail.com>
2019-10-08 14:23:14 +01:00
Matt Farina
9bc7934f35
Updating the module for v3 as the major version
Signed-off-by: Matt Farina <matt@mattfarina.com>
2019-10-03 14:27:05 -04:00
Simon Alling
43bb10cd24 ref(pkg/chartutil): Dry up file and path names (#6554)
Signed-off-by: Simon Alling <alling.simon@gmail.com>
2019-10-02 09:36:14 +01:00
Adam Reese
b6fdd8783b
feat(cmd/helm): remove need for helm init command
* allow repository config via cli
* make `helm repo add` create repo config file if it does not exist
* squash a ton of bugs

Signed-off-by: Adam Reese <adam@reese.io>
2019-08-22 23:31:50 -07:00
Matthew Fisher
d99edbfb3e
fix(chartutil): remove executable bits from chartutil generated files
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-08-13 16:31:08 -07:00
Josh Dolitsky
cc5dece910
fix(chartutil): Ensure nested template dir on save (#6177)
If a templates/ dir of a chart contained a subdirectory,
for example "templates/tests/test-db.yaml", an error was
being thrown on export due to missing the "templates/test"
directory prior to saving the template file itself.

Fixes #5757

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>
2019-08-08 11:32:03 -05:00
Oleg Sidorov
ec440d446d Replaced ghodss/yaml with sigs.k8s.io/yaml
This commit replaces usage of github.com/ghodss/yaml with it's forked
version maintained by SIG community. The replaced library has
low-to-none support activity unlike the latter. We believe the new
Helm branch could benefit from using the community-supported version on
a long-term run as yaml parser is a key component of Helm chart rendering
engine.

This commit locks sigs.k8s.io/yaml dependency version on 1.1.0 which
is backwards compatible with ghodss/yaml 1.0.0.

This change also resolves the outdated dependency version lock for
ghodss/yaml (currently 1.0.0) and makes it possible to port changes from
https://github.com/helm/helm/pull/6010 to dev-v3.

Signed-off-by: Oleg Sidorov <oleg.sidorov@booking.com>
2019-07-12 16:52:15 +02:00
Matthew Fisher
d3f0ac9343
ref(create): app version should be 0.1.0
When creating a Helm chart for the first time, the assumption should be that the app version is also 0.1.0, implying this is for a new application.

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-04-15 12:06:16 -07:00
Adam Reese
e458a67f0c
ref(pkg/chart): add validation method to chart
Consolidate validation of Chart.yaml.

Signed-off-by: Adam Reese <adam@reese.io>
2019-04-05 13:40:06 -07:00
Adam Reese
895e9192d4
feat(*): use vanity import helm.sh/helm
Signed-off-by: Adam Reese <adam@reese.io>
2019-03-13 13:43:47 -07:00
Adam Reese
516c53dae6
ref(chart): use map for chart.Values
Signed-off-by: Adam Reese <adam@reese.io>
2018-08-29 09:56:19 -07:00
Adam Reese
4f26b658d8
change copyright to "Copyright The Helm Authors" 2018-08-24 12:03:55 -07:00
Adam Reese
f012940d9c
ref(*): refactor chart/chartutil
ref(chartutil): move chart loading out of chartutil into new package
    add chart loader interface to allow lazy loading
feat(chart): create chart accessors
ref(*): cleanup requirements
ref(tiller): remove optional template engines
ref(tiller): simplify sorting releases and hooks
ref(*): code simplification
ref(hapi): move chart package out of hapi
ref(chart): add requirements and lock to Chart struct
2018-08-24 11:28:29 -07:00
Adam Reese
726e3c41be
feat(*): print stacktrace on error with debug enabled 2018-05-10 09:34:41 -07:00
Adam Reese
4c95185164
ref(*): replace chart.config with []byte 2018-04-20 00:13:19 -07:00
Adam Reese
36536d77ba
ref(*): remove protobuf any type 2018-04-18 16:28:50 -07:00
Adam Reese
6345f04190
ref(hapi): convert protobuf to go types 2018-04-18 14:53:38 -07:00
Jean-Philippe Courson
5b77335415 Create missing directories when saving files in chartutil.SaveDir 2018-02-24 17:12:37 +00:00
Amanda Cameron
415e52bf55 Add support for sub-directory scanning as in issue #1401 2017-09-08 09:33:44 -04:00
Matt Butcher
784a339627
feat(helm): support 'helm create --pack=mypack'
This adds support for packs, pre-configured chart patterns that can be
used to quickly create a custom layout for your new chart.
2016-11-22 16:27:54 -07:00
Matt Butcher
e757b24aed fix(*): add license header 2016-06-22 12:28:45 -06:00
Adam Reese
818c878700 chore(*): use k8s.io as the import path 2016-06-06 17:17:04 -07:00
Matt Butcher
15a1cb4816 feat(chartutil): add Save function
This replicates the previous Save function, which can save an
in-memory Chart proto to a tgz.
2016-06-03 15:23:49 -06:00