Commit Graph

38 Commits

Author SHA1 Message Date
reddaisyy 1c67fbf108 refactor: use strings.builder
Signed-off-by: reddaisyy <reddaisy@outlook.jp>
2025-09-15 17:13:58 +08:00
Justen Stall 63cf42a843
fix: replace "github.com/pkg/errors" with stdlib "errors" package
Signed-off-by: Justen Stall <39888103+justenstall@users.noreply.github.com>
2024-11-18 11:35:59 -05:00
Matt Farina 7ad309791c
Merge pull request #13344 from AdamKorcz/fuzzzz1
add strvals fuzzer from cncf-fuzzing
2024-10-04 21:47:22 +02:00
Adam Korczynski b203cc17c8 add strvals fuzzer from cncf-fuzzing
Signed-off-by: Adam Korczynski <adam@adalogics.com>
2024-09-20 10:40:13 +01:00
Nathan Baulch ff9dd262e3
Fix typos
Signed-off-by: Nathan Baulch <nathan.baulch@gmail.com>
2024-09-14 10:29:56 +10:00
Matt Farina 0833318b32
Merge pull request #9182 from pscheid92/4030-provide-literal-alternative-for-set-flag
Provide an alternative for --set and/or --set-string to take a value literally
2023-04-28 14:39:41 -04:00
Matt Farina 4e7e939f19
Updating the Go version in go.mod
At this time both Go 1.19 and 1.20 are supported. The version
specified in the go.mod file is the minimum version we expect Helm
to be compiled against. This is the oldest supported version to
support environments where others compile Helm. The Helm project
is using Go 1.20 to build Helm itself.

Updating to Go 1.19 also includes dealing with io/ioutil
deprecation and some additional linting issues around staticcheck.
All the staticcheck issues were in test files so linting was
skipped for those.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2023-03-22 11:52:30 -04:00
Matt Farina 50c22ed7f9
Bump the Go version
Needed to gofmt source to meet changes in style

Signed-off-by: Matt Farina <matt.farina@suse.com>
2023-03-22 11:29:26 -04:00
Patrick Scheid c1a65d589a Add protection for stack-overflows for nested keys
Signed-off-by: Patrick Scheid <p.scheid92@gmail.com>
2023-01-06 14:49:11 +01:00
Matt Farina 6611cdcd01
Merge branch 'main' into 4030-provide-literal-alternative-for-set-flag
Signed-off-by: Matt Farina <matt@mattfarina.com>
2023-01-03 09:06:14 -05:00
Martin Hickey b6fef6c466 Fix backwards compatibility
Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2022-12-08 16:00:45 +00:00
Martin Hickey a59e584684 Update string handling
Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2022-11-25 18:16:43 +00:00
Patrick Scheid 451603910e feature(helm): add --set-literal flag for literal string interpretation
The current family of '--set' methods interprets some special characters
in values (e.g. commas, square brackets, points, backslashes). With the
typical shell escaping rules, this can increase the difficulty of overwriting
values in some cases.

In contrast to '--set-string' or similar methods, '--set-literal' does
not interpret those special characters. It interprets given values as
literal strings.

Example:

    --set-literal outer.inner='so\me,values'

    outer:
      inner: so\me,values

Closes #4030

Signed-off-by: Patrick Scheid <p.scheid92@gmail.com>
2022-09-23 13:35:48 +02:00
Martin Hickey 8199db309a
Merge pull request #10693 from lucadirocco/feat/--set-json
feat: add --set-json flag to set json values.
2022-08-31 21:40:19 +01:00
Matt Farina 225f8d7732 Updating index handling
Signed-off-by: Matt Farina <matt@mattfarina.com>
2022-08-17 13:42:28 -04:00
Luca Di Rocco 11e7d0cd73 feat: add --set-json flag to set json values.
When used with helm install, helm template, helm upgrade, it enables
to set json values (scalars/objects/arrays) from the command line.

Closes #10428

