Commit Graph
1280 Commits
Author SHA1 Message Date
Dean Coakley a831747dde Refactor get values table header writer
Signed-off-by: Dean Coakley <dean.s.coakley@gmail.com>
2019-10-09 23:08:30 +01:00
Dean Coakley df64ad1e10 Add get values --all test case
Signed-off-by: Dean Coakley <dean.s.coakley@gmail.com>
2019-10-09 23:08:27 +01:00
Dean Coakley 3c899d0bde Add get values table output headers
Signed-off-by: Dean Coakley <dean.s.coakley@gmail.com>
2019-10-09 23:08:22 +01:00
Dean Coakley 66268d9eee fix(cmd): Add --output option to get values
Signed-off-by: Dean Coakley <dean.s.coakley@gmail.com>
2019-10-09 23:08:12 +01:00
Taylor Thomas 62ed7b3764 Merge pull request #6594 from thomastaylor312/feat/template_api_versions
feat(template): Ports api-versions flag to v3
2019-10-08 10:18:07 -06:00
Rimas Mocevicius 648fa876ad Remove Tiller reference from --install (#6604)
Signed-off-by: rimas <rmocius@gmail.com>
2019-10-08 13:52:57 +01:00
Taylor Thomas 0210d43a66 Merge pull request #6550 from thomastaylor312/fix/missing_debug
fix(cmd): Fix all the outputs
2019-10-07 14:03:11 -06:00
Taylor Thomas 59d3488d1c feat(template): Ports api-versions flag to v3
This is a port of #5392. It also takes care of the small chore to update the default k8s
version to 1.16, which is the latest supported version

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-10-07 13:30:06 -06:00
Taylor Thomas 3d64c6bb54 ref(cmd): Implement flag parsing for output format
Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-10-07 12:58:36 -06:00
Taylor Thomas 768d27b387 ref(*): Refactors output into its own package
Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-10-07 10:09:28 -06:00
Efrat Levitan 98a33fb683 helm repo subcommands aliases (#6589)
* helm repo subcommands aliases

Signed-off-by: Efrat19 <efrat890089@gmail.com>

* lint

Signed-off-by: Efrat19 <efrat890089@gmail.com>
2019-10-07 09:57:20 +01:00
Efrat19 f9175ea5d5 run golint
Signed-off-by: Efrat19 <efrat890089@gmail.com>
2019-10-06 21:58:31 +03:00
Efrat19 2cbbc018e7 remove trailing whitespace
Signed-off-by: Efrat19 <efrat890089@gmail.com>
2019-10-06 21:56:27 +03:00
Efrat19 58043d8657 helm plugin subcommands aliases
Signed-off-by: Efrat19 <efrat890089@gmail.com>
2019-10-06 21:51:12 +03:00
Matthew Fisher c1e63a2a17 Merge pull request #6536 from karuppiah7890/fix-lint-for-no-package-found
fix silent lint ignore for non existing packaged charts
2019-10-05 10:57:26 -07:00
Matthew Fisher 29765f4afe Merge pull request #6490 from bacongobbler/port-create-enhancements
fix(chartutil): port over enhancements to `helm create` from Helm 2
2019-10-05 10:23:01 -07:00
Jonas Rutishauser 9ea75a9f59 Use same output format for hooks as for manifest
Signed-off-by: Jonas Rutishauser <jonas.rutishauser@alumni.ethz.ch>
2019-10-04 19:25:26 +02:00
Martin Hickey 2d5faff6a1 Create file locking directory if it does not exist (#6555)
* Create file locking directory if it does not exist

As Helm v3 uses lazy creation for configuration then
directories and files are not created until required.
File locking when doing repo add was introduced in
v2 and ported to v3 in #6492. It locks on the config
directory where the repo file resides and therefore
needs the directory to be created if it doesn't exist.
This fix adds the directory if need be,

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>

* Add unit test

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2019-10-04 17:28:02 +01:00
Karuppiah Natarajan bb9426c4e2 fix(pkg/lint): fix lint silently ignoring non existing packaged charts
Closes #6428

Signed-off-by: Karuppiah Natarajan <karuppiah7890@gmail.com>
2019-10-04 21:28:16 +05:30
Taylor Thomas 3799d0024c fix(cmd): Fix all the outputs
There were two different methods and varying ways to output the status of a release.
This standardizes all of the outputs, but requires a breaking change. Output will
not perfectly match previous v3 output, and we had to break the printing function
in the `action` package, but now things are much more standardized.

Fixes #6238

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-10-03 17:03:19 -06:00
Matthew Fisher 223c859867 fix(create): convert tabs to spaces on help output
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-10-03 12:36:13 -07:00
Matthew Fisher 9510713d21 fix(chartutil): port over enhancements to helm create from Helm 2
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-10-03 12:34:58 -07:00
Matt Farina 6f0235f659 Merge pull request #5498 from mattfarina/go-mod
Migrating dependency management to go modules
2019-10-03 14:44:32 -04: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
Matt Farina 967f4fed42 Update dependencies
* Kubernetes updated to 1.16.1
* SemVer and Sprig updated to latest releases that leverage go
  modules
* Tests and checks updated. These already landed in v2 via PR 6457

Signed-off-by: Matt Farina <matt@mattfarina.com>
2019-10-03 13:49:07 -04:00
Marc Khouzam cb86db7ff5 fix(cmd) have history use global output flag
Also, it seems that for helm v3, the description of flags all start
with a lowercase, so this commit also does that for the output flag.

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2019-10-02 21:55:13 -04:00
Matthew Fisher 5c592dcca6 Merge pull request #6541 from BhaveshSethi/feature/add-version-to-helm-list
Feature/add version to helm list
2019-10-02 14:13:28 -07:00
Bhavesh Sethi 0c43fc9175 go formatted - (gofmt)
Signed-off-by: Bhavesh Sethi <bhaveshsethi1611@gmail.com>
2019-10-01 02:38:11 +05:30
Bhavesh Sethi 951a5d1b9c update test files to account for added field
Signed-off-by: Bhavesh Sethi <bhaveshsethi1611@gmail.com>
2019-10-01 02:34:11 +05:30
Bhavesh Sethi 40962b1be7 add appVersion field to output
Signed-off-by: Bhavesh Sethi <bhaveshsethi1611@gmail.com>
2019-10-01 02:22:53 +05:30
Taylor Thomas 0ca3840714 Merge pull request #6444 from mumoshu/fix-no-hooks-flag
fix(v3): `helm template` output should include hooks by default
2019-09-30 11:32:07 -06:00
Martin Hickey 26dacf84aa feat(cmd): Port child NOTES.txt rendering to Helm 3 (#6512)
* Port Helm 2 PR 4088 to Helm 3

Not a direct port as is but refactored for Helm 3.

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>

* Update unit test to test string retunred for different order

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2019-09-30 16:40:33 +01:00
Yusuke Kuoka 5c18e1b89f fix(helm3): helm template output should include hooks by default
This fixes `helm template [--no-hooks]` to work like proposed in #6443

Manually tested with running `helm template` against `stable/mysql` chart with helm 2, helm 3.0.0-beta.3, and helm 3 after this fix.

The manual test report follows. Assume `helmv3` is 3.0.0-beta.3 and `helmv3-nohooksfix` is the binary build from this PR.

```
$ helmv3 fetch stable/mysql

$ helmv3 template mysql-1.3.1.tgz > helm-template-mysql-helm-3.yaml

$ helmv3-nohooksfix template mysql-1.3.1.tgz > helm-template-mysql-helm-3-with-fix.yaml

$ helmv3-nohooksfix template --no-hooks mysql-1.3.1.tgz > helm-template-mysql-helm-3-with-fix-nohooks-enabled.yaml
```

The example below shows that this fix changes `helm template` to output hooks by default:

```
$ diff --unified helm-template-mysql-helm-3{,-with-fix}.yaml
--- helm-template-mysql-helm-3.yaml	2019-09-17 22:21:38.000000000 +0900
+++ helm-template-mysql-helm-3-with-fix.yaml	2019-09-17 22:21:53.000000000 +0900
@@ -13,10 +13,10 @@
 type: Opaque
 data:

-  mysql-root-password: "VGtybWh5N3JnWA=="
+  mysql-root-password: "aGpHN2VEbnhvVA=="

-  mysql-password: "OTNQSXdNVURBYw=="
+  mysql-password: "UmpwQkVuMHpoQQ=="
 ---
 # Source: mysql/templates/tests/test-configmap.yaml
 apiVersion: v1
@@ -167,3 +167,48 @@
           claimName: RELEASE-NAME-mysql
       # - name: extras
       #   emptyDir: {}
+---
+# Source: mysql/templates/tests/test.yaml
+apiVersion: v1
+kind: Pod
+metadata:
+  name: RELEASE-NAME-mysql-test
+  namespace: default
+  labels:
+    app: RELEASE-NAME-mysql
+    chart: "mysql-1.3.1"
+    heritage: "Helm"
+    release: "RELEASE-NAME"
+  annotations:
+    "helm.sh/hook": test-success
+spec:
+  initContainers:
+    - name: test-framework
+      image: "dduportal/bats:0.4.0"
+      command:
+      - "bash"
+      - "-c"
+      - |
+        set -ex
+        # copy bats to tools dir
+        cp -R /usr/local/libexec/ /tools/bats/
+      volumeMounts:
+      - mountPath: /tools
+        name: tools
+  containers:
+    - name: RELEASE-NAME-test
+      image: "mysql:5.7.14"
+      command: ["/tools/bats/bats", "-t", "/tests/run.sh"]
+      volumeMounts:
+      - mountPath: /tests
+        name: tests
+        readOnly: true
+      - mountPath: /tools
+        name: tools
+  volumes:
+  - name: tests
+    configMap:
+      name: RELEASE-NAME-mysql-test
+  - name: tools
+    emptyDir: {}
+  restartPolicy: Never
```

The example below shows that `helm template --no-hooks` can be used for excluding hooks:

```
$ diff --unified helm-template-mysql-helm-3{,-with-fix-nohooks-enabled}.yaml
--- helm-template-mysql-helm-3.yaml	2019-09-17 22:21:38.000000000 +0900
+++ helm-template-mysql-helm-3-with-fix-nohooks-enabled.yaml	2019-09-17 22:22:03.000000000 +0900
@@ -13,10 +13,10 @@
 type: Opaque
 data:

-  mysql-root-password: "VGtybWh5N3JnWA=="
+  mysql-root-password: "Zk1LYUd6OWgzaQ=="

-  mysql-password: "OTNQSXdNVURBYw=="
+  mysql-password: "OTZPZU9hdlFORg=="
 ---
 # Source: mysql/templates/tests/test-configmap.yaml
 apiVersion: v1
```

Fixes #6443

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2019-09-28 09:18:45 +09:00
Taylor Thomas 3fa4465eec Merge pull request #6502 from VilledeMontreal/feat-v3/compRenamedBin
v3: Support auto-complete of a renamed helm binary
2019-09-27 12:18:05 -06:00
Marc Khouzam c225b60307 Avoid string concatenation
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2019-09-26 21:19:54 -04:00
Taylor Thomas 15d277360e Merge pull request #6504 from thomastaylor312/feat/output
feat(*): Ports all output functionality from v2
2019-09-26 12:30:23 -06:00
Taylor Thomas eac6a60001 feat(*): Ports all output functionality from v2
As part of this port, I removed some now superfluous code from the `action` package.
This is technically a breaking change, but since the package was introduced in v3, it
is highly unlikely anyone is using it and we are still within the beta window.

Also closes #6437

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-09-25 16:07:10 -06:00
Adam Reese d3805a1d54 ref(pkg/cli): refactor environment variable setup
This change sets proper defaults based on environment variables for
global settings and plugin environments.

Signed-off-by: Adam Reese <adam@reese.io>
2019-09-25 14:00:43 -07:00
Taylor Thomas 85572df378 Merge pull request #6494 from thomastaylor312/feat/set_file
feat(*): Ports `--set-file` flag to v3
2019-09-25 10:20:11 -06:00
Matthew Fisher 7928803ace Merge pull request #6492 from bacongobbler/port-5678
fix(cmd): lock repository file during `helm repo add`
2019-09-25 09:17:22 -07:00
Matthew Fisher 3fa07d572f fix(cmd): lock repository file during helm repo add
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-09-25 08:50:25 -07:00
Marc Khouzam b3857b5d80 feat(comp): auto-complete of a renamed helm binary
If a user renames the helm binary, the shell needs to be told that this
new name corresponds to the helm completion function. For example if
the user decides to rename the helm v3 binary to 'helm3', then the
following command extra command would need be run by the user:
   complete -o default -F __start_helm helm3.

This commit automates this by adding this extra command to the generated
shell completion script by looking at what binary was used to call the
helm completion command.  For example, if the user renames the binary
to helm3 and then calls
   helm3 completion bash
the completion script will include a hook for the binary 'helm3' to
the completion script.

A binary rename is one of the two options recommended when users need to
run both helm2 and helm3.

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2019-09-25 06:18:02 -04:00
Marc Khouzam 681eab83f9 feat(comp): have zsh completion generation re-use bash code
This allows that any addition to the bash completion logic be
automatically added to the zsh logic.

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2019-09-25 06:18:00 -04: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
Matthew Fisher 05d93b2c7a feat(cmd): implement helm get --template
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-09-24 11:41:31 -07:00
Taylor Thomas 6419ff6961 Merge pull request #6480 from thomastaylor312/feat/cleanup_on_fail
feat(*): Ports `--cleanup-on-fail` to v3
2019-09-24 10:42:10 -06:00
Marc Khouzam 2db09189f4 Simplify logic
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2019-09-23 21:55:00 -04:00
Marc Khouzam d50e2a3134 Merge branch 'dev-v3' into feat-v3/dynCompDifferentHelm 2019-09-23 21:12:31 -04:00
Taylor Thomas 17854e83af feat(*): Ports --cleanup-on-fail to v3
This ports the functionality of cleanup on fail to v3 as introduced in #4871. This has been tested manually
and would be a good candidate for a new acceptance test.

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-09-23 16:13:02 -06:00
Matthew Fisher 4971ed5077 fix(list): scrub list returned from .List()
This way only the latest release is displayed with `helm list`.

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-09-23 15:00:16 -07:00