We already had the copystructure library in our dependencies transitively
through sprig. This solves a gob encoding bug that was causing issues with
chart testing
Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
Fixes#5733
This adds two specific checks. A warning if a chart has a `crd-install` hook
and an error if the chart contains `.Release.Time`. Further checks can be added
down the road as needed using the same pattern I use here
Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
this was partially fixed in #6430 but the fix only
worked for values without nesting. this PR fixes it.
this is done by doing a deep copy of values rather
than a top level keys copy. deep copy ensures
values are not mutated during coalesce()
execution which leads to bugs like #6659
the deep copy code has been copied from:
https://gist.github.com/soroushjp/0ec92102641ddfc3ad5515ca76405f4d
which is in turn inspired by this stackoverflow answer:
http://stackoverflow.com/a/28579297/1366283
Signed-off-by: Karuppiah Natarajan <karuppiah7890@gmail.com>
Added a tgz "frobnitz.v1.tgz" of the testdata folder frobnitz.v1
Verified that without the fix the unit test fails and re-produces
the issue.
Signed-off-by: Sidharth Surana <ssurana@vmware.com>
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>
Any method that had a function parameter that was a `Time` or returned a
`Time` is now wrapped so you can use our time wrapper without any weird conventions
Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
This package mainly exists to workaround an issue in Go
where the serializer doesn't omit an empty value for time:
https://github.com/golang/go/issues/11939. This replaces all
release and hook object time references with the new time package
so things actually marshal correctly
Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
Consistenly remove all arguments which are passed as environment
variables.
Get all arguments from environment variables passed to plugins.
Signed-off-by: Jonas Rutishauser <jonas.rutishauser@alumni.ethz.ch>
As part of #6552
The is a break in compatibility because 'helm get' is no longer a
valid command on its own; what it used to do is now achieved with
'helm get all'.
This change avoids confusion between release name and subcommands.
It also allows dynamic shell comnpletion to work for 'helm get all'.
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
As part of #6552
The is a break in compatibility because 'helm show' is no longer a
valid command on its own; what it used to do is now achieved with
'helm show all'.
This change avoids confusion between chart reference and subcommands.
It also opens the door to dynamic shell comnpletion.
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
The recent init action config switched the order of how variables get bound
and where. This led to the namespace variable not being propagated down into
the calls to kubernetes.
Co-authored-by: Matthew Fisher <matt.fisher@microsoft.com>
Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
Because these were additions, git didn't pick up that the recent refactor of
env settings had changed some of the variables. This fixes those small changes
Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
* Drop dependency on k8s.io/kubernetes
https://github.com/helm/helm/issues/6606
Depending on k8s.io/kubernetes is not recommended by Kubernetes, and
forces dependencies of Helm to also depend on them. We are only using
this dependency in one relatively isolated occurance, which can be
easily copied over rather than depending on the entire Kubernetes.
Copying this code is not very desirable, so if we don't want to have
this duplication we can at least use this PR as a PoC and see if we can
get Kubernetes to publish the controller package as a separate Go module
(see
https://github.com/kubernetes/kubernetes/issues/79384#issuecomment-538740756)
Signed-off-by: John Howard <howardjohn@google.com>
* Move to internal
Signed-off-by: John Howard <howardjohn@google.com>
* Exclude third_party from validate-license.sh
Signed-off-by: John Howard <howardjohn@google.com>
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>