Signed-off-by: Luca Di Rocco <lucadirocco@gmail.com>
2022-03-07 13:12:18 +00:00
zwwhdls d58a984878 fix conflict
Signed-off-by: zwwhdls <zwwhdls@hotmail.com>
2020-07-01 21:38:44 +08:00
zwwhdls 1b39857ac3 add test case
Signed-off-by: zwwhdls <zwwhdls@hotmail.com>
2020-07-01 20:34:13 +08:00
zwwhdls 4532485fd0 fix another extreme case
Signed-off-by: zwwhdls <zwwhdls@hotmail.com>
2020-07-01 20:34:13 +08:00
zwwhdls c41c72cee9 add test case
Signed-off-by: zwwhdls <zwwhdls@hotmail.com>
2020-07-01 20:33:50 +08:00
zwwhdls 5396df2e28 fix #6116
Signed-off-by: zwwhdls <zwwhdls@hotmail.com>
2020-07-01 20:33:50 +08:00
Matt Farina 6857da251e
Catching a potential panic in strval parsing
Signed-off-by: Matt Farina <matt@mattfarina.com>
2020-05-15 16:52:04 -04:00
Matt Farina 8f1f0e0db2
Recovering from panic that can occur with make
Signed-off-by: Matt Farina <matt@mattfarina.com>
2020-05-15 16:00:57 -04:00
Matt Farina bade6478fc
Fixing error with strvals parsing
Closes #8140

Signed-off-by: Matt Farina <matt@mattfarina.com>
2020-05-15 15:24:22 -04:00
Guangwen Feng 2f705f94b6 Add corresponding unit test to the function in parser.go
Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
2020-01-09 16:27:56 +08:00
Matthew Fisher b30467c2e5
fix(strvals): port #3912, #4142, #4682, and #5151 to Helm 3
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-11-12 09:57:23 -08:00
Taylor Thomas 7599c5d489 feat(*): Ports `--set-file` flag to v3
I made a few modifications from the original code to fit in with the new
code layout and to clarify a few things. This is a port of #3758

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-09-24 12:43:43 -06: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
Adam Reese 4f26b658d8
change copyright to "Copyright The Helm Authors" 2018-08-24 12:03:55 -07:00
Adam Reese 726e3c41be
feat(*): print stacktrace on error with debug enabled 2018-05-10 09:34:41 -07:00
Erik Sundell 05a1f7f46c Updated tests for PR #3837 2018-04-06 00:59:22 +02:00
Erik Sundell 6cdf6cee56 toYaml - Fixes #3470 - trailing \n issue
`toYaml` was introducing a new line. It is an issue since the new line is part of a functions output, it can't be whitespace chomped away so it would require a `trimSuffix "\n"` pipe. This commit trims one trailing `\n` from the toYaml output.
2018-04-06 00:58:54 +02:00
adshmh 1a55161a53 Fix several golint warnings (#3756)
* fix(helm): fix golint warning due to ApiVersionV1 constant name

Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>

* fix(helm): fix golint warning due to ResolveChartVersionAndGetRepo comment

Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>

* fix(helm): fix golint warnings on HttpGetter type and SetCredentials method missing a comment

Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>

* fix(helm):fix golint warning due to comment on FindChartInAuthRepoURL function

Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>

* fix(helm): fix golint warning due to RepoFile type name

Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>

* fix(helm): fix golint warning due to ParseString comment

Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-03-27 13:06:04 -07:00
Arturo Contreras a615f80c92 Adding --set-string flag to force string values. 2018-03-20 13:35:42 -06:00
Sam Leavens a5dc546726 fix(pkg/strvals): use rune literal instead of ASCII
When checking that a value begins with zero use a rune literal instead of the
ASCII code for zero.
2017-07-27 11:32:10 -07:00
Sam Leavens 609e72b357 fix(pkg/strvals): preserve leading zeros in vals
When passing values with "helm install --set" values with leading zeros are
preserved and not parsed as ints.

Closes #2693
2017-07-26 17:16:39 -07:00
Matt Butcher c01c7318ab
feat(helm): support array index format for --set.
This adds support for specifying list position with an array index using
`--set`. For example, this now works: `--set servers[0].port=8080`
2017-06-08 12:15:03 -06:00
Matthew Fisher 1aee50f5db move pkg cmd/helm/strvals to pkg/strvals
This is another useful package outside of cmd/helm.
2017-03-09 14:05:33 -08:00