diff --git a/.circleci/bootstrap.sh b/.circleci/bootstrap.sh index 978464efe..30dc0b316 100755 --- a/.circleci/bootstrap.sh +++ b/.circleci/bootstrap.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright 2016 The Kubernetes Authors All rights reserved. +# Copyright The Helm Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.circleci/deploy.sh b/.circleci/deploy.sh index 6ad91109d..08adad568 100755 --- a/.circleci/deploy.sh +++ b/.circleci/deploy.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright 2016 The Kubernetes Authors All rights reserved. +# Copyright The Helm Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.circleci/test.sh b/.circleci/test.sh index e0faf9c18..a6acd8f6a 100755 --- a/.circleci/test.sh +++ b/.circleci/test.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright 2016 The Kubernetes Authors All rights reserved. +# Copyright The Helm Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.gitignore b/.gitignore index b94f87b26..7fdfdcf2a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ _dist/ _proto/*.pb.go bin/ +rootfs/helm rootfs/tiller rootfs/rudder vendor/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 34b4f8b16..81ed009d4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,7 +7,7 @@ The Kubernetes Helm project accepts contributions via GitHub pull requests. This Most of the time, when you find a bug in Helm, it should be reported using [GitHub issues](https://github.com/kubernetes/helm/issues). However, if you are reporting a _security vulnerability_, please email a report to -[helm-security@deis.com](mailto:helm-security@deis.com). This will give +[cncf-kubernetes-helm-security@lists.cncf.io](mailto:cncf-kubernetes-helm-security@lists.cncf.io). This will give us a chance to try to fix the issue before it is exploited in the wild. ## Contributor License Agreements @@ -31,7 +31,9 @@ apply to [third_party](third_party/) and [vendor](vendor/). Whether you are a user or contributor, official support channels include: - GitHub [issues](https://github.com/kubernetes/helm/issues/new) -- Slack: #Helm room in the [Kubernetes Slack](http://slack.kubernetes.io/) +- Slack [Kubernetes Slack](http://slack.kubernetes.io/): + - User: #helm-users + - Contributor: #helm-dev Before opening a new issue or submitting a new pull request, it's helpful to search the project - it's likely that another user has already reported the issue you're facing, or it's a known issue that we're already aware of. @@ -40,20 +42,20 @@ Before opening a new issue or submitting a new pull request, it's helpful to sea We use milestones to track progress of releases. There are also 2 special milestones used for helping us keep work organized: `Upcoming - Minor` and `Upcoming - Major` -`Upcoming - Minor` is used for keeping track of issues that aren't assigned to a specific +`Upcoming - Minor` is used for keeping track of issues that aren't assigned to a specific release but could easily be addressed in a minor release. `Upcoming - Major` keeps track -of issues that will need to be addressed in a major release. For example, if the current -version is `2.2.0` an issue/PR could fall in to one of 4 different active milestones: -`2.2.1`, `2.3.0`, `Upcoming - Minor`, or `Upcoming - Major`. If an issue pertains to a -specific upcoming bug or minor release, it would go into `2.2.1` or `2.3.0`. If the issue/PR -does not have a specific milestone yet, but it is likely that it will land in a `2.X` release, -it should go into `Upcoming - Minor`. If the issue/PR is a large functionality add or change -and/or it breaks compatibility, then it should be added to the `Upcoming - Major` milestone. +of issues that will need to be addressed in a major release. For example, if the current +version is `2.2.0` an issue/PR could fall in to one of 4 different active milestones: +`2.2.1`, `2.3.0`, `Upcoming - Minor`, or `Upcoming - Major`. If an issue pertains to a +specific upcoming bug or minor release, it would go into `2.2.1` or `2.3.0`. If the issue/PR +does not have a specific milestone yet, but it is likely that it will land in a `2.X` release, +it should go into `Upcoming - Minor`. If the issue/PR is a large functionality add or change +and/or it breaks compatibility, then it should be added to the `Upcoming - Major` milestone. An issue that we are not sure we will be doing will not be added to any milestone. A milestone (and hence release) is considered done when all outstanding issues/PRs have been closed or moved to another milestone. -## Semver +## Semantic Versioning Helm maintains a strong commitment to backward compatibility. All of our changes to protocols and formats are backward compatible from Helm 2.0 until Helm 3.0. No features, flags, or commands are removed or substantially modified (other than bug fixes). @@ -75,42 +77,42 @@ Issues are used as the primary method for tracking anything to do with the Helm ### Issue Types There are 4 types of issues (each with their own corresponding [label](#labels)): -- Question: These are support or functionality inquiries that we want to have a record of for -future reference. Generally these are questions that are too complex or large to store in the -Slack channel or have particular interest to the community as a whole. Depending on the discussion, +- Question: These are support or functionality inquiries that we want to have a record of for +future reference. Generally these are questions that are too complex or large to store in the +Slack channel or have particular interest to the community as a whole. Depending on the discussion, these can turn into "Feature" or "Bug" issues. -- Proposal: Used for items (like this one) that propose a new ideas or functionality that require -a larger community discussion. This allows for feedback from others in the community before a -feature is actually developed. This is not needed for small additions. Final word on whether or -not a feature needs a proposal is up to the core maintainers. All issues that are proposals should -both have a label and an issue title of "Proposal: [the rest of the title]." A proposal can become +- Proposal: Used for items (like this one) that propose a new ideas or functionality that require +a larger community discussion. This allows for feedback from others in the community before a +feature is actually developed. This is not needed for small additions. Final word on whether or +not a feature needs a proposal is up to the core maintainers. All issues that are proposals should +both have a label and an issue title of "Proposal: [the rest of the title]." A proposal can become a "Feature" and does not require a milestone. -- Features: These track specific feature requests and ideas until they are complete. They can evolve +- Features: These track specific feature requests and ideas until they are complete. They can evolve from a "Proposal" or can be submitted individually depending on the size. - Bugs: These track bugs with the code or problems with the documentation (i.e. missing or incomplete) ### Issue Lifecycle -The issue lifecycle is mainly driven by the core maintainers, but is good information for those +The issue lifecycle is mainly driven by the core maintainers, but is good information for those contributing to Helm. All issue types follow the same general lifecycle. Differences are noted below. 1. Issue creation 2. Triage - - The maintainer in charge of triaging will apply the proper labels for the issue. This - includes labels for priority, type, and metadata (such as "starter"). The only issue - priority we will be tracking is whether or not the issue is "critical." If additional + - The maintainer in charge of triaging will apply the proper labels for the issue. This + includes labels for priority, type, and metadata (such as "starter"). The only issue + priority we will be tracking is whether or not the issue is "critical." If additional levels are needed in the future, we will add them. - - (If needed) Clean up the title to succinctly and clearly state the issue. Also ensure + - (If needed) Clean up the title to succinctly and clearly state the issue. Also ensure that proposals are prefaced with "Proposal". - - Add the issue to the correct milestone. If any questions come up, don't worry about + - Add the issue to the correct milestone. If any questions come up, don't worry about adding the issue to a milestone until the questions are answered. - We attempt to do this process at least once per work day. 3. Discussion - - "Feature" and "Bug" issues should be connected to the PR that resolves it. - - Whoever is working on a "Feature" or "Bug" issue (whether a maintainer or someone from - the community), should either assign the issue to them self or make a comment in the issue + - "Feature" and "Bug" issues should be connected to the PR that resolves it. + - Whoever is working on a "Feature" or "Bug" issue (whether a maintainer or someone from + the community), should either assign the issue to them self or make a comment in the issue saying that they are taking it. - - "Proposal" and "Question" issues should stay open until resolved or if they have not been - active for more than 30 days. This will help keep the issue queue to a manageable size and + - "Proposal" and "Question" issues should stay open until resolved or if they have not been + active for more than 30 days. This will help keep the issue queue to a manageable size and reduce noise. Should the issue need to stay open, the `keep open` label can be added. 4. Issue closure @@ -133,36 +135,36 @@ Like any good open source project, we use Pull Requests to track code changes 1. PR creation - We more than welcome PRs that are currently in progress. They are a great way to keep track of - important work that is in-flight, but useful for others to see. If a PR is a work in progress, + important work that is in-flight, but useful for others to see. If a PR is a work in progress, it **must** be prefaced with "WIP: [title]". Once the PR is ready for review, remove "WIP" from the title. - It is preferred, but not required, to have a PR tied to a specific issue. 2. Triage - - The maintainer in charge of triaging will apply the proper labels for the issue. This should - include at least a size label, `bug` or `feature`, and `awaiting review` once all labels are applied. + - The maintainer in charge of triaging will apply the proper labels for the issue. This should + include at least a size label, `bug` or `feature`, and `awaiting review` once all labels are applied. See the [Labels section](#labels) for full details on the definitions of labels - Add the PR to the correct milestone. This should be the same as the issue the PR closes. 3. Assigning reviews - - Once a review has the `awaiting review` label, maintainers will review them as schedule permits. + - Once a review has the `awaiting review` label, maintainers will review them as schedule permits. The maintainer who takes the issue should self-request a review. - - Reviews from others in the community, especially those who have encountered a bug or have - requested a feature, are highly encouraged, but not required. Maintainer reviews **are** required + - Reviews from others in the community, especially those who have encountered a bug or have + requested a feature, are highly encouraged, but not required. Maintainer reviews **are** required before any merge - - Any PR with the `size/large` label requires 2 review approvals from maintainers before it can be + - Any PR with the `size/large` label requires 2 review approvals from maintainers before it can be merged. Those with `size/medium` are per the judgement of the maintainers 4. Reviewing/Discussion - - Once a maintainer begins reviewing a PR, they will remove the `awaiting review` label and add - the `in progress` label so the person submitting knows that it is being worked on. This is + - Once a maintainer begins reviewing a PR, they will remove the `awaiting review` label and add + the `in progress` label so the person submitting knows that it is being worked on. This is especially helpful when the review may take awhile. - All reviews will be completed using Github review tool. - - A "Comment" review should be used when there are questions about the code that should be + - A "Comment" review should be used when there are questions about the code that should be answered, but that don't involve code changes. This type of review does not count as approval. - A "Changes Requested" review indicates that changes to the code need to be made before they will be merged. - Reviewers should update labels as needed (such as `needs rebase`) 5. Address comments by answering questions or changing code 6. Merge or close - - PRs should stay open until merged or if they have not been active for more than 30 days. - This will help keep the PR queue to a manageable size and reduce noise. Should the PR need + - PRs should stay open until merged or if they have not been active for more than 30 days. + This will help keep the PR queue to a manageable size and reduce noise. Should the PR need to stay open (like in the case of a WIP), the `keep open` label can be added. - If the owner of the PR is listed in `OWNERS`, that user **must** merge their own PRs or explicitly request another OWNER do that for them. @@ -171,14 +173,14 @@ Like any good open source project, we use Pull Requests to track code changes #### Documentation PRs -Documentation PRs will follow the same lifecycle as other PRs. They will also be labeled with the -`docs` label. For documentation, special attention will be paid to spelling, grammar, and clarity +Documentation PRs will follow the same lifecycle as other PRs. They will also be labeled with the +`docs` label. For documentation, special attention will be paid to spelling, grammar, and clarity (whereas those things don't matter *as* much for comments in code). ## The Triager -Each week, one of the core maintainers will serve as the designated "triager" starting after the -public standup meetings on Thursday. This person will be in charge triaging new PRs and issues +Each week, one of the core maintainers will serve as the designated "triager" starting after the +public standup meetings on Thursday. This person will be in charge triaging new PRs and issues throughout the work week. ## Labels @@ -222,11 +224,11 @@ The following tables define all label types used for Helm. It is split up by cat #### Size labels -Size labels are used to indicate how "dangerous" a PR is. The guidelines below are used to assign the -labels, but ultimately this can be changed by the maintainers. For example, even if a PR only makes -30 lines of changes in 1 file, but it changes key functionality, it will likely be labeled as `size/large` -because it requires sign off from multiple people. Conversely, a PR that adds a small feature, but requires -another 150 lines of tests to cover all cases, could be labeled as `size/small` even though the number +Size labels are used to indicate how "dangerous" a PR is. The guidelines below are used to assign the +labels, but ultimately this can be changed by the maintainers. For example, even if a PR only makes +30 lines of changes in 1 file, but it changes key functionality, it will likely be labeled as `size/large` +because it requires sign off from multiple people. Conversely, a PR that adds a small feature, but requires +another 150 lines of tests to cover all cases, could be labeled as `size/small` even though the number lines is greater than defined below. | Label | Description | diff --git a/LICENSE b/LICENSE index 21c57fae2..393b7a33b 100644 --- a/LICENSE +++ b/LICENSE @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2016 The Kubernetes Authors All Rights Reserved + Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Makefile b/Makefile index a8f778377..77d7c8ff7 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ DOCKER_REGISTRY ?= gcr.io IMAGE_PREFIX ?= kubernetes-helm SHORT_NAME ?= tiller SHORT_NAME_RUDDER ?= rudder -TARGETS ?= darwin/amd64 linux/amd64 linux/386 linux/arm linux/arm64 linux/ppc64le windows/amd64 +TARGETS ?= darwin/amd64 linux/amd64 linux/386 linux/arm linux/arm64 linux/ppc64le linux/s390x windows/amd64 DIST_DIRS = find * -type d -exec APP = helm @@ -60,6 +60,7 @@ check-docker: docker-binary: BINDIR = ./rootfs docker-binary: GOFLAGS += -a -installsuffix cgo docker-binary: + GOOS=linux GOARCH=amd64 CGO_ENABLED=0 $(GO) build -o $(BINDIR)/helm $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' k8s.io/helm/cmd/helm GOOS=linux GOARCH=amd64 CGO_ENABLED=0 $(GO) build -o $(BINDIR)/tiller $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' k8s.io/helm/cmd/tiller .PHONY: docker-build diff --git a/OWNERS b/OWNERS index 32b26efa2..39f8c8448 100644 --- a/OWNERS +++ b/OWNERS @@ -28,3 +28,4 @@ emeritus: - migmartri - seh - vaikas-google + - rimusz diff --git a/README.md b/README.md index fc091056e..6a35c3f4d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Kubernetes Helm -[![CircleCI](https://circleci.com/gh/kubernetes/helm.svg?style=svg)](https://circleci.com/gh/kubernetes/helm) -[![Go Report Card](https://goreportcard.com/badge/github.com/kubernetes/helm)](https://goreportcard.com/report/github.com/kubernetes/helm) +[![CircleCI](https://circleci.com/gh/helm/helm.svg?style=svg)](https://circleci.com/gh/helm/helm) +[![Go Report Card](https://goreportcard.com/badge/github.com/helm/helm)](https://goreportcard.com/report/github.com/helm/helm) [![GoDoc](https://godoc.org/github.com/kubernetes/helm?status.svg)](https://godoc.org/github.com/kubernetes/helm) Helm is a tool for managing Kubernetes charts. Charts are packages of @@ -9,7 +9,7 @@ pre-configured Kubernetes resources. Use Helm to: -- Find and use [popular software packaged as Kubernetes charts](https://github.com/kubernetes/charts) +- Find and use [popular software packaged as Kubernetes charts](https://github.com/helm/charts) - Share your own applications as Kubernetes charts - Create reproducible builds of your Kubernetes applications - Intelligently manage your Kubernetes manifest files @@ -32,14 +32,15 @@ Think of it like apt/yum/homebrew for Kubernetes. ## Install -Binary downloads of the Helm client can be found on [the latest Releases page](https://github.com/kubernetes/helm/releases/latest). +Binary downloads of the Helm client can be found on [the Releases page](https://github.com/helm/helm/releases/latest). Unpack the `helm` binary and add it to your PATH and you are good to go! If you want to use a package manager: -- macOS/[homebrew](https://brew.sh/) users can use `brew install kubernetes-helm`. -- Windows/[chocolatey](https://chocolatey.org/) users can use `choco install kubernetes-helm`. +- [Homebrew](https://brew.sh/) users can use `brew install kubernetes-helm`. +- [Chocolatey](https://chocolatey.org/) users can use `choco install kubernetes-helm`. +- [GoFish](https://gofi.sh/) users can use `gofish install helm`. To rapidly get Helm up and running, start with the [Quick Start Guide](https://docs.helm.sh/using_helm/#quickstart-guide). @@ -52,16 +53,16 @@ Get started with the [Quick Start guide](https://docs.helm.sh/using_helm/#quicks ## Roadmap -The [Helm roadmap uses Github milestones](https://github.com/kubernetes/helm/milestones) to track the progress of the project. +The [Helm roadmap uses Github milestones](https://github.com/helm/helm/milestones) to track the progress of the project. ## Community, discussion, contribution, and support You can reach the Helm community and developers via the following channels: - [Kubernetes Slack](http://slack.k8s.io): - - #helm-users - - #helm-dev - - #charts + - [#helm-users](https://kubernetes.slack.com/messages/helm-users) + - [#helm-dev](https://kubernetes.slack.com/messages/helm-dev) + - [#charts](https://kubernetes.slack.com/messages/charts) - Mailing Lists: - [Helm Mailing List](https://lists.cncf.io/g/cncf-kubernetes-helm) - [Kubernetes SIG Apps Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-apps) diff --git a/SECURITY_CONTACTS b/SECURITY_CONTACTS new file mode 100644 index 000000000..7298ea2d2 --- /dev/null +++ b/SECURITY_CONTACTS @@ -0,0 +1,20 @@ +# Defined below are the security contacts for this repo. +# +# They are the contact point for the Product Security Team to reach out +# to for triaging and handling of incoming issues. +# +# The below names agree to abide by the +# [Embargo Policy](https://github.com/kubernetes/sig-release/blob/master/security-release-process-documentation/security-release-process.md#embargo-policy) +# and will be removed and replaced if they violate that agreement. +# +# DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE +# INSTRUCTIONS AT https://github.com/kubernetes/helm/blob/master/CONTRIBUTING.md#reporting-a-security-issue + +adamreese +bacongobbler +mattfarina +michelleN +prydonius +SlickNik +technosophos +thomastaylor312 diff --git a/_proto/hapi/chart/chart.proto b/_proto/hapi/chart/chart.proto index 9b838fd1a..68aea8f05 100644 --- a/_proto/hapi/chart/chart.proto +++ b/_proto/hapi/chart/chart.proto @@ -1,4 +1,4 @@ -// Copyright 2016 The Kubernetes Authors All rights reserved. +// Copyright The Helm Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/_proto/hapi/chart/config.proto b/_proto/hapi/chart/config.proto index a1404476b..a851d212f 100644 --- a/_proto/hapi/chart/config.proto +++ b/_proto/hapi/chart/config.proto @@ -1,4 +1,4 @@ -// Copyright 2016 The Kubernetes Authors All rights reserved. +// Copyright The Helm Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/_proto/hapi/chart/metadata.proto b/_proto/hapi/chart/metadata.proto index 49d6a217a..0ac695ce2 100644 --- a/_proto/hapi/chart/metadata.proto +++ b/_proto/hapi/chart/metadata.proto @@ -1,4 +1,4 @@ -// Copyright 2016 The Kubernetes Authors All rights reserved. +// Copyright The Helm Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/_proto/hapi/chart/template.proto b/_proto/hapi/chart/template.proto index d13543ea9..879d2071a 100644 --- a/_proto/hapi/chart/template.proto +++ b/_proto/hapi/chart/template.proto @@ -1,4 +1,4 @@ -// Copyright 2016 The Kubernetes Authors All rights reserved. +// Copyright The Helm Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/_proto/hapi/release/hook.proto b/_proto/hapi/release/hook.proto index 0d96dd9ae..cf7e25bf6 100644 --- a/_proto/hapi/release/hook.proto +++ b/_proto/hapi/release/hook.proto @@ -1,4 +1,4 @@ -// Copyright 2016 The Kubernetes Authors All rights reserved. +// Copyright The Helm Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/_proto/hapi/release/info.proto b/_proto/hapi/release/info.proto index e23175d3d..ee03056c7 100644 --- a/_proto/hapi/release/info.proto +++ b/_proto/hapi/release/info.proto @@ -1,4 +1,4 @@ -// Copyright 2016 The Kubernetes Authors All rights reserved. +// Copyright The Helm Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/_proto/hapi/release/release.proto b/_proto/hapi/release/release.proto index 4a6afa0fe..ce9208e29 100644 --- a/_proto/hapi/release/release.proto +++ b/_proto/hapi/release/release.proto @@ -1,4 +1,4 @@ -// Copyright 2016 The Kubernetes Authors All rights reserved. +// Copyright The Helm Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/_proto/hapi/release/status.proto b/_proto/hapi/release/status.proto index ef28a233c..aa90760b3 100644 --- a/_proto/hapi/release/status.proto +++ b/_proto/hapi/release/status.proto @@ -1,4 +1,4 @@ -// Copyright 2016 The Kubernetes Authors All rights reserved. +// Copyright The Helm Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/_proto/hapi/release/test_run.proto b/_proto/hapi/release/test_run.proto index 60734ae03..7c281669f 100644 --- a/_proto/hapi/release/test_run.proto +++ b/_proto/hapi/release/test_run.proto @@ -1,5 +1,5 @@ -// Copyright 2016 The Kubernetes Authors All rights reserved. +// Copyright The Helm Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/_proto/hapi/release/test_suite.proto b/_proto/hapi/release/test_suite.proto index 2f6feb08c..9ac6583b2 100644 --- a/_proto/hapi/release/test_suite.proto +++ b/_proto/hapi/release/test_suite.proto @@ -1,4 +1,4 @@ -// Copyright 2016 The Kubernetes Authors All rights reserved. +// Copyright The Helm Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/_proto/hapi/rudder/rudder.proto b/_proto/hapi/rudder/rudder.proto index 3a37c9e99..188491512 100644 --- a/_proto/hapi/rudder/rudder.proto +++ b/_proto/hapi/rudder/rudder.proto @@ -1,4 +1,4 @@ -// Copyright 2017 The Kubernetes Authors All rights reserved. +// Copyright The Helm Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/_proto/hapi/services/tiller.proto b/_proto/hapi/services/tiller.proto index 8daef0cb3..a94a90a4a 100644 --- a/_proto/hapi/services/tiller.proto +++ b/_proto/hapi/services/tiller.proto @@ -1,4 +1,4 @@ -// Copyright 2016 The Kubernetes Authors All rights reserved. +// Copyright The Helm Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -89,7 +89,7 @@ service ReleaseService { // // Releases can be retrieved in chunks by setting limit and offset. // -// Releases can be sorted according to a few pre-determined sort stategies. +// Releases can be sorted according to a few pre-determined sort strategies. message ListReleasesRequest { // Limit is the maximum number of releases to be returned. int64 limit = 1; @@ -209,6 +209,8 @@ message UpdateReleaseRequest { bool reuse_values = 10; // Force resource update through delete/recreate if needed. bool force = 11; + // Description, if set, will set the description for the updated release + string description = 12; } // UpdateReleaseResponse is the response to an update request. @@ -234,6 +236,8 @@ message RollbackReleaseRequest { bool wait = 7; // Force resource update through delete/recreate if needed. bool force = 8; + // Description, if set, will set the description for the rollback + string description = 9; } // RollbackReleaseResponse is the response to an update request. @@ -260,10 +264,10 @@ message InstallReleaseRequest { // DisableHooks causes the server to skip running any hooks for the install. bool disable_hooks = 5; - // Namepace is the kubernetes namespace of the release. + // Namespace is the kubernetes namespace of the release. string namespace = 6; - // ReuseName requests that Tiller re-uses a name, instead of erroring out. + // Reuse_name requests that Tiller re-uses a name, instead of erroring out. bool reuse_name = 7; // timeout specifies the max amount of time any kubernetes client command can run. @@ -273,6 +277,9 @@ message InstallReleaseRequest { bool wait = 9; bool disable_crd_hook = 10; + + // Description, if set, will set the description for the installed release + string description = 11; } // InstallReleaseResponse is the response from a release installation. @@ -290,6 +297,8 @@ message UninstallReleaseRequest { bool purge = 3; // timeout specifies the max amount of time any kubernetes client command can run. int64 timeout = 4; + // Description, if set, will set the description for the uninnstalled release + string description = 5; } // UninstallReleaseResponse represents a successful response to an uninstall request. diff --git a/_proto/hapi/version/version.proto b/_proto/hapi/version/version.proto index 0ae0985b7..5c50e852f 100644 --- a/_proto/hapi/version/version.proto +++ b/_proto/hapi/version/version.proto @@ -1,4 +1,4 @@ -// Copyright 2016 The Kubernetes Authors All rights reserved. +// Copyright The Helm Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/cmd/helm/completion.go b/cmd/helm/completion.go index b1cd04140..f1057d055 100644 --- a/cmd/helm/completion.go +++ b/cmd/helm/completion.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/cmd/helm/create.go b/cmd/helm/create.go index 556ff171d..eaea81e5b 100644 --- a/cmd/helm/create.go +++ b/cmd/helm/create.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/create_test.go b/cmd/helm/create_test.go index 84ccebece..214432b83 100644 --- a/cmd/helm/create_test.go +++ b/cmd/helm/create_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/delete.go b/cmd/helm/delete.go index e0ac8c4f6..ad7c6049a 100755 --- a/cmd/helm/delete.go +++ b/cmd/helm/delete.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -40,6 +40,7 @@ type deleteCmd struct { disableHooks bool purge bool timeout int64 + description string out io.Writer client helm.Interface @@ -81,6 +82,7 @@ func newDeleteCmd(c helm.Interface, out io.Writer) *cobra.Command { f.BoolVar(&del.disableHooks, "no-hooks", false, "prevent hooks from running during deletion") f.BoolVar(&del.purge, "purge", false, "remove the release from the store and make its name free for later use") f.Int64Var(&del.timeout, "timeout", 300, "time in seconds to wait for any individual Kubernetes operation (like Jobs for hooks)") + f.StringVar(&del.description, "description", "", "specify a description for the release") return cmd } @@ -91,6 +93,7 @@ func (d *deleteCmd) run() error { helm.DeleteDisableHooks(d.disableHooks), helm.DeletePurge(d.purge), helm.DeleteTimeout(d.timeout), + helm.DeleteDescription(d.description), } res, err := d.client.DeleteRelease(d.name, opts...) if res != nil && res.Info != "" { diff --git a/cmd/helm/delete_test.go b/cmd/helm/delete_test.go index 829d17906..b71860e67 100644 --- a/cmd/helm/delete_test.go +++ b/cmd/helm/delete_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -61,6 +61,14 @@ func TestDelete(t *testing.T) { resp: helm.ReleaseMock(&helm.MockReleaseOptions{Name: "aeneas"}), rels: []*release.Release{helm.ReleaseMock(&helm.MockReleaseOptions{Name: "aeneas"})}, }, + { + name: "delete with description", + args: []string{"aeneas"}, + flags: []string{"--description", "foo"}, + expected: "", + resp: helm.ReleaseMock(&helm.MockReleaseOptions{Name: "aeneas"}), + rels: []*release.Release{helm.ReleaseMock(&helm.MockReleaseOptions{Name: "aeneas"})}, + }, { name: "delete without release", args: []string{}, diff --git a/cmd/helm/dependency.go b/cmd/helm/dependency.go index 231659691..1e3079ded 100644 --- a/cmd/helm/dependency.go +++ b/cmd/helm/dependency.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -141,7 +141,7 @@ func (l *dependencyListCmd) run() error { r, err := chartutil.LoadRequirements(c) if err != nil { if err == chartutil.ErrRequirementsNotFound { - fmt.Fprintf(l.out, "WARNING: no requirements at %s/charts\n", l.chartpath) + fmt.Fprintf(l.out, "WARNING: no requirements at %s\n", filepath.Join(l.chartpath, "charts")) return nil } return err diff --git a/cmd/helm/dependency_build.go b/cmd/helm/dependency_build.go index ec5fd14b7..3af3c1243 100644 --- a/cmd/helm/dependency_build.go +++ b/cmd/helm/dependency_build.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/cmd/helm/dependency_build_test.go b/cmd/helm/dependency_build_test.go index 2d7c88654..207313bf5 100644 --- a/cmd/helm/dependency_build_test.go +++ b/cmd/helm/dependency_build_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/cmd/helm/dependency_test.go b/cmd/helm/dependency_test.go index cc4519147..e98f436ec 100644 --- a/cmd/helm/dependency_test.go +++ b/cmd/helm/dependency_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/cmd/helm/dependency_update.go b/cmd/helm/dependency_update.go index d6a998639..a8e54137b 100644 --- a/cmd/helm/dependency_update.go +++ b/cmd/helm/dependency_update.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/cmd/helm/dependency_update_test.go b/cmd/helm/dependency_update_test.go index e29cb35de..f7ef84e6f 100644 --- a/cmd/helm/dependency_update_test.go +++ b/cmd/helm/dependency_update_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/cmd/helm/docs.go b/cmd/helm/docs.go index e5b9f7521..56e3beaf5 100644 --- a/cmd/helm/docs.go +++ b/cmd/helm/docs.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/cmd/helm/fetch.go b/cmd/helm/fetch.go index 069f57eff..d6f622bb6 100644 --- a/cmd/helm/fetch.go +++ b/cmd/helm/fetch.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/fetch_test.go b/cmd/helm/fetch_test.go index 13247ee99..3fba37dd6 100644 --- a/cmd/helm/fetch_test.go +++ b/cmd/helm/fetch_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/get.go b/cmd/helm/get.go index a2eb1d137..5744beb62 100644 --- a/cmd/helm/get.go +++ b/cmd/helm/get.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/get_hooks.go b/cmd/helm/get_hooks.go index 1b6f2f8fe..9192db998 100644 --- a/cmd/helm/get_hooks.go +++ b/cmd/helm/get_hooks.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/get_hooks_test.go b/cmd/helm/get_hooks_test.go index e578c2533..fe9133feb 100644 --- a/cmd/helm/get_hooks_test.go +++ b/cmd/helm/get_hooks_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/get_manifest.go b/cmd/helm/get_manifest.go index c01febfb4..f4ae11e58 100644 --- a/cmd/helm/get_manifest.go +++ b/cmd/helm/get_manifest.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/get_manifest_test.go b/cmd/helm/get_manifest_test.go index 286b5628a..c95a1f265 100644 --- a/cmd/helm/get_manifest_test.go +++ b/cmd/helm/get_manifest_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/get_test.go b/cmd/helm/get_test.go index a6e72987a..cb230a8a5 100644 --- a/cmd/helm/get_test.go +++ b/cmd/helm/get_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/get_values.go b/cmd/helm/get_values.go index b6ce648e5..12a48f1da 100644 --- a/cmd/helm/get_values.go +++ b/cmd/helm/get_values.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/get_values_test.go b/cmd/helm/get_values_test.go index 30b2ba4b8..35c84f2ec 100644 --- a/cmd/helm/get_values_test.go +++ b/cmd/helm/get_values_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/helm.go b/cmd/helm/helm.go index 4c7ca9290..8607129e4 100644 --- a/cmd/helm/helm.go +++ b/cmd/helm/helm.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -158,7 +158,12 @@ func init() { func main() { cmd := newRootCmd(os.Args[1:]) if err := cmd.Execute(); err != nil { - os.Exit(1) + switch e := err.(type) { + case pluginError: + os.Exit(e.code) + default: + os.Exit(1) + } } } @@ -169,7 +174,7 @@ func markDeprecated(cmd *cobra.Command, notice string) *cobra.Command { func setupConnection() error { if settings.TillerHost == "" { - config, client, err := getKubeClient(settings.KubeContext) + config, client, err := getKubeClient(settings.KubeContext, settings.KubeConfig) if err != nil { return err } @@ -223,8 +228,8 @@ func prettyError(err error) error { } // configForContext creates a Kubernetes REST client configuration for a given kubeconfig context. -func configForContext(context string) (*rest.Config, error) { - config, err := kube.GetConfig(context).ClientConfig() +func configForContext(context string, kubeconfig string) (*rest.Config, error) { + config, err := kube.GetConfig(context, kubeconfig).ClientConfig() if err != nil { return nil, fmt.Errorf("could not get Kubernetes config for context %q: %s", context, err) } @@ -232,8 +237,8 @@ func configForContext(context string) (*rest.Config, error) { } // getKubeClient creates a Kubernetes config and client for a given kubeconfig context. -func getKubeClient(context string) (*rest.Config, kubernetes.Interface, error) { - config, err := configForContext(context) +func getKubeClient(context string, kubeconfig string) (*rest.Config, kubernetes.Interface, error) { + config, err := configForContext(context, kubeconfig) if err != nil { return nil, nil, err } @@ -247,8 +252,8 @@ func getKubeClient(context string) (*rest.Config, kubernetes.Interface, error) { // getInternalKubeClient creates a Kubernetes config and an "internal" client for a given kubeconfig context. // // Prefer the similar getKubeClient if you don't need to use such an internal client. -func getInternalKubeClient(context string) (internalclientset.Interface, error) { - config, err := configForContext(context) +func getInternalKubeClient(context string, kubeconfig string) (internalclientset.Interface, error) { + config, err := configForContext(context, kubeconfig) if err != nil { return nil, err } diff --git a/cmd/helm/helm_test.go b/cmd/helm/helm_test.go index 79b8c16f2..c872af8c3 100644 --- a/cmd/helm/helm_test.go +++ b/cmd/helm/helm_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/history.go b/cmd/helm/history.go index e6366d31d..6e0b48d33 100644 --- a/cmd/helm/history.go +++ b/cmd/helm/history.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/history_test.go b/cmd/helm/history_test.go index fef433742..5d5146228 100644 --- a/cmd/helm/history_test.go +++ b/cmd/helm/history_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/home.go b/cmd/helm/home.go index e96edd7a1..ca21088a7 100644 --- a/cmd/helm/home.go +++ b/cmd/helm/home.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/init.go b/cmd/helm/init.go index d368945ec..138fa14d7 100644 --- a/cmd/helm/init.go +++ b/cmd/helm/init.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -181,95 +181,64 @@ func (i *initCmd) run() error { i.opts.MaxHistory = i.maxHistory i.opts.Replicas = i.replicas - writeYAMLManifest := func(apiVersion, kind, body string, first, last bool) error { + writeYAMLManifests := func(manifests []string) error { w := i.out - if !first { - // YAML starting document boundary marker + for _, manifest := range manifests { if _, err := fmt.Fprintln(w, "---"); err != nil { return err } + + if _, err := fmt.Fprintln(w, manifest); err != nil { + return err + } } - if _, err := fmt.Fprintln(w, "apiVersion:", apiVersion); err != nil { - return err - } - if _, err := fmt.Fprintln(w, "kind:", kind); err != nil { - return err - } - if _, err := fmt.Fprint(w, body); err != nil { - return err - } - if !last { - return nil - } + // YAML ending document boundary marker _, err := fmt.Fprintln(w, "...") return err } if len(i.opts.Output) > 0 { - var body string + var manifests []string var err error - const tm = `{"apiVersion":"extensions/v1beta1","kind":"Deployment",` - if body, err = installer.DeploymentManifest(&i.opts); err != nil { + if manifests, err = installer.TillerManifests(&i.opts); err != nil { return err } switch i.opts.Output.String() { case "json": - var out bytes.Buffer - jsonb, err := yaml.ToJSON([]byte(body)) - if err != nil { - return err - } - buf := bytes.NewBuffer(make([]byte, 0, len(tm)+len(jsonb)-1)) - buf.WriteString(tm) - // Drop the opening object delimiter ('{'). - buf.Write(jsonb[1:]) - if err := json.Indent(&out, buf.Bytes(), "", " "); err != nil { - return err - } - if _, err = i.out.Write(out.Bytes()); err != nil { - return err + for _, manifest := range manifests { + var out bytes.Buffer + jsonb, err := yaml.ToJSON([]byte(manifest)) + if err != nil { + return err + } + buf := bytes.NewBuffer(jsonb) + if err := json.Indent(&out, buf.Bytes(), "", " "); err != nil { + return err + } + if _, err = i.out.Write(out.Bytes()); err != nil { + return err + } + fmt.Fprint(i.out, "\n") } - return nil case "yaml": - if err := writeYAMLManifest("extensions/v1beta1", "Deployment", body, true, false); err != nil { - return err - } - return nil + return writeYAMLManifests(manifests) default: return fmt.Errorf("unknown output format: %q", i.opts.Output) } } if settings.Debug { - - var body string + var manifests []string var err error - // write Deployment manifest - if body, err = installer.DeploymentManifest(&i.opts); err != nil { - return err - } - if err := writeYAMLManifest("extensions/v1beta1", "Deployment", body, true, false); err != nil { + // write Tiller manifests + if manifests, err = installer.TillerManifests(&i.opts); err != nil { return err } - // write Service manifest - if body, err = installer.ServiceManifest(i.namespace); err != nil { - return err - } - if err := writeYAMLManifest("v1", "Service", body, false, !i.opts.EnableTLS); err != nil { + if err = writeYAMLManifests(manifests); err != nil { return err } - - // write Secret manifest - if i.opts.EnableTLS { - if body, err = installer.SecretManifest(&i.opts); err != nil { - return err - } - if err := writeYAMLManifest("v1", "Secret", body, false, true); err != nil { - return err - } - } } if i.dryRun { @@ -289,7 +258,7 @@ func (i *initCmd) run() error { if !i.clientOnly { if i.kubeClient == nil { - _, c, err := getKubeClient(settings.KubeContext) + _, c, err := getKubeClient(settings.KubeContext, settings.KubeConfig) if err != nil { return fmt.Errorf("could not get kubernetes client: %s", err) } @@ -312,9 +281,12 @@ func (i *initCmd) run() error { "(Use --client-only to suppress this message, or --upgrade to upgrade Tiller to the current version.)") } } else { - fmt.Fprintln(i.out, "\nTiller (the Helm server-side component) has been installed into your Kubernetes Cluster.\n\n"+ - "Please note: by default, Tiller is deployed with an insecure 'allow unauthenticated users' policy.\n"+ - "For more information on securing your installation see: https://docs.helm.sh/using_helm/#securing-your-helm-installation") + fmt.Fprintln(i.out, "\nTiller (the Helm server-side component) has been installed into your Kubernetes Cluster.") + if !tlsVerify { + fmt.Fprintln(i.out, "\nPlease note: by default, Tiller is deployed with an insecure 'allow unauthenticated users' policy.\n"+ + "To prevent this, run `helm init` with the --tiller-tls-verify flag.\n"+ + "For more information on securing your installation see: https://docs.helm.sh/using_helm/#securing-your-helm-installation") + } } if err := i.ping(); err != nil { return err @@ -329,7 +301,7 @@ func (i *initCmd) run() error { func (i *initCmd) ping() error { if i.wait { - _, kubeClient, err := getKubeClient(settings.KubeContext) + _, kubeClient, err := getKubeClient(settings.KubeContext, settings.KubeConfig) if err != nil { return err } diff --git a/cmd/helm/init_test.go b/cmd/helm/init_test.go index 6a5767fca..fd6ef97c4 100644 --- a/cmd/helm/init_test.go +++ b/cmd/helm/init_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ package main import ( "bytes" + "io" "io/ioutil" "os" "path/filepath" @@ -32,11 +33,10 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + yamlutil "k8s.io/apimachinery/pkg/util/yaml" "k8s.io/client-go/kubernetes/fake" testcore "k8s.io/client-go/testing" - "encoding/json" - "k8s.io/helm/cmd/helm/installer" "k8s.io/helm/pkg/helm/helmpath" ) @@ -306,7 +306,7 @@ func TestInitCmd_tlsOptions(t *testing.T) { } } -// TestInitCmd_output tests that init -o formats are unmarshal-able +// TestInitCmd_output tests that init -o can be decoded func TestInitCmd_output(t *testing.T) { // This is purely defensive in this case. home, err := ioutil.TempDir("", "helm_home") @@ -320,26 +320,14 @@ func TestInitCmd_output(t *testing.T) { settings.Debug = dbg }() fc := fake.NewSimpleClientset() - tests := []struct { - expectF func([]byte, interface{}) error - expectName string - }{ - { - json.Unmarshal, - "json", - }, - { - yaml.Unmarshal, - "yaml", - }, - } + tests := []string{"json", "yaml"} for _, s := range tests { var buf bytes.Buffer cmd := &initCmd{ out: &buf, home: helmpath.Home(home), kubeClient: fc, - opts: installer.Options{Output: installer.OutputFormat(s.expectName)}, + opts: installer.Options{Output: installer.OutputFormat(s)}, namespace: v1.NamespaceDefault, } if err := cmd.run(); err != nil { @@ -348,10 +336,17 @@ func TestInitCmd_output(t *testing.T) { if got := len(fc.Actions()); got != 0 { t.Errorf("expected no server calls, got %d", got) } - d := &v1beta1.Deployment{} - if err = s.expectF(buf.Bytes(), &d); err != nil { - t.Errorf("error unmarshalling init %s output %s %s", s.expectName, err, buf.String()) + + var obj interface{} + decoder := yamlutil.NewYAMLOrJSONDecoder(&buf, 4096) + for { + err := decoder.Decode(&obj) + if err != nil { + if err == io.EOF { + break + } + t.Errorf("error decoding init %s output %s %s", s, err, buf.String()) + } } } - } diff --git a/cmd/helm/init_unix.go b/cmd/helm/init_unix.go index 1117dd487..bf61f1925 100644 --- a/cmd/helm/init_unix.go +++ b/cmd/helm/init_unix.go @@ -1,7 +1,7 @@ // +build !windows /* -Copyright 2017 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/init_windows.go b/cmd/helm/init_windows.go index be17bccda..447044bba 100644 --- a/cmd/helm/init_windows.go +++ b/cmd/helm/init_windows.go @@ -1,7 +1,7 @@ // +build windows /* -Copyright 2017 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/inspect.go b/cmd/helm/inspect.go index 999856959..c1861f7c5 100644 --- a/cmd/helm/inspect.go +++ b/cmd/helm/inspect.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/inspect_test.go b/cmd/helm/inspect_test.go index 44d71fbbd..b9dbf2ab6 100644 --- a/cmd/helm/inspect_test.go +++ b/cmd/helm/inspect_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/install.go b/cmd/helm/install.go index d1c24c213..1488b87c5 100644 --- a/cmd/helm/install.go +++ b/cmd/helm/install.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -50,8 +50,10 @@ The install argument must be a chart reference, a path to a packaged chart, a path to an unpacked chart directory or a URL. To override values in a chart, use either the '--values' flag and pass in a file -or use the '--set' flag and pass configuration from the command line, to force -a string value use '--set-string'. +or use the '--set' flag and pass configuration from the command line. To force string +values in '--set', use '--set-string' instead. In case a value is large and therefore +you want not to use neither '--values' nor '--set', use '--set-file' to read the +single large value from file. $ helm install -f myvalues.yaml ./redis @@ -63,6 +65,9 @@ or $ helm install --set-string long_int=1234567890 ./redis +or + $ helm install --set-file multiline_text=path/to/textfile + You can specify the '--values'/'-f' flag multiple times. The priority will be given to the last (right-most) file specified. For example, if both myvalues.yaml and override.yaml contained a key called 'Test', the value set in override.yaml would take precedence: @@ -120,6 +125,7 @@ type installCmd struct { client helm.Interface values []string stringValues []string + fileValues []string nameTemplate string version string timeout int64 @@ -129,6 +135,7 @@ type installCmd struct { password string devel bool depUp bool + description string certFile string keyFile string @@ -195,6 +202,7 @@ func newInstallCmd(c helm.Interface, out io.Writer) *cobra.Command { f.BoolVar(&inst.replace, "replace", false, "re-use the given name, even if that name is already used. This is unsafe in production") f.StringArrayVar(&inst.values, "set", []string{}, "set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)") f.StringArrayVar(&inst.stringValues, "set-string", []string{}, "set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)") + f.StringArrayVar(&inst.fileValues, "set-file", []string{}, "set values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)") f.StringVar(&inst.nameTemplate, "name-template", "", "specify template used to name the release") f.BoolVar(&inst.verify, "verify", false, "verify the package before installing it") f.StringVar(&inst.keyring, "keyring", defaultKeyring(), "location of public keys used for verification") @@ -209,6 +217,7 @@ func newInstallCmd(c helm.Interface, out io.Writer) *cobra.Command { f.StringVar(&inst.caFile, "ca-file", "", "verify certificates of HTTPS-enabled servers using this CA bundle") f.BoolVar(&inst.devel, "devel", false, "use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored.") f.BoolVar(&inst.depUp, "dep-up", false, "run helm dependency update before installing the chart") + f.StringVar(&inst.description, "description", "", "specify a description for the release") return cmd } @@ -220,7 +229,7 @@ func (i *installCmd) run() error { i.namespace = defaultNamespace() } - rawVals, err := vals(i.valueFiles, i.values, i.stringValues, i.certFile, i.keyFile, i.caFile) + rawVals, err := vals(i.valueFiles, i.values, i.stringValues, i.fileValues, i.certFile, i.keyFile, i.caFile) if err != nil { return err } @@ -258,6 +267,12 @@ func (i *installCmd) run() error { if err := man.Update(); err != nil { return prettyError(err) } + + // Update all dependencies which are present in /charts. + chartRequested, err = chartutil.Load(i.chartPath) + if err != nil { + return prettyError(err) + } } else { return prettyError(err) } @@ -277,7 +292,8 @@ func (i *installCmd) run() error { helm.InstallDisableHooks(i.disableHooks), helm.InstallDisableCRDHook(i.disableCRDHook), helm.InstallTimeout(i.timeout), - helm.InstallWait(i.wait)) + helm.InstallWait(i.wait), + helm.InstallDescription(i.description)) if err != nil { return prettyError(err) } @@ -334,8 +350,8 @@ func mergeValues(dest map[string]interface{}, src map[string]interface{}) map[st } // vals merges values from files specified via -f/--values and -// directly via --set or --set-string, marshaling them to YAML -func vals(valueFiles valueFiles, values []string, stringValues []string, CertFile, KeyFile, CAFile string) ([]byte, error) { +// directly via --set or --set-string or --set-file, marshaling them to YAML +func vals(valueFiles valueFiles, values []string, stringValues []string, fileValues []string, CertFile, KeyFile, CAFile string) ([]byte, error) { base := map[string]interface{}{} // User specified a values files via -f/--values @@ -375,6 +391,17 @@ func vals(valueFiles valueFiles, values []string, stringValues []string, CertFil } } + // User specified a value via --set-file + for _, value := range fileValues { + reader := func(rs []rune) (interface{}, error) { + bytes, err := readFile(string(rs), CertFile, KeyFile, CAFile) + return string(bytes), err + } + if err := strvals.ParseIntoFile(value, base, reader); err != nil { + return []byte{}, fmt.Errorf("failed parsing --set-file data: %s", err) + } + } + return yaml.Marshal(base) } @@ -482,7 +509,7 @@ func generateName(nameTemplate string) (string, error) { } func defaultNamespace() string { - if ns, _, err := kube.GetConfig(settings.KubeContext).Namespace(); err == nil { + if ns, _, err := kube.GetConfig(settings.KubeContext, settings.KubeConfig).Namespace(); err == nil { return ns } return "default" diff --git a/cmd/helm/install_test.go b/cmd/helm/install_test.go index aa828c6ce..48d9fc8c1 100644 --- a/cmd/helm/install_test.go +++ b/cmd/helm/install_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -115,6 +115,13 @@ func TestInstall(t *testing.T) { expected: "FOOBAR", resp: helm.ReleaseMock(&helm.MockReleaseOptions{Name: "FOOBAR"}), }, + { + name: "install with custom description", + args: []string{"testdata/testcharts/alpine"}, + flags: []string{"--name", "virgil", "--description", "foobar"}, + expected: "virgil", + resp: helm.ReleaseMock(&helm.MockReleaseOptions{Name: "virgil", Description: "foobar"}), + }, // Install, perform chart verification along the way. { name: "install with verification, missing provenance", diff --git a/cmd/helm/installer/install.go b/cmd/helm/installer/install.go index becf412a1..055601440 100644 --- a/cmd/helm/installer/install.go +++ b/cmd/helm/installer/install.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -28,6 +28,7 @@ import ( "k8s.io/api/extensions/v1beta1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/client-go/kubernetes" corev1 "k8s.io/client-go/kubernetes/typed/core/v1" @@ -104,7 +105,7 @@ func semverCompare(image string) int { // createDeployment creates the Tiller Deployment resource. func createDeployment(client extensionsclient.DeploymentsGetter, opts *Options) error { - obj, err := deployment(opts) + obj, err := generateDeployment(opts) if err != nil { return err } @@ -113,40 +114,68 @@ func createDeployment(client extensionsclient.DeploymentsGetter, opts *Options) } -// deployment gets the deployment object that installs Tiller. -func deployment(opts *Options) (*v1beta1.Deployment, error) { - return generateDeployment(opts) +// Deployment gets a deployment object that can be used to generate a manifest +// as a string. This object should not be submitted directly to the Kubernetes +// api +func Deployment(opts *Options) (*v1beta1.Deployment, error) { + dep, err := generateDeployment(opts) + if err != nil { + return nil, err + } + dep.TypeMeta = metav1.TypeMeta{ + Kind: "Deployment", + APIVersion: "extensions/v1beta1", + } + return dep, nil } // createService creates the Tiller service resource func createService(client corev1.ServicesGetter, namespace string) error { - obj := service(namespace) + obj := generateService(namespace) _, err := client.Services(obj.Namespace).Create(obj) return err } -// service gets the service object that installs Tiller. -func service(namespace string) *v1.Service { - return generateService(namespace) +// Service gets a service object that can be used to generate a manifest as a +// string. This object should not be submitted directly to the Kubernetes api +func Service(namespace string) *v1.Service { + svc := generateService(namespace) + svc.TypeMeta = metav1.TypeMeta{ + Kind: "Service", + APIVersion: "v1", + } + return svc } -// DeploymentManifest gets the manifest (as a string) that describes the Tiller Deployment -// resource. -func DeploymentManifest(opts *Options) (string, error) { - obj, err := deployment(opts) +// TillerManifests gets the Deployment, Service, and Secret (if tls-enabled) manifests +func TillerManifests(opts *Options) ([]string, error) { + dep, err := Deployment(opts) if err != nil { - return "", err + return []string{}, err + } + + svc := Service(opts.Namespace) + + objs := []runtime.Object{dep, svc} + + if opts.EnableTLS { + secret, err := Secret(opts) + if err != nil { + return []string{}, err + } + objs = append(objs, secret) + } + + manifests := make([]string, len(objs)) + for i, obj := range objs { + o, err := yaml.Marshal(obj) + if err != nil { + return []string{}, err + } + manifests[i] = string(o) } - buf, err := yaml.Marshal(obj) - return string(buf), err -} -// ServiceManifest gets the manifest (as a string) that describes the Tiller Service -// resource. -func ServiceManifest(namespace string) (string, error) { - obj := service(namespace) - buf, err := yaml.Marshal(obj) - return string(buf), err + return manifests, err } func generateLabels(labels map[string]string) map[string]string { @@ -321,14 +350,20 @@ func generateService(namespace string) *v1.Service { return s } -// SecretManifest gets the manifest (as a string) that describes the Tiller Secret resource. -func SecretManifest(opts *Options) (string, error) { - o, err := generateSecret(opts) +// Secret gets a secret object that can be used to generate a manifest as a +// string. This object should not be submitted directly to the Kubernetes api +func Secret(opts *Options) (*v1.Secret, error) { + secret, err := generateSecret(opts) if err != nil { - return "", err + return nil, err + } + + secret.TypeMeta = metav1.TypeMeta{ + Kind: "Secret", + APIVersion: "v1", } - buf, err := yaml.Marshal(o) - return string(buf), err + + return secret, nil } // createSecret creates the Tiller secret resource. diff --git a/cmd/helm/installer/install_test.go b/cmd/helm/installer/install_test.go index dbb7143e3..d5f3dfec0 100644 --- a/cmd/helm/installer/install_test.go +++ b/cmd/helm/installer/install_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ import ( "k8s.io/helm/pkg/version" ) -func TestDeploymentManifest(t *testing.T) { +func TestDeployment(t *testing.T) { tests := []struct { name string image string @@ -48,14 +48,10 @@ func TestDeploymentManifest(t *testing.T) { } for _, tt := range tests { - o, err := DeploymentManifest(&Options{Namespace: v1.NamespaceDefault, ImageSpec: tt.image, UseCanary: tt.canary}) + dep, err := Deployment(&Options{Namespace: v1.NamespaceDefault, ImageSpec: tt.image, UseCanary: tt.canary}) if err != nil { t.Fatalf("%s: error %q", tt.name, err) } - var dep v1beta1.Deployment - if err := yaml.Unmarshal([]byte(o), &dep); err != nil { - t.Fatalf("%s: error %q", tt.name, err) - } if got := dep.Spec.Template.Spec.Containers[0].Image; got != tt.expect { t.Errorf("%s: expected image %q, got %q", tt.name, tt.expect, got) @@ -71,7 +67,7 @@ func TestDeploymentManifest(t *testing.T) { } } -func TestDeploymentManifestForServiceAccount(t *testing.T) { +func TestDeploymentForServiceAccount(t *testing.T) { tests := []struct { name string image string @@ -84,22 +80,18 @@ func TestDeploymentManifestForServiceAccount(t *testing.T) { {"withoutSA", "", false, "gcr.io/kubernetes-helm/tiller:latest", "IfNotPresent", ""}, } for _, tt := range tests { - o, err := DeploymentManifest(&Options{Namespace: v1.NamespaceDefault, ImageSpec: tt.image, UseCanary: tt.canary, ServiceAccount: tt.serviceAccount}) + d, err := Deployment(&Options{Namespace: v1.NamespaceDefault, ImageSpec: tt.image, UseCanary: tt.canary, ServiceAccount: tt.serviceAccount}) if err != nil { t.Fatalf("%s: error %q", tt.name, err) } - var d v1beta1.Deployment - if err := yaml.Unmarshal([]byte(o), &d); err != nil { - t.Fatalf("%s: error %q", tt.name, err) - } if got := d.Spec.Template.Spec.ServiceAccountName; got != tt.serviceAccount { t.Errorf("%s: expected service account value %q, got %q", tt.name, tt.serviceAccount, got) } } } -func TestDeploymentManifest_WithTLS(t *testing.T) { +func TestDeployment_WithTLS(t *testing.T) { tests := []struct { opts Options name string @@ -126,15 +118,11 @@ func TestDeploymentManifest_WithTLS(t *testing.T) { }, } for _, tt := range tests { - o, err := DeploymentManifest(&tt.opts) + d, err := Deployment(&tt.opts) if err != nil { t.Fatalf("%s: error %q", tt.name, err) } - var d v1beta1.Deployment - if err := yaml.Unmarshal([]byte(o), &d); err != nil { - t.Fatalf("%s: error %q", tt.name, err) - } // verify environment variable in deployment reflect the use of tls being enabled. if got := d.Spec.Template.Spec.Containers[0].Env[2].Value; got != tt.verify { t.Errorf("%s: expected tls verify env value %q, got %q", tt.name, tt.verify, got) @@ -146,14 +134,7 @@ func TestDeploymentManifest_WithTLS(t *testing.T) { } func TestServiceManifest(t *testing.T) { - o, err := ServiceManifest(v1.NamespaceDefault) - if err != nil { - t.Fatalf("error %q", err) - } - var svc v1.Service - if err := yaml.Unmarshal([]byte(o), &svc); err != nil { - t.Fatalf("error %q", err) - } + svc := Service(v1.NamespaceDefault) if got := svc.ObjectMeta.Namespace; got != v1.NamespaceDefault { t.Errorf("expected namespace %s, got %s", v1.NamespaceDefault, got) @@ -161,7 +142,7 @@ func TestServiceManifest(t *testing.T) { } func TestSecretManifest(t *testing.T) { - o, err := SecretManifest(&Options{ + obj, err := Secret(&Options{ VerifyTLS: true, EnableTLS: true, Namespace: v1.NamespaceDefault, @@ -174,11 +155,6 @@ func TestSecretManifest(t *testing.T) { t.Fatalf("error %q", err) } - var obj v1.Secret - if err := yaml.Unmarshal([]byte(o), &obj); err != nil { - t.Fatalf("error %q", err) - } - if got := obj.ObjectMeta.Namespace; got != v1.NamespaceDefault { t.Errorf("expected namespace %s, got %s", v1.NamespaceDefault, got) } @@ -362,13 +338,13 @@ func TestInstall_canary(t *testing.T) { func TestUpgrade(t *testing.T) { image := "gcr.io/kubernetes-helm/tiller:v2.0.0" serviceAccount := "newServiceAccount" - existingDeployment, _ := deployment(&Options{ + existingDeployment, _ := generateDeployment(&Options{ Namespace: v1.NamespaceDefault, ImageSpec: "imageToReplace:v1.0.0", ServiceAccount: "serviceAccountToReplace", UseCanary: false, }) - existingService := service(v1.NamespaceDefault) + existingService := generateService(v1.NamespaceDefault) fc := &fake.Clientset{} fc.AddReactor("get", "deployments", func(action testcore.Action) (bool, runtime.Object, error) { @@ -403,7 +379,7 @@ func TestUpgrade(t *testing.T) { func TestUpgrade_serviceNotFound(t *testing.T) { image := "gcr.io/kubernetes-helm/tiller:v2.0.0" - existingDeployment, _ := deployment(&Options{ + existingDeployment, _ := generateDeployment(&Options{ Namespace: v1.NamespaceDefault, ImageSpec: "imageToReplace", UseCanary: false, @@ -446,13 +422,13 @@ func TestUpgrade_serviceNotFound(t *testing.T) { func TestUgrade_newerVersion(t *testing.T) { image := "gcr.io/kubernetes-helm/tiller:v2.0.0" serviceAccount := "newServiceAccount" - existingDeployment, _ := deployment(&Options{ + existingDeployment, _ := generateDeployment(&Options{ Namespace: v1.NamespaceDefault, ImageSpec: "imageToReplace:v100.5.0", ServiceAccount: "serviceAccountToReplace", UseCanary: false, }) - existingService := service(v1.NamespaceDefault) + existingService := generateService(v1.NamespaceDefault) fc := &fake.Clientset{} fc.AddReactor("get", "deployments", func(action testcore.Action) (bool, runtime.Object, error) { @@ -506,13 +482,13 @@ func TestUgrade_newerVersion(t *testing.T) { func TestUpgrade_identical(t *testing.T) { image := "gcr.io/kubernetes-helm/tiller:v2.0.0" serviceAccount := "newServiceAccount" - existingDeployment, _ := deployment(&Options{ + existingDeployment, _ := generateDeployment(&Options{ Namespace: v1.NamespaceDefault, ImageSpec: "imageToReplace:v2.0.0", ServiceAccount: "serviceAccountToReplace", UseCanary: false, }) - existingService := service(v1.NamespaceDefault) + existingService := generateService(v1.NamespaceDefault) fc := &fake.Clientset{} fc.AddReactor("get", "deployments", func(action testcore.Action) (bool, runtime.Object, error) { @@ -547,13 +523,13 @@ func TestUpgrade_identical(t *testing.T) { func TestUpgrade_canaryClient(t *testing.T) { image := "gcr.io/kubernetes-helm/tiller:canary" serviceAccount := "newServiceAccount" - existingDeployment, _ := deployment(&Options{ + existingDeployment, _ := generateDeployment(&Options{ Namespace: v1.NamespaceDefault, ImageSpec: "imageToReplace:v1.0.0", ServiceAccount: "serviceAccountToReplace", UseCanary: false, }) - existingService := service(v1.NamespaceDefault) + existingService := generateService(v1.NamespaceDefault) fc := &fake.Clientset{} fc.AddReactor("get", "deployments", func(action testcore.Action) (bool, runtime.Object, error) { @@ -588,13 +564,13 @@ func TestUpgrade_canaryClient(t *testing.T) { func TestUpgrade_canaryServer(t *testing.T) { image := "gcr.io/kubernetes-helm/tiller:v2.0.0" serviceAccount := "newServiceAccount" - existingDeployment, _ := deployment(&Options{ + existingDeployment, _ := generateDeployment(&Options{ Namespace: v1.NamespaceDefault, ImageSpec: "imageToReplace:canary", ServiceAccount: "serviceAccountToReplace", UseCanary: false, }) - existingService := service(v1.NamespaceDefault) + existingService := generateService(v1.NamespaceDefault) fc := &fake.Clientset{} fc.AddReactor("get", "deployments", func(action testcore.Action) (bool, runtime.Object, error) { @@ -634,7 +610,8 @@ func tlsTestFile(t *testing.T, path string) string { } return path } -func TestDeploymentManifest_WithNodeSelectors(t *testing.T) { + +func TestDeployment_WithNodeSelectors(t *testing.T) { tests := []struct { opts Options name string @@ -658,15 +635,11 @@ func TestDeploymentManifest_WithNodeSelectors(t *testing.T) { }, } for _, tt := range tests { - o, err := DeploymentManifest(&tt.opts) + d, err := Deployment(&tt.opts) if err != nil { t.Fatalf("%s: error %q", tt.name, err) } - var d v1beta1.Deployment - if err := yaml.Unmarshal([]byte(o), &d); err != nil { - t.Fatalf("%s: error %q", tt.name, err) - } // Verify that environment variables in Deployment reflect the use of TLS being enabled. got := d.Spec.Template.Spec.NodeSelector for k, v := range tt.expect { @@ -676,7 +649,8 @@ func TestDeploymentManifest_WithNodeSelectors(t *testing.T) { } } } -func TestDeploymentManifest_WithSetValues(t *testing.T) { + +func TestDeployment_WithSetValues(t *testing.T) { tests := []struct { opts Options name string @@ -703,11 +677,17 @@ func TestDeploymentManifest_WithSetValues(t *testing.T) { }, } for _, tt := range tests { - o, err := DeploymentManifest(&tt.opts) + d, err := Deployment(&tt.opts) if err != nil { t.Fatalf("%s: error %q", tt.name, err) } - values, err := chartutil.ReadValues([]byte(o)) + + o, err := yaml.Marshal(d) + if err != nil { + t.Errorf("Error marshaling Deployment: %s", err) + } + + values, err := chartutil.ReadValues(o) if err != nil { t.Errorf("Error converting Deployment manifest to Values: %s", err) } diff --git a/cmd/helm/installer/options.go b/cmd/helm/installer/options.go index 13cf43dcc..95aa3988d 100644 --- a/cmd/helm/installer/options.go +++ b/cmd/helm/installer/options.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ type Options struct { // Force allows to force upgrading tiller if deployed version is greater than current version ForceUpgrade bool - // ImageSpec indentifies the image Tiller will use when deployed. + // ImageSpec identifies the image Tiller will use when deployed. // // Valid if and only if UseCanary is false. ImageSpec string diff --git a/cmd/helm/installer/uninstall.go b/cmd/helm/installer/uninstall.go index 818827ddb..14735ea85 100644 --- a/cmd/helm/installer/uninstall.go +++ b/cmd/helm/installer/uninstall.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/installer/uninstall_test.go b/cmd/helm/installer/uninstall_test.go index 91b257d47..195b209bc 100644 --- a/cmd/helm/installer/uninstall_test.go +++ b/cmd/helm/installer/uninstall_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/lint.go b/cmd/helm/lint.go index 63f11c062..d0159d34b 100644 --- a/cmd/helm/lint.go +++ b/cmd/helm/lint.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -47,6 +47,7 @@ type lintCmd struct { valueFiles valueFiles values []string sValues []string + fValues []string namespace string strict bool paths []string @@ -73,7 +74,8 @@ func newLintCmd(out io.Writer) *cobra.Command { cmd.Flags().VarP(&l.valueFiles, "values", "f", "specify values in a YAML file (can specify multiple)") cmd.Flags().StringArrayVar(&l.values, "set", []string{}, "set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)") cmd.Flags().StringArrayVar(&l.sValues, "set-string", []string{}, "set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)") - cmd.Flags().StringVar(&l.namespace, "namespace", "default", "namespace to install the release into (only used if --install is set)") + cmd.Flags().StringArrayVar(&l.fValues, "set-file", []string{}, "set values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)") + cmd.Flags().StringVar(&l.namespace, "namespace", "default", "namespace to put the release into") cmd.Flags().BoolVar(&l.strict, "strict", false, "fail on lint warnings") return cmd @@ -172,6 +174,12 @@ func lintChart(path string, vals []byte, namespace string, strict bool) (support return lint.All(chartPath, vals, namespace, strict), nil } +// vals merges values from files specified via -f/--values and +// directly via --set or --set-string or --set-file, marshaling them to YAML +// +// This func is implemented intentionally and separately from the `vals` func for the `install` and `upgrade` comammdsn. +// Compared to the alternative func, this func lacks the parameters for tls opts - ca key, cert, and ca cert. +// That's because this command, `lint`, is explicitly forbidden from making server connections. func (l *lintCmd) vals() ([]byte, error) { base := map[string]interface{}{} @@ -204,5 +212,16 @@ func (l *lintCmd) vals() ([]byte, error) { } } + // User specified a value via --set-file + for _, value := range l.fValues { + reader := func(rs []rune) (interface{}, error) { + bytes, err := ioutil.ReadFile(string(rs)) + return string(bytes), err + } + if err := strvals.ParseIntoFile(value, base, reader); err != nil { + return []byte{}, fmt.Errorf("failed parsing --set-file data: %s", err) + } + } + return yaml.Marshal(base) } diff --git a/cmd/helm/lint_test.go b/cmd/helm/lint_test.go index 973af9b63..67775893b 100644 --- a/cmd/helm/lint_test.go +++ b/cmd/helm/lint_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/list.go b/cmd/helm/list.go index c2633d21c..ed70702d5 100644 --- a/cmd/helm/list.go +++ b/cmd/helm/list.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -17,10 +17,12 @@ limitations under the License. package main import ( + "encoding/json" "fmt" "io" "strings" + "github.com/ghodss/yaml" "github.com/gosuri/uitable" "github.com/spf13/cobra" @@ -75,6 +77,22 @@ type listCmd struct { pending bool client helm.Interface colWidth uint + output string +} + +type listResult struct { + Next string + Releases []listRelease +} + +type listRelease struct { + Name string + Revision int32 + Updated string + Status string + Chart string + AppVersion string + Namespace string } func newListCmd(client helm.Interface, out io.Writer) *cobra.Command { @@ -114,6 +132,7 @@ func newListCmd(client helm.Interface, out io.Writer) *cobra.Command { f.BoolVar(&list.pending, "pending", false, "show pending releases") f.StringVar(&list.namespace, "namespace", "", "show releases within a specific namespace") f.UintVar(&list.colWidth, "col-width", 60, "specifies the max column width of output") + f.StringVar(&list.output, "output", "", "output the specified format (json or yaml)") // TODO: Do we want this as a feature of 'helm list'? //f.BoolVar(&list.superseded, "history", true, "show historical releases") @@ -147,24 +166,21 @@ func (l *listCmd) run() error { if err != nil { return prettyError(err) } - - if len(res.GetReleases()) == 0 { + if res == nil { return nil } - if res.Next != "" && !l.short { - fmt.Fprintf(l.out, "\tnext: %s\n", res.Next) - } + rels := filterList(res.GetReleases()) - rels := filterList(res.Releases) + result := getListResult(rels, res.Next) - if l.short { - for _, r := range rels { - fmt.Fprintln(l.out, r.Name) - } - return nil + output, err := formatResult(l.output, l.short, result, l.colWidth) + + if err != nil { + return prettyError(err) } - fmt.Fprintln(l.out, formatList(rels, l.colWidth)) + + fmt.Fprintln(l.out, output) return nil } @@ -233,23 +249,98 @@ func (l *listCmd) statusCodes() []release.Status_Code { return status } -func formatList(rels []*release.Release, colWidth uint) string { - table := uitable.New() - - table.MaxColWidth = colWidth - table.AddRow("NAME", "REVISION", "UPDATED", "STATUS", "CHART", "APP VERSION", "NAMESPACE") +func getListResult(rels []*release.Release, next string) listResult { + listReleases := []listRelease{} for _, r := range rels { md := r.GetChart().GetMetadata() - c := fmt.Sprintf("%s-%s", md.GetName(), md.GetVersion()) t := "-" if tspb := r.GetInfo().GetLastDeployed(); tspb != nil { t = timeconv.String(tspb) } - s := r.GetInfo().GetStatus().GetCode().String() - v := r.GetVersion() - a := md.GetAppVersion() - n := r.GetNamespace() - table.AddRow(r.GetName(), v, t, s, c, a, n) + + lr := listRelease{ + Name: r.GetName(), + Revision: r.GetVersion(), + Updated: t, + Status: r.GetInfo().GetStatus().GetCode().String(), + Chart: fmt.Sprintf("%s-%s", md.GetName(), md.GetVersion()), + AppVersion: md.GetAppVersion(), + Namespace: r.GetNamespace(), + } + listReleases = append(listReleases, lr) + } + + return listResult{ + Releases: listReleases, + Next: next, } - return table.String() +} + +func shortenListResult(result listResult) []string { + names := []string{} + for _, r := range result.Releases { + names = append(names, r.Name) + } + + return names +} + +func formatResult(format string, short bool, result listResult, colWidth uint) (string, error) { + var output string + var err error + + var shortResult []string + var finalResult interface{} + if short { + shortResult = shortenListResult(result) + finalResult = shortResult + } else { + finalResult = result + } + + switch format { + case "": + if short { + output = formatTextShort(shortResult) + } else { + output = formatText(result, colWidth) + } + case "json": + o, e := json.Marshal(finalResult) + if e != nil { + err = fmt.Errorf("Failed to Marshal JSON output: %s", e) + } else { + output = string(o) + } + case "yaml": + o, e := yaml.Marshal(finalResult) + if e != nil { + err = fmt.Errorf("Failed to Marshal YAML output: %s", e) + } else { + output = string(o) + } + default: + err = fmt.Errorf("Unknown output format \"%s\"", format) + } + return output, err +} + +func formatText(result listResult, colWidth uint) string { + nextOutput := "" + if result.Next != "" { + nextOutput = fmt.Sprintf("\tnext: %s\n", result.Next) + } + + table := uitable.New() + table.MaxColWidth = colWidth + table.AddRow("NAME", "REVISION", "UPDATED", "STATUS", "CHART", "APP VERSION", "NAMESPACE") + for _, lr := range result.Releases { + table.AddRow(lr.Name, lr.Revision, lr.Updated, lr.Status, lr.Chart, lr.AppVersion, lr.Namespace) + } + + return fmt.Sprintf("%s%s", nextOutput, table.String()) +} + +func formatTextShort(shortResult []string) string { + return strings.Join(shortResult, "\n") } diff --git a/cmd/helm/list_test.go b/cmd/helm/list_test.go index e292b4b5a..934f10712 100644 --- a/cmd/helm/list_test.go +++ b/cmd/helm/list_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,16 +18,18 @@ package main import ( "io" + "regexp" "testing" "github.com/spf13/cobra" "io/ioutil" + "os" + "k8s.io/helm/pkg/chartutil" "k8s.io/helm/pkg/helm" "k8s.io/helm/pkg/proto/hapi/chart" "k8s.io/helm/pkg/proto/hapi/release" - "os" ) func TestListCmd(t *testing.T) { @@ -46,6 +48,11 @@ func TestListCmd(t *testing.T) { ch, _ := chartutil.Load(chartPath) tests := []releaseCase{ + { + name: "empty", + rels: []*release.Release{}, + expected: "", + }, { name: "with a release", rels: []*release.Release{ @@ -67,6 +74,77 @@ func TestListCmd(t *testing.T) { }, expected: "NAME \tREVISION\tUPDATED \tSTATUS \tCHART \tAPP VERSION\tNAMESPACE\natlas\t1 \t(.*)\tDEPLOYED\tfoo-0.1.0-beta.1\t2.X.A \tdefault \n", }, + { + name: "with json output", + flags: []string{"--max", "1", "--output", "json"}, + rels: []*release.Release{ + helm.ReleaseMock(&helm.MockReleaseOptions{Name: "thomas-guide"}), + helm.ReleaseMock(&helm.MockReleaseOptions{Name: "atlas-guide"}), + }, + expected: regexp.QuoteMeta(`{"Next":"atlas-guide","Releases":[{"Name":"thomas-guide","Revision":1,"Updated":"`) + `([^"]*)` + regexp.QuoteMeta(`","Status":"DEPLOYED","Chart":"foo-0.1.0-beta.1","AppVersion":"","Namespace":"default"}]} +`), + }, + { + name: "with yaml output", + flags: []string{"--max", "1", "--output", "yaml"}, + rels: []*release.Release{ + helm.ReleaseMock(&helm.MockReleaseOptions{Name: "thomas-guide"}), + helm.ReleaseMock(&helm.MockReleaseOptions{Name: "atlas-guide"}), + }, + expected: regexp.QuoteMeta(`Next: atlas-guide +Releases: +- AppVersion: "" + Chart: foo-0.1.0-beta.1 + Name: thomas-guide + Namespace: default + Revision: 1 + Status: DEPLOYED + Updated: `) + `(.*)` + ` + +`, + }, + { + name: "with short json output", + flags: []string{"-q", "--output", "json"}, + rels: []*release.Release{ + helm.ReleaseMock(&helm.MockReleaseOptions{Name: "atlas"}), + }, + expected: regexp.QuoteMeta(`["atlas"] +`), + }, + { + name: "with short yaml output", + flags: []string{"-q", "--output", "yaml"}, + rels: []*release.Release{ + helm.ReleaseMock(&helm.MockReleaseOptions{Name: "atlas"}), + }, + expected: regexp.QuoteMeta(`- atlas + +`), + }, + { + name: "with json output without next", + flags: []string{"--output", "json"}, + rels: []*release.Release{}, + expected: regexp.QuoteMeta(`{"Next":"","Releases":[]} +`), + }, + { + name: "with yaml output without next", + flags: []string{"--output", "yaml"}, + rels: []*release.Release{}, + expected: regexp.QuoteMeta(`Next: "" +Releases: [] + +`), + }, + { + name: "with unknown output format", + flags: []string{"--output", "_unknown_"}, + rels: []*release.Release{}, + err: true, + expected: regexp.QuoteMeta(``), + }, { name: "list, one deployed, one failed", flags: []string{"-q"}, diff --git a/cmd/helm/load_plugins.go b/cmd/helm/load_plugins.go index f4c97bde7..158a69c88 100644 --- a/cmd/helm/load_plugins.go +++ b/cmd/helm/load_plugins.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -22,12 +22,18 @@ import ( "os/exec" "path/filepath" "strings" + "syscall" "github.com/spf13/cobra" "k8s.io/helm/pkg/plugin" ) +type pluginError struct { + error + code int +} + // loadPlugins loads plugins into the command list. // // This follows a different pattern than the other commands because it has @@ -87,7 +93,11 @@ func loadPlugins(baseCmd *cobra.Command, out io.Writer) { if err := prog.Run(); err != nil { if eerr, ok := err.(*exec.ExitError); ok { os.Stderr.Write(eerr.Stderr) - return fmt.Errorf("plugin %q exited with error", md.Name) + status := eerr.Sys().(syscall.WaitStatus) + return pluginError{ + error: fmt.Errorf("plugin %q exited with error", md.Name), + code: status.ExitStatus(), + } } return err } diff --git a/cmd/helm/package.go b/cmd/helm/package.go index ed44382c7..81603e67b 100644 --- a/cmd/helm/package.go +++ b/cmd/helm/package.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/package_test.go b/cmd/helm/package_test.go index 4404586e0..7ed9829a5 100644 --- a/cmd/helm/package_test.go +++ b/cmd/helm/package_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/cmd/helm/plugin.go b/cmd/helm/plugin.go index cf0b02f09..fbdd1245b 100644 --- a/cmd/helm/plugin.go +++ b/cmd/helm/plugin.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/cmd/helm/plugin_install.go b/cmd/helm/plugin_install.go index f36178808..7d77be3fc 100644 --- a/cmd/helm/plugin_install.go +++ b/cmd/helm/plugin_install.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/cmd/helm/plugin_list.go b/cmd/helm/plugin_list.go index e7618f38a..9693baaa2 100644 --- a/cmd/helm/plugin_list.go +++ b/cmd/helm/plugin_list.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/cmd/helm/plugin_remove.go b/cmd/helm/plugin_remove.go index ec1154734..f30e5b516 100644 --- a/cmd/helm/plugin_remove.go +++ b/cmd/helm/plugin_remove.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/cmd/helm/plugin_test.go b/cmd/helm/plugin_test.go index 2a4a0e9aa..2d06c3797 100644 --- a/cmd/helm/plugin_test.go +++ b/cmd/helm/plugin_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/cmd/helm/plugin_update.go b/cmd/helm/plugin_update.go index d3778764d..f9d5a3fac 100644 --- a/cmd/helm/plugin_update.go +++ b/cmd/helm/plugin_update.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/cmd/helm/printer.go b/cmd/helm/printer.go index ebb24bf7d..e98b71c64 100644 --- a/cmd/helm/printer.go +++ b/cmd/helm/printer.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/release_testing.go b/cmd/helm/release_testing.go index bdfa87a60..0c9debb3f 100644 --- a/cmd/helm/release_testing.go +++ b/cmd/helm/release_testing.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/release_testing_test.go b/cmd/helm/release_testing_test.go index b946746d0..f4f64c16d 100644 --- a/cmd/helm/release_testing_test.go +++ b/cmd/helm/release_testing_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/repo.go b/cmd/helm/repo.go index 8acc762e2..9f1dc8928 100644 --- a/cmd/helm/repo.go +++ b/cmd/helm/repo.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/repo_add.go b/cmd/helm/repo_add.go index 77a64cc89..906a9aef4 100644 --- a/cmd/helm/repo_add.go +++ b/cmd/helm/repo_add.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/repo_add_test.go b/cmd/helm/repo_add_test.go index 157b1cc5b..5a458cef7 100644 --- a/cmd/helm/repo_add_test.go +++ b/cmd/helm/repo_add_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/repo_index.go b/cmd/helm/repo_index.go index 540057eb8..b3f49fb97 100644 --- a/cmd/helm/repo_index.go +++ b/cmd/helm/repo_index.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -91,7 +91,7 @@ func index(dir, url, mergeTo string) error { var i2 *repo.IndexFile if _, err := os.Stat(mergeTo); os.IsNotExist(err) { i2 = repo.NewIndexFile() - i2.WriteFile(mergeTo, 0755) + i2.WriteFile(mergeTo, 0644) } else { i2, err = repo.LoadIndexFile(mergeTo) if err != nil { @@ -101,5 +101,5 @@ func index(dir, url, mergeTo string) error { i.Merge(i2) } i.SortEntries() - return i.WriteFile(out, 0755) + return i.WriteFile(out, 0644) } diff --git a/cmd/helm/repo_index_test.go b/cmd/helm/repo_index_test.go index 4d6313f6c..0d5571ef7 100644 --- a/cmd/helm/repo_index_test.go +++ b/cmd/helm/repo_index_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/repo_list.go b/cmd/helm/repo_list.go index 0f795b2b0..36887c69b 100644 --- a/cmd/helm/repo_list.go +++ b/cmd/helm/repo_list.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/repo_remove.go b/cmd/helm/repo_remove.go index 728852fa1..f13b8dadb 100644 --- a/cmd/helm/repo_remove.go +++ b/cmd/helm/repo_remove.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/repo_remove_test.go b/cmd/helm/repo_remove_test.go index bc071b989..f52c3afc4 100644 --- a/cmd/helm/repo_remove_test.go +++ b/cmd/helm/repo_remove_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/repo_update.go b/cmd/helm/repo_update.go index 51e5c0868..291b21b72 100644 --- a/cmd/helm/repo_update.go +++ b/cmd/helm/repo_update.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/repo_update_test.go b/cmd/helm/repo_update_test.go index 68f964f32..71dc87966 100644 --- a/cmd/helm/repo_update_test.go +++ b/cmd/helm/repo_update_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/cmd/helm/reset.go b/cmd/helm/reset.go index 9d3e17e03..5b0914e82 100644 --- a/cmd/helm/reset.go +++ b/cmd/helm/reset.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -86,7 +86,7 @@ func newResetCmd(client helm.Interface, out io.Writer) *cobra.Command { // runReset uninstalls tiller from Kubernetes Cluster and deletes local config func (d *resetCmd) run() error { if d.kubeClient == nil { - c, err := getInternalKubeClient(settings.KubeContext) + c, err := getInternalKubeClient(settings.KubeContext, settings.KubeConfig) if err != nil { return fmt.Errorf("could not get kubernetes client: %s", err) } diff --git a/cmd/helm/reset_test.go b/cmd/helm/reset_test.go index 189b69273..8a74e8af5 100644 --- a/cmd/helm/reset_test.go +++ b/cmd/helm/reset_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/rollback.go b/cmd/helm/rollback.go index 889b6ae28..5c85afc3b 100644 --- a/cmd/helm/rollback.go +++ b/cmd/helm/rollback.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -45,6 +45,7 @@ type rollbackCmd struct { client helm.Interface timeout int64 wait bool + description string } func newRollbackCmd(c helm.Interface, out io.Writer) *cobra.Command { @@ -83,6 +84,7 @@ func newRollbackCmd(c helm.Interface, out io.Writer) *cobra.Command { f.BoolVar(&rollback.disableHooks, "no-hooks", false, "prevent hooks from running during rollback") f.Int64Var(&rollback.timeout, "timeout", 300, "time in seconds to wait for any individual Kubernetes operation (like Jobs for hooks)") f.BoolVar(&rollback.wait, "wait", false, "if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment are in a ready state before marking the release as successful. It will wait for as long as --timeout") + f.StringVar(&rollback.description, "description", "", "specify a description for the release") return cmd } @@ -96,7 +98,8 @@ func (r *rollbackCmd) run() error { helm.RollbackDisableHooks(r.disableHooks), helm.RollbackVersion(r.revision), helm.RollbackTimeout(r.timeout), - helm.RollbackWait(r.wait)) + helm.RollbackWait(r.wait), + helm.RollbackDescription(r.description)) if err != nil { return prettyError(err) } diff --git a/cmd/helm/rollback_test.go b/cmd/helm/rollback_test.go index f1479b2eb..a98a4096a 100644 --- a/cmd/helm/rollback_test.go +++ b/cmd/helm/rollback_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -45,6 +45,12 @@ func TestRollbackCmd(t *testing.T) { flags: []string{"--wait"}, expected: "Rollback was a success! Happy Helming!", }, + { + name: "rollback a release with description", + args: []string{"funny-honey", "1"}, + flags: []string{"--description", "foo"}, + expected: "Rollback was a success! Happy Helming!", + }, { name: "rollback a release without revision", args: []string{"funny-honey"}, diff --git a/cmd/helm/search.go b/cmd/helm/search.go index 8e6fa5ec5..7d3148d6c 100644 --- a/cmd/helm/search.go +++ b/cmd/helm/search.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/search/search.go b/cmd/helm/search/search.go index 6c4cb4aa4..04acb8690 100644 --- a/cmd/helm/search/search.go +++ b/cmd/helm/search/search.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/search/search_test.go b/cmd/helm/search/search_test.go index 574f55448..8432685fa 100644 --- a/cmd/helm/search/search_test.go +++ b/cmd/helm/search/search_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/search_test.go b/cmd/helm/search_test.go index 734f752f5..233f94572 100644 --- a/cmd/helm/search_test.go +++ b/cmd/helm/search_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/serve.go b/cmd/helm/serve.go index 21ae36da1..81f2785c3 100644 --- a/cmd/helm/serve.go +++ b/cmd/helm/serve.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/status.go b/cmd/helm/status.go index b73b6f56e..be057a28e 100644 --- a/cmd/helm/status.go +++ b/cmd/helm/status.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/status_test.go b/cmd/helm/status_test.go index 616b027f3..4a00b8698 100644 --- a/cmd/helm/status_test.go +++ b/cmd/helm/status_test.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/helm/template.go b/cmd/helm/template.go index 458df87b5..54eb9ff49 100644 --- a/cmd/helm/template.go +++ b/cmd/helm/template.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -63,18 +63,20 @@ To render just one template in a chart, use '-x': ` type templateCmd struct { - namespace string - valueFiles valueFiles - chartPath string - out io.Writer - values []string - stringValues []string - nameTemplate string - showNotes bool - releaseName string - renderFiles []string - kubeVersion string - outputDir string + namespace string + valueFiles valueFiles + chartPath string + out io.Writer + values []string + stringValues []string + fileValues []string + nameTemplate string + showNotes bool + releaseName string + releaseIsUpgrade bool + renderFiles []string + kubeVersion string + outputDir string } func newTemplateCmd(out io.Writer) *cobra.Command { @@ -93,11 +95,13 @@ func newTemplateCmd(out io.Writer) *cobra.Command { f := cmd.Flags() f.BoolVar(&t.showNotes, "notes", false, "show the computed NOTES.txt file as well") f.StringVarP(&t.releaseName, "name", "n", "RELEASE-NAME", "release name") + f.BoolVar(&t.releaseIsUpgrade, "is-upgrade", false, "set .Release.IsUpgrade instead of .Release.IsInstall") f.StringArrayVarP(&t.renderFiles, "execute", "x", []string{}, "only execute the given templates") f.VarP(&t.valueFiles, "values", "f", "specify values in a YAML file (can specify multiple)") f.StringVar(&t.namespace, "namespace", "", "namespace to install the release into") f.StringArrayVar(&t.values, "set", []string{}, "set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)") f.StringArrayVar(&t.stringValues, "set-string", []string{}, "set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)") + f.StringArrayVar(&t.fileValues, "set-file", []string{}, "set values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)") f.StringVar(&t.nameTemplate, "name-template", "", "specify template used to name the release") f.StringVar(&t.kubeVersion, "kube-version", defaultKubeVersion, "kubernetes version used as Capabilities.KubeVersion.Major/Minor") f.StringVar(&t.outputDir, "output-dir", "", "writes the executed templates to files in output-dir instead of stdout") @@ -130,7 +134,7 @@ func (t *templateCmd) run(cmd *cobra.Command, args []string) error { t.namespace = defaultNamespace() } // get combined values and create config - rawVals, err := vals(t.valueFiles, t.values, t.stringValues, "", "", "") + rawVals, err := vals(t.valueFiles, t.values, t.stringValues, t.fileValues, "", "", "") if err != nil { return err } @@ -159,6 +163,8 @@ func (t *templateCmd) run(cmd *cobra.Command, args []string) error { } options := chartutil.ReleaseOptions{ Name: t.releaseName, + IsInstall: !t.releaseIsUpgrade, + IsUpgrade: t.releaseIsUpgrade, Time: timeconv.Now(), Namespace: t.namespace, } @@ -240,7 +246,9 @@ func (t *templateCmd) run(cmd *cobra.Command, args []string) error { } for _, manifest := range listManifests { - manifestPathSplit := strings.Split(manifest.Name, string(filepath.Separator)) + // manifest.Name is rendered using linux-style filepath separators on Windows as + // well as macOS/linux. + manifestPathSplit := strings.Split(manifest.Name, "/") // remove the chart name from the path manifestPathSplit = manifestPathSplit[1:] toJoin := append([]string{t.chartPath}, manifestPathSplit...) @@ -305,7 +313,7 @@ func writeToFile(outputDir string, name string, data string) error { defer f.Close() - _, err = f.WriteString(fmt.Sprintf("##---\n# Source: %s\n%s", name, data)) + _, err = f.WriteString(fmt.Sprintf("---\n# Source: %s\n%s", name, data)) if err != nil { return err diff --git a/cmd/helm/template_test.go b/cmd/helm/template_test.go index cad42db16..64924c2f2 100644 --- a/cmd/helm/template_test.go +++ b/cmd/helm/template_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -68,8 +68,8 @@ func TestTemplateCmd(t *testing.T) { }, { name: "check_execute_non_existent", - desc: "verify --execute fails on a template that doesnt exist", - args: []string{subchart1ChartPath, "-x", "templates/thisdoesntexist.yaml"}, + desc: "verify --execute fails on a template that doesn't exist", + args: []string{subchart1ChartPath, "-x", "templates/thisdoesn'texist.yaml"}, expectError: "could not find template", }, { @@ -107,6 +107,20 @@ func TestTemplateCmd(t *testing.T) { expectKey: "subchart1/templates/service.yaml", expectValue: "release-name: \"test\"", }, + { + name: "check_release_is_install", + desc: "verify --is-upgrade toggles .Release.IsInstall", + args: []string{subchart1ChartPath, "--is-upgrade=false"}, + expectKey: "subchart1/templates/service.yaml", + expectValue: "release-is-install: \"true\"", + }, + { + name: "check_release_is_upgrade", + desc: "verify --is-upgrade toggles .Release.IsUpgrade", + args: []string{subchart1ChartPath, "--is-upgrade", "true"}, + expectKey: "subchart1/templates/service.yaml", + expectValue: "release-is-upgrade: \"true\"", + }, { name: "check_notes", desc: "verify --notes shows notes", diff --git a/cmd/helm/upgrade.go b/cmd/helm/upgrade.go index 4dd433a39..ba0649e39 100644 --- a/cmd/helm/upgrade.go +++ b/cmd/helm/upgrade.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -37,8 +37,10 @@ a packaged chart, or a fully qualified URL. For chart references, the latest version will be specified unless the '--version' flag is set. To override values in a chart, use either the '--values' flag and pass in a file -or use the '--set' flag and pass configuration from the command line, to force string -values, use '--set-string'. +or use the '--set' flag and pass configuration from the command line. To force string +values in '--set', use '--set-string' instead. In case a value is large and therefore +you want not to use neither '--values' nor '--set', use '--set-file' to read the +single large value from file. You can specify the '--values'/'-f' flag multiple times. The priority will be given to the last (right-most) file specified. For example, if both myvalues.yaml and override.yaml @@ -65,6 +67,7 @@ type upgradeCmd struct { valueFiles valueFiles values []string stringValues []string + fileValues []string verify bool keyring string install bool @@ -78,6 +81,7 @@ type upgradeCmd struct { username string password string devel bool + description string certFile string keyFile string @@ -121,6 +125,7 @@ func newUpgradeCmd(client helm.Interface, out io.Writer) *cobra.Command { f.BoolVar(&upgrade.force, "force", false, "force resource update through delete/recreate if needed") f.StringArrayVar(&upgrade.values, "set", []string{}, "set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)") f.StringArrayVar(&upgrade.stringValues, "set-string", []string{}, "set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)") + f.StringArrayVar(&upgrade.fileValues, "set-file", []string{}, "set values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)") f.BoolVar(&upgrade.disableHooks, "disable-hooks", false, "disable pre/post upgrade hooks. DEPRECATED. Use no-hooks") f.BoolVar(&upgrade.disableHooks, "no-hooks", false, "disable pre/post upgrade hooks") f.BoolVar(&upgrade.verify, "verify", false, "verify the provenance of the chart before upgrading") @@ -139,6 +144,7 @@ func newUpgradeCmd(client helm.Interface, out io.Writer) *cobra.Command { f.StringVar(&upgrade.keyFile, "key-file", "", "identify HTTPS client using this SSL key file") f.StringVar(&upgrade.caFile, "ca-file", "", "verify certificates of HTTPS-enabled servers using this CA bundle") f.BoolVar(&upgrade.devel, "devel", false, "use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored.") + f.StringVar(&upgrade.description, "description", "", "specify the description to use for the upgrade, rather than the default") f.MarkDeprecated("disable-hooks", "use --no-hooks instead") @@ -187,15 +193,17 @@ func (u *upgradeCmd) run() error { keyring: u.keyring, values: u.values, stringValues: u.stringValues, + fileValues: u.fileValues, namespace: u.namespace, timeout: u.timeout, wait: u.wait, + description: u.description, } return ic.run() } } - rawVals, err := vals(u.valueFiles, u.values, u.stringValues, u.certFile, u.keyFile, u.caFile) + rawVals, err := vals(u.valueFiles, u.values, u.stringValues, u.fileValues, u.certFile, u.keyFile, u.caFile) if err != nil { return err } @@ -224,7 +232,8 @@ func (u *upgradeCmd) run() error { helm.UpgradeTimeout(u.timeout), helm.ResetValues(u.resetValues), helm.ReuseValues(u.reuseValues), - helm.UpgradeWait(u.wait)) + helm.UpgradeWait(u.wait), + helm.UpgradeDescription(u.description)) if err != nil { return fmt.Errorf("UPGRADE FAILED: %v", prettyError(err)) } diff --git a/cmd/helm/upgrade_test.go b/cmd/helm/upgrade_test.go index 187d3593e..60b529f63 100644 --- a/cmd/helm/upgrade_test.go +++ b/cmd/helm/upgrade_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -139,6 +139,14 @@ func TestUpgradeCmd(t *testing.T) { expected: "Release \"crazy-bunny\" has been upgraded. Happy Helming!\n", rels: []*release.Release{helm.ReleaseMock(&helm.MockReleaseOptions{Name: "crazy-bunny", Version: 1, Chart: ch})}, }, + { + name: "install a release with 'upgrade --install' and custom description", + args: []string{"crazy-bunny", chartPath}, + flags: []string{"-i", "--description", "foo"}, + resp: helm.ReleaseMock(&helm.MockReleaseOptions{Name: "crazy-bunny", Version: 1, Chart: ch, Description: "foo"}), + expected: "Release \"crazy-bunny\" has been upgraded. Happy Helming!\n", + rels: []*release.Release{helm.ReleaseMock(&helm.MockReleaseOptions{Name: "crazy-bunny", Version: 1, Chart: ch, Description: "foo"})}, + }, { name: "upgrade a release with wait", args: []string{"crazy-bunny", chartPath}, @@ -147,6 +155,14 @@ func TestUpgradeCmd(t *testing.T) { expected: "Release \"crazy-bunny\" has been upgraded. Happy Helming!\n", rels: []*release.Release{helm.ReleaseMock(&helm.MockReleaseOptions{Name: "crazy-bunny", Version: 2, Chart: ch2})}, }, + { + name: "upgrade a release with description", + args: []string{"crazy-bunny", chartPath}, + flags: []string{"--description", "foo"}, + resp: helm.ReleaseMock(&helm.MockReleaseOptions{Name: "crazy-bunny", Version: 2, Chart: ch2}), + expected: "Release \"crazy-bunny\" has been upgraded. Happy Helming!\n", + rels: []*release.Release{helm.ReleaseMock(&helm.MockReleaseOptions{Name: "crazy-bunny", Version: 2, Chart: ch2, Description: "foo"})}, + }, { name: "upgrade a release with missing dependencies", args: []string{"bonkers-bunny", missingDepsPath}, diff --git a/cmd/helm/verify.go b/cmd/helm/verify.go index e82eb4e33..bbc8347c1 100644 --- a/cmd/helm/verify.go +++ b/cmd/helm/verify.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/cmd/helm/verify_test.go b/cmd/helm/verify_test.go index 6e8b906fc..4d683df75 100644 --- a/cmd/helm/verify_test.go +++ b/cmd/helm/verify_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/cmd/helm/version.go b/cmd/helm/version.go index d541067a0..922e744b2 100644 --- a/cmd/helm/version.go +++ b/cmd/helm/version.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -73,12 +73,6 @@ func newVersionCmd(c helm.Interface, out io.Writer) *cobra.Command { if !version.showClient && !version.showServer { version.showClient, version.showServer = true, true } - if version.showServer { - // We do this manually instead of in PreRun because we only - // need a tunnel if server version is requested. - setupConnection() - } - version.client = ensureHelmClient(version.client) return version.run() }, } @@ -108,6 +102,13 @@ func (v *versionCmd) run() error { return tpl(v.template, data, v.out) } + // We do this manually instead of in PreRun because we only + // need a tunnel if server version is requested. + if err := setupConnection(); err != nil { + return err + } + v.client = ensureHelmClient(v.client) + if settings.Debug { k8sVersion, err := getK8sVersion() if err != nil { @@ -115,7 +116,6 @@ func (v *versionCmd) run() error { } fmt.Fprintf(v.out, "Kubernetes: %#v\n", k8sVersion) } - resp, err := v.client.GetVersion() if err != nil { if grpc.Code(err) == codes.Unimplemented { @@ -135,7 +135,7 @@ func (v *versionCmd) run() error { func getK8sVersion() (*apiVersion.Info, error) { var v *apiVersion.Info - _, client, err := getKubeClient(settings.KubeContext) + _, client, err := getKubeClient(settings.KubeContext, settings.KubeConfig) if err != nil { return v, err } diff --git a/cmd/helm/version_test.go b/cmd/helm/version_test.go index e25724f4c..5519131c2 100644 --- a/cmd/helm/version_test.go +++ b/cmd/helm/version_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/cmd/rudder/rudder.go b/cmd/rudder/rudder.go index 30ece3998..8897e78be 100644 --- a/cmd/rudder/rudder.go +++ b/cmd/rudder/rudder.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/tiller/probes.go b/cmd/tiller/probes.go index 144ad8a1b..7d209aa42 100644 --- a/cmd/tiller/probes.go +++ b/cmd/tiller/probes.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/tiller/probes_test.go b/cmd/tiller/probes_test.go index 0b13460e0..d13979a8a 100644 --- a/cmd/tiller/probes_test.go +++ b/cmd/tiller/probes_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/tiller/tiller.go b/cmd/tiller/tiller.go index 5d2db3816..0208fe741 100644 --- a/cmd/tiller/tiller.go +++ b/cmd/tiller/tiller.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -85,7 +85,7 @@ var ( // rootServer is the root gRPC server. // - // Each gRPC service registers itself to this server during init(). + // Each gRPC service registers itself to this server during start(). rootServer *grpc.Server // env is the default environment. diff --git a/cmd/tiller/tiller_test.go b/cmd/tiller/tiller_test.go index 0698e9d94..9ce153fc7 100644 --- a/cmd/tiller/tiller_test.go +++ b/cmd/tiller/tiller_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/tiller/trace.go b/cmd/tiller/trace.go index 71d7e8f72..126bbf83a 100644 --- a/cmd/tiller/trace.go +++ b/cmd/tiller/trace.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/docs/index.md b/docs/README.md similarity index 100% rename from docs/index.md rename to docs/README.md diff --git a/docs/chart_best_practices/conventions.md b/docs/chart_best_practices/conventions.md index 324ef88f9..524928e25 100644 --- a/docs/chart_best_practices/conventions.md +++ b/docs/chart_best_practices/conventions.md @@ -4,19 +4,21 @@ This part of the Best Practices Guide explains general conventions. ## Chart Names -Chart names should be lower case letters and numbers. Words _may_ be separated with dashes (-): +Chart names should use lower case letters and numbers, and start with a letter. -Examples: +Hyphens (-) are allowed, but are known to be a little trickier to work with in Helm templates (see [issue #2192](https://github.com/helm/helm/issues/2192) for more information). + +Here are a few examples of good chart names from the [Helm Community Charts](https://github.com/helm/charts): ``` drupal -nginx-lego -aws-cluster-autoscaler +cert-manager +oauth2-proxy ``` Neither uppercase letters nor underscores should be used in chart names. Dots should not be used in chart names. -The directory that contains a chart MUST have the same name as the chart. Thus, the chart `nginx-lego` MUST be created in a directory called `nginx-lego/`. This is not merely a stylistic detail, but a requirement of the Helm Chart format. +The directory that contains a chart MUST have the same name as the chart. Thus, the chart `cert-manager` MUST be created in a directory called `cert-manager/`. This is not merely a stylistic detail, but a requirement of the Helm Chart format. ## Version Numbers diff --git a/docs/chart_best_practices/values.md b/docs/chart_best_practices/values.md index 2962e7d45..28e3a3eac 100644 --- a/docs/chart_best_practices/values.md +++ b/docs/chart_best_practices/values.md @@ -93,6 +93,7 @@ There are three potential sources of values: - A chart's `values.yaml` file - A values file supplied by `helm install -f` or `helm upgrade -f` - The values passed to a `--set` or `--set-string` flag on `helm install` or `helm upgrade` +- The content of a file passed to `--set-file` flag on `helm install` or `helm upgrade` When designing the structure of your values, keep in mind that users of your chart may want to override them via either the `-f` flag or with the `--set` diff --git a/docs/chart_template_guide/accessing_files.md b/docs/chart_template_guide/accessing_files.md index 11747d4f0..c959002b7 100644 --- a/docs/chart_template_guide/accessing_files.md +++ b/docs/chart_template_guide/accessing_files.md @@ -130,7 +130,7 @@ Or ```yaml {{ range $path, $bytes := .Files.Glob "foo/*" }} -{{ $path.base }}: '{{ $root.Files.Get $path | b64enc }}' +{{ base $path }}: '{{ $root.Files.Get $path | b64enc }}' {{ end }} ``` diff --git a/docs/chart_template_guide/control_structures.md b/docs/chart_template_guide/control_structures.md index 7575ebc35..1844bd393 100644 --- a/docs/chart_template_guide/control_structures.md +++ b/docs/chart_template_guide/control_structures.md @@ -53,10 +53,10 @@ data: myvalue: "Hello World" drink: {{ .Values.favorite.drink | default "tea" | quote }} food: {{ .Values.favorite.food | upper | quote }} - {{ if eq .Values.favorite.drink "coffee" }}mug: true{{ end }} + {{ if (.Values.favorite.drink) and eq .Values.favorite.drink "coffee" }}mug: true{{ end }} ``` -Since we commented out `drink: coffee` in our last example, the output should not include a `mug: true` flag. But if we add that line back into our `values.yaml` file, the output should look like this: +Note that `.Values.favorite.drink` must be defined or else it will throw an error when comparing it to "coffee". Since we commented out `drink: coffee` in our last example, the output should not include a `mug: true` flag. But if we add that line back into our `values.yaml` file, the output should look like this: ```yaml # Source: mychart/templates/configmap.yaml diff --git a/docs/charts.md b/docs/charts.md index a55038e3e..656731182 100644 --- a/docs/charts.md +++ b/docs/charts.md @@ -265,7 +265,7 @@ dependencies: - name: subchart1 repository: http://localhost:10191 version: 0.1.0 - condition: subchart1.enabled, global.subchart1.enabled + condition: subchart1.enabled,global.subchart1.enabled tags: - front-end - subchart1 @@ -303,7 +303,6 @@ The `--set` parameter can be used as usual to alter tag and condition values. ```` helm install --set tags.front-end=true --set subchart2.enabled=false - ```` ##### Tags and Condition Resolution diff --git a/docs/charts_hooks.md b/docs/charts_hooks.md index f51749f57..8d5006d1f 100644 --- a/docs/charts_hooks.md +++ b/docs/charts_hooks.md @@ -183,8 +183,7 @@ deterministic executing order. Weights are defined using the following annotatio ``` Hook weights can be positive or negative numbers but must be represented as -strings. When Tiller starts the execution cycle of hooks of a particular Kind it -will sort those hooks in ascending order. +strings. When Tiller starts the execution cycle of hooks of a particular kind (ex. the `pre-install` hooks or `post-install` hooks, etc.) it will sort those hooks in ascending order. It is also possible to define policies that determine when to delete corresponding hook resources. Hook deletion policies are defined using the following annotation: @@ -194,6 +193,7 @@ It is also possible to define policies that determine when to delete correspondi ``` You can choose one or more defined annotation values: + * `"hook-succeeded"` specifies Tiller should delete the hook after the hook is successfully executed. * `"hook-failed"` specifies Tiller should delete the hook if the hook failed during execution. * `"before-hook-creation"` specifies Tiller should delete the previous hook before the new hook is launched. diff --git a/docs/charts_tips_and_tricks.md b/docs/charts_tips_and_tricks.md index 484d8b936..a83b44457 100644 --- a/docs/charts_tips_and_tricks.md +++ b/docs/charts_tips_and_tricks.md @@ -106,6 +106,43 @@ For example: The above will render the template when .Values.foo is defined, but will fail to render and exit when .Values.foo is undefined. +## Using the 'tpl' Function + +The `tpl` function allows developers to evaluate strings as templates inside a template. +This is useful to pass a template string as a value to a chart or render external configuration files. +Syntax: `{{ tpl TEMPLATE_STRING VALUES }}` + +Examples: +``` +# values +template: "{{ .Values.name }}" +name: "Tom" + +# template +{{ tpl .Values.template . }} + +# output +Tom +``` + +Rendering a external configuration file: +``` +# external configuration file conf/app.conf +firstName={{ .Values.firstName }} +lastName={{ .Values.lastName }} + +# values +firstName: Peter +lastName: Parker + +# template +{{ tpl (.Files.Get "conf/app.conf") . }} + +# output +firstName=Peter +lastName=Parker +``` + ## Creating Image Pull Secrets Image pull secrets are essentially a combination of _registry_, _username_, and _password_. You may need them in an application you are deploying, but to create them requires running _base64_ a couple of times. We can write a helper template to compose the Docker configuration file for use as the Secret's payload. Here is an example: diff --git a/docs/examples/README.md b/docs/examples/README.md index 723040ca8..f936e1551 100644 --- a/docs/examples/README.md +++ b/docs/examples/README.md @@ -14,6 +14,5 @@ It simply deploys a single pod running Alpine Linux. The `nginx` chart shows how to compose several resources into one chart, and it illustrates more complex template usage. -It deploys a `deployment` (which creates a `replica set`), a `config -map`, and a `service`. The replica set starts an nginx pod. The config +It deploys a `Deployment` (which creates a `ReplicaSet`), a `ConfigMap`, and a `Service`. The replica set starts an nginx pod. The config map stores the files that the nginx server can serve. diff --git a/docs/helm/helm.md b/docs/helm/helm.md index 8592cad7c..ae27de401 100644 --- a/docs/helm/helm.md +++ b/docs/helm/helm.md @@ -36,6 +36,7 @@ Environment: --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -68,4 +69,4 @@ Environment: * [helm verify](helm_verify.md) - verify that a chart at the given path has been signed and is valid * [helm version](helm_version.md) - print the client/server version information -###### Auto generated by spf13/cobra on 14-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_completion.md b/docs/helm/helm_completion.md index 994205d88..64a6056f8 100644 --- a/docs/helm/helm_completion.md +++ b/docs/helm/helm_completion.md @@ -28,6 +28,7 @@ helm completion SHELL --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -35,4 +36,4 @@ helm completion SHELL ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_create.md b/docs/helm/helm_create.md index 6e0f3de78..7ae947ed7 100644 --- a/docs/helm/helm_create.md +++ b/docs/helm/helm_create.md @@ -47,6 +47,7 @@ helm create NAME --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -54,4 +55,4 @@ helm create NAME ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_delete.md b/docs/helm/helm_delete.md index 5d41cd7ea..e181f439e 100644 --- a/docs/helm/helm_delete.md +++ b/docs/helm/helm_delete.md @@ -20,6 +20,7 @@ helm delete [flags] RELEASE_NAME [...] ### Options ``` + --description string specify a description for the release --dry-run simulate a delete --no-hooks prevent hooks from running during deletion --purge remove the release from the store and make its name free for later use @@ -38,6 +39,7 @@ helm delete [flags] RELEASE_NAME [...] --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -45,4 +47,4 @@ helm delete [flags] RELEASE_NAME [...] ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_dependency.md b/docs/helm/helm_dependency.md index 34d49e20a..b0085c6c7 100644 --- a/docs/helm/helm_dependency.md +++ b/docs/helm/helm_dependency.md @@ -61,6 +61,7 @@ for this case. --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -71,4 +72,4 @@ for this case. * [helm dependency list](helm_dependency_list.md) - list the dependencies for the given chart * [helm dependency update](helm_dependency_update.md) - update charts/ based on the contents of requirements.yaml -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_dependency_build.md b/docs/helm/helm_dependency_build.md index 0413a9a85..eea2fa02c 100644 --- a/docs/helm/helm_dependency_build.md +++ b/docs/helm/helm_dependency_build.md @@ -34,6 +34,7 @@ helm dependency build [flags] CHART --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -41,4 +42,4 @@ helm dependency build [flags] CHART ### SEE ALSO * [helm dependency](helm_dependency.md) - manage a chart's dependencies -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_dependency_list.md b/docs/helm/helm_dependency_list.md index b4343081c..d6bc0175a 100644 --- a/docs/helm/helm_dependency_list.md +++ b/docs/helm/helm_dependency_list.md @@ -26,6 +26,7 @@ helm dependency list [flags] CHART --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -33,4 +34,4 @@ helm dependency list [flags] CHART ### SEE ALSO * [helm dependency](helm_dependency.md) - manage a chart's dependencies -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_dependency_update.md b/docs/helm/helm_dependency_update.md index 3c90ff779..90b81ecea 100644 --- a/docs/helm/helm_dependency_update.md +++ b/docs/helm/helm_dependency_update.md @@ -39,6 +39,7 @@ helm dependency update [flags] CHART --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -46,4 +47,4 @@ helm dependency update [flags] CHART ### SEE ALSO * [helm dependency](helm_dependency.md) - manage a chart's dependencies -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_fetch.md b/docs/helm/helm_fetch.md index 1ddef65fa..c347d1620 100644 --- a/docs/helm/helm_fetch.md +++ b/docs/helm/helm_fetch.md @@ -50,9 +50,12 @@ helm fetch [flags] [chart URL | repo/chartname] [...] --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. + +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_get.md b/docs/helm/helm_get.md index 9cd70e520..f233cd2a7 100644 --- a/docs/helm/helm_get.md +++ b/docs/helm/helm_get.md @@ -40,6 +40,7 @@ helm get [flags] RELEASE_NAME --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -50,4 +51,4 @@ helm get [flags] RELEASE_NAME * [helm get manifest](helm_get_manifest.md) - download the manifest for a named release * [helm get values](helm_get_values.md) - download the values file for a named release -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_get_hooks.md b/docs/helm/helm_get_hooks.md index 85fa5d04b..4f9fa1887 100644 --- a/docs/helm/helm_get_hooks.md +++ b/docs/helm/helm_get_hooks.md @@ -33,6 +33,7 @@ helm get hooks [flags] RELEASE_NAME --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -40,4 +41,4 @@ helm get hooks [flags] RELEASE_NAME ### SEE ALSO * [helm get](helm_get.md) - download a named release -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_get_manifest.md b/docs/helm/helm_get_manifest.md index a00c1be56..3ae55ef3e 100644 --- a/docs/helm/helm_get_manifest.md +++ b/docs/helm/helm_get_manifest.md @@ -35,6 +35,7 @@ helm get manifest [flags] RELEASE_NAME --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -42,4 +43,4 @@ helm get manifest [flags] RELEASE_NAME ### SEE ALSO * [helm get](helm_get.md) - download a named release -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_get_values.md b/docs/helm/helm_get_values.md index d8944b475..12d973122 100644 --- a/docs/helm/helm_get_values.md +++ b/docs/helm/helm_get_values.md @@ -32,6 +32,7 @@ helm get values [flags] RELEASE_NAME --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -39,4 +40,4 @@ helm get values [flags] RELEASE_NAME ### SEE ALSO * [helm get](helm_get.md) - download a named release -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_history.md b/docs/helm/helm_history.md index ac51a8994..437e70f03 100755 --- a/docs/helm/helm_history.md +++ b/docs/helm/helm_history.md @@ -45,6 +45,7 @@ helm history [flags] RELEASE_NAME --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -52,4 +53,4 @@ helm history [flags] RELEASE_NAME ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 14-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_home.md b/docs/helm/helm_home.md index bdccd756f..9af12c91a 100644 --- a/docs/helm/helm_home.md +++ b/docs/helm/helm_home.md @@ -21,6 +21,7 @@ helm home --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -28,4 +29,4 @@ helm home ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_init.md b/docs/helm/helm_init.md index 5374488af..ec775520a 100644 --- a/docs/helm/helm_init.md +++ b/docs/helm/helm_init.md @@ -64,6 +64,7 @@ helm init --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -71,4 +72,4 @@ helm init ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_inspect.md b/docs/helm/helm_inspect.md index e46b3dbf4..4bc904f63 100644 --- a/docs/helm/helm_inspect.md +++ b/docs/helm/helm_inspect.md @@ -37,6 +37,7 @@ helm inspect [CHART] --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -47,4 +48,4 @@ helm inspect [CHART] * [helm inspect readme](helm_inspect_readme.md) - shows inspect readme * [helm inspect values](helm_inspect_values.md) - shows inspect values -###### Auto generated by spf13/cobra on 14-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_inspect_chart.md b/docs/helm/helm_inspect_chart.md index cd1328b59..257f26051 100644 --- a/docs/helm/helm_inspect_chart.md +++ b/docs/helm/helm_inspect_chart.md @@ -35,6 +35,7 @@ helm inspect chart [CHART] --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -42,4 +43,4 @@ helm inspect chart [CHART] ### SEE ALSO * [helm inspect](helm_inspect.md) - inspect a chart -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_inspect_readme.md b/docs/helm/helm_inspect_readme.md index 9dd9ebd43..8ff7d892e 100644 --- a/docs/helm/helm_inspect_readme.md +++ b/docs/helm/helm_inspect_readme.md @@ -33,6 +33,7 @@ helm inspect readme [CHART] --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -40,4 +41,4 @@ helm inspect readme [CHART] ### SEE ALSO * [helm inspect](helm_inspect.md) - inspect a chart -###### Auto generated by spf13/cobra on 14-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_inspect_values.md b/docs/helm/helm_inspect_values.md index 6a907cc7d..50ff6ac24 100644 --- a/docs/helm/helm_inspect_values.md +++ b/docs/helm/helm_inspect_values.md @@ -35,6 +35,7 @@ helm inspect values [CHART] --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -42,4 +43,4 @@ helm inspect values [CHART] ### SEE ALSO * [helm inspect](helm_inspect.md) - inspect a chart -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_install.md b/docs/helm/helm_install.md index 9f1ad86b0..c266222b8 100644 --- a/docs/helm/helm_install.md +++ b/docs/helm/helm_install.md @@ -12,8 +12,10 @@ The install argument must be a chart reference, a path to a packaged chart, a path to an unpacked chart directory or a URL. To override values in a chart, use either the '--values' flag and pass in a file -or use the '--set' flag and pass configuration from the command line, to force -a string value use '--set-string'. +or use the '--set' flag and pass configuration from the command line. To force string +values in '--set', use '--set-string' instead. In case a value is large and therefore +you want not to use neither '--values' nor '--set', use '--set-file' to read the +single large value from file. $ helm install -f myvalues.yaml ./redis @@ -25,6 +27,9 @@ or $ helm install --set-string long_int=1234567890 ./redis +or + $ helm install --set-file multiline_text=path/to/textfile + You can specify the '--values'/'-f' flag multiple times. The priority will be given to the last (right-most) file specified. For example, if both myvalues.yaml and override.yaml contained a key called 'Test', the value set in override.yaml would take precedence: @@ -77,6 +82,7 @@ helm install [CHART] --ca-file string verify certificates of HTTPS-enabled servers using this CA bundle --cert-file string identify HTTPS client using this SSL certificate file --dep-up run helm dependency update before installing the chart + --description string specify a description for the release --devel use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored. --dry-run simulate an install --key-file string identify HTTPS client using this SSL key file @@ -90,6 +96,7 @@ helm install [CHART] --replace re-use the given name, even if that name is already used. This is unsafe in production --repo string chart repository url where to locate the requested chart --set stringArray set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2) + --set-file stringArray set values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2) --set-string stringArray set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2) --timeout int time in seconds to wait for any individual Kubernetes operation (like Jobs for hooks) (default 300) --tls enable TLS for request @@ -111,6 +118,7 @@ helm install [CHART] --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -118,4 +126,4 @@ helm install [CHART] ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 27-Apr-2018 +###### Auto generated by spf13/cobra on 17-Jul-2018 diff --git a/docs/helm/helm_lint.md b/docs/helm/helm_lint.md index 596edf2bb..9c328a086 100644 --- a/docs/helm/helm_lint.md +++ b/docs/helm/helm_lint.md @@ -21,8 +21,9 @@ helm lint [flags] PATH ### Options ``` - --namespace string namespace to install the release into (only used if --install is set) (default "default") + --namespace string namespace to put the release into (default "default") --set stringArray set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2) + --set-file stringArray set values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2) --set-string stringArray set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2) --strict fail on lint warnings -f, --values valueFiles specify values in a YAML file (can specify multiple) (default []) @@ -35,6 +36,7 @@ helm lint [flags] PATH --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -42,4 +44,4 @@ helm lint [flags] PATH ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 9-Mar-2018 +###### Auto generated by spf13/cobra on 25-Jul-2018 diff --git a/docs/helm/helm_list.md b/docs/helm/helm_list.md index 1d5bf7ea2..c7e99e403 100755 --- a/docs/helm/helm_list.md +++ b/docs/helm/helm_list.md @@ -49,6 +49,7 @@ helm list [flags] [FILTER] -m, --max int maximum number of releases to fetch (default 256) --namespace string show releases within a specific namespace -o, --offset string next release name in the list, used to offset from start value + --output string output the specified format (json or yaml) --pending show pending releases -r, --reverse reverse the sort order -q, --short output short (quiet) listing format @@ -66,6 +67,7 @@ helm list [flags] [FILTER] --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -73,4 +75,4 @@ helm list [flags] [FILTER] ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_package.md b/docs/helm/helm_package.md index 21090fa45..30d06fcf0 100644 --- a/docs/helm/helm_package.md +++ b/docs/helm/helm_package.md @@ -40,6 +40,7 @@ helm package [flags] [CHART_PATH] [...] --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -47,4 +48,4 @@ helm package [flags] [CHART_PATH] [...] ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 16-Apr-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_plugin.md b/docs/helm/helm_plugin.md index cc42aa4dc..bb0498d87 100644 --- a/docs/helm/helm_plugin.md +++ b/docs/helm/helm_plugin.md @@ -16,6 +16,7 @@ Manage client-side Helm plugins. --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -27,4 +28,4 @@ Manage client-side Helm plugins. * [helm plugin remove](helm_plugin_remove.md) - remove one or more Helm plugins * [helm plugin update](helm_plugin_update.md) - update one or more Helm plugins -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_plugin_install.md b/docs/helm/helm_plugin_install.md index 196ca97dd..ab45850bf 100644 --- a/docs/helm/helm_plugin_install.md +++ b/docs/helm/helm_plugin_install.md @@ -29,6 +29,7 @@ helm plugin install [options] ... --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -36,4 +37,4 @@ helm plugin install [options] ... ### SEE ALSO * [helm plugin](helm_plugin.md) - add, list, or remove Helm plugins -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_plugin_list.md b/docs/helm/helm_plugin_list.md index ddfd04ee6..dc13cdf7a 100644 --- a/docs/helm/helm_plugin_list.md +++ b/docs/helm/helm_plugin_list.md @@ -18,6 +18,7 @@ helm plugin list --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -25,4 +26,4 @@ helm plugin list ### SEE ALSO * [helm plugin](helm_plugin.md) - add, list, or remove Helm plugins -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_plugin_remove.md b/docs/helm/helm_plugin_remove.md index 8543a367a..2ef833217 100644 --- a/docs/helm/helm_plugin_remove.md +++ b/docs/helm/helm_plugin_remove.md @@ -18,6 +18,7 @@ helm plugin remove ... --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -25,4 +26,4 @@ helm plugin remove ... ### SEE ALSO * [helm plugin](helm_plugin.md) - add, list, or remove Helm plugins -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_plugin_update.md b/docs/helm/helm_plugin_update.md index 9e5e205f0..93bc3e764 100644 --- a/docs/helm/helm_plugin_update.md +++ b/docs/helm/helm_plugin_update.md @@ -18,6 +18,7 @@ helm plugin update ... --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -25,4 +26,4 @@ helm plugin update ... ### SEE ALSO * [helm plugin](helm_plugin.md) - add, list, or remove Helm plugins -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_repo.md b/docs/helm/helm_repo.md index 4109ceca4..32e9d02b2 100644 --- a/docs/helm/helm_repo.md +++ b/docs/helm/helm_repo.md @@ -20,6 +20,7 @@ Example usage: --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -32,4 +33,4 @@ Example usage: * [helm repo remove](helm_repo_remove.md) - remove a chart repository * [helm repo update](helm_repo_update.md) - update information of available charts locally from chart repositories -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_repo_add.md b/docs/helm/helm_repo_add.md index 456ffa27e..1deb0cb5c 100644 --- a/docs/helm/helm_repo_add.md +++ b/docs/helm/helm_repo_add.md @@ -29,6 +29,7 @@ helm repo add [flags] [NAME] [URL] --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -36,4 +37,4 @@ helm repo add [flags] [NAME] [URL] ### SEE ALSO * [helm repo](helm_repo.md) - add, list, remove, update, and index chart repositories -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_repo_index.md b/docs/helm/helm_repo_index.md index 14b412b29..baa1291de 100644 --- a/docs/helm/helm_repo_index.md +++ b/docs/helm/helm_repo_index.md @@ -34,6 +34,7 @@ helm repo index [flags] [DIR] --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -41,4 +42,4 @@ helm repo index [flags] [DIR] ### SEE ALSO * [helm repo](helm_repo.md) - add, list, remove, update, and index chart repositories -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_repo_list.md b/docs/helm/helm_repo_list.md index 858ef957f..00221ed24 100644 --- a/docs/helm/helm_repo_list.md +++ b/docs/helm/helm_repo_list.md @@ -18,6 +18,7 @@ helm repo list [flags] --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -25,4 +26,4 @@ helm repo list [flags] ### SEE ALSO * [helm repo](helm_repo.md) - add, list, remove, update, and index chart repositories -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_repo_remove.md b/docs/helm/helm_repo_remove.md index 801bc3c3f..272ecea47 100644 --- a/docs/helm/helm_repo_remove.md +++ b/docs/helm/helm_repo_remove.md @@ -18,6 +18,7 @@ helm repo remove [flags] [NAME] --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -25,4 +26,4 @@ helm repo remove [flags] [NAME] ### SEE ALSO * [helm repo](helm_repo.md) - add, list, remove, update, and index chart repositories -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_repo_update.md b/docs/helm/helm_repo_update.md index 897ed24b7..f0215da48 100644 --- a/docs/helm/helm_repo_update.md +++ b/docs/helm/helm_repo_update.md @@ -24,6 +24,7 @@ helm repo update --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -31,4 +32,4 @@ helm repo update ### SEE ALSO * [helm repo](helm_repo.md) - add, list, remove, update, and index chart repositories -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_reset.md b/docs/helm/helm_reset.md index ed68b1b84..507a94bfd 100644 --- a/docs/helm/helm_reset.md +++ b/docs/helm/helm_reset.md @@ -34,6 +34,7 @@ helm reset --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -41,4 +42,4 @@ helm reset ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_rollback.md b/docs/helm/helm_rollback.md index 4b6dcbbb2..b40fb883a 100644 --- a/docs/helm/helm_rollback.md +++ b/docs/helm/helm_rollback.md @@ -20,6 +20,7 @@ helm rollback [flags] [RELEASE] [REVISION] ### Options ``` + --description string specify a description for the release --dry-run simulate a rollback --force force resource update through delete/recreate if needed --no-hooks prevent hooks from running during rollback @@ -40,6 +41,7 @@ helm rollback [flags] [RELEASE] [REVISION] --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -47,4 +49,4 @@ helm rollback [flags] [RELEASE] [REVISION] ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_search.md b/docs/helm/helm_search.md index 15b03589d..6dec418c3 100644 --- a/docs/helm/helm_search.md +++ b/docs/helm/helm_search.md @@ -47,6 +47,7 @@ helm search [keyword] --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -54,4 +55,5 @@ helm search [keyword] ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 24-Apr-2018 + +###### Auto generated by spf13/cobra on 17-Jun-2018 \ No newline at end of file diff --git a/docs/helm/helm_serve.md b/docs/helm/helm_serve.md index 90ebb6da9..e300ee633 100644 --- a/docs/helm/helm_serve.md +++ b/docs/helm/helm_serve.md @@ -39,6 +39,7 @@ helm serve --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -46,4 +47,4 @@ helm serve ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_status.md b/docs/helm/helm_status.md index 02ec0ad66..5317875e6 100644 --- a/docs/helm/helm_status.md +++ b/docs/helm/helm_status.md @@ -39,6 +39,7 @@ helm status [flags] RELEASE_NAME --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -46,4 +47,4 @@ helm status [flags] RELEASE_NAME ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_template.md b/docs/helm/helm_template.md index 3a4e9ce4a..f456f74be 100644 --- a/docs/helm/helm_template.md +++ b/docs/helm/helm_template.md @@ -26,6 +26,7 @@ helm template [flags] CHART ``` -x, --execute stringArray only execute the given templates + --is-upgrade set .Release.IsUpgrade instead of .Release.IsInstall --kube-version string kubernetes version used as Capabilities.KubeVersion.Major/Minor (default "1.9") -n, --name string release name (default "RELEASE-NAME") --name-template string specify template used to name the release @@ -33,6 +34,7 @@ helm template [flags] CHART --notes show the computed NOTES.txt file as well --output-dir string writes the executed templates to files in output-dir instead of stdout --set stringArray set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2) + --set-file stringArray set values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2) --set-string stringArray set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2) -f, --values valueFiles specify values in a YAML file (can specify multiple) (default []) ``` @@ -44,6 +46,7 @@ helm template [flags] CHART --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -51,4 +54,4 @@ helm template [flags] CHART ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 9-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jul-2018 diff --git a/docs/helm/helm_test.md b/docs/helm/helm_test.md index 062244e73..688b67a34 100644 --- a/docs/helm/helm_test.md +++ b/docs/helm/helm_test.md @@ -35,6 +35,7 @@ helm test [RELEASE] --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -42,4 +43,4 @@ helm test [RELEASE] ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_upgrade.md b/docs/helm/helm_upgrade.md index c2882265e..ecd51e65c 100644 --- a/docs/helm/helm_upgrade.md +++ b/docs/helm/helm_upgrade.md @@ -14,8 +14,10 @@ a packaged chart, or a fully qualified URL. For chart references, the latest version will be specified unless the '--version' flag is set. To override values in a chart, use either the '--values' flag and pass in a file -or use the '--set' flag and pass configuration from the command line, to force string -values, use '--set-string'. +or use the '--set' flag and pass configuration from the command line. To force string +values in '--set', use '--set-string' instead. In case a value is large and therefore +you want not to use neither '--values' nor '--set', use '--set-file' to read the +single large value from file. You can specify the '--values'/'-f' flag multiple times. The priority will be given to the last (right-most) file specified. For example, if both myvalues.yaml and override.yaml @@ -39,6 +41,7 @@ helm upgrade [RELEASE] [CHART] ``` --ca-file string verify certificates of HTTPS-enabled servers using this CA bundle --cert-file string identify HTTPS client using this SSL certificate file + --description string specify the description to use for the upgrade, rather than the default --devel use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored. --dry-run simulate an upgrade --force force resource update through delete/recreate if needed @@ -53,6 +56,7 @@ helm upgrade [RELEASE] [CHART] --reset-values when upgrading, reset the values to the ones built into the chart --reuse-values when upgrading, reuse the last release's values and merge in any overrides from the command line via --set and -f. If '--reset-values' is specified, this is ignored. --set stringArray set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2) + --set-file stringArray set values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2) --set-string stringArray set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2) --timeout int time in seconds to wait for any individual Kubernetes operation (like Jobs for hooks) (default 300) --tls enable TLS for request @@ -74,6 +78,7 @@ helm upgrade [RELEASE] [CHART] --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -81,4 +86,4 @@ helm upgrade [RELEASE] [CHART] ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 4-Apr-2018 +###### Auto generated by spf13/cobra on 17-May-2018 diff --git a/docs/helm/helm_verify.md b/docs/helm/helm_verify.md index bc5343937..866b3fbd8 100644 --- a/docs/helm/helm_verify.md +++ b/docs/helm/helm_verify.md @@ -33,6 +33,7 @@ helm verify [flags] PATH --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -40,4 +41,4 @@ helm verify [flags] PATH ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/helm/helm_version.md b/docs/helm/helm_version.md index 1f48cceba..61636c404 100644 --- a/docs/helm/helm_version.md +++ b/docs/helm/helm_version.md @@ -48,6 +48,7 @@ helm version --home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm") --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use + --kubeconfig string absolute path to the kubeconfig file to use --tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300) --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -55,4 +56,4 @@ helm version ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 8-Mar-2018 +###### Auto generated by spf13/cobra on 17-Jun-2018 diff --git a/docs/install.md b/docs/install.md index 17905a805..52b55baef 100755 --- a/docs/install.md +++ b/docs/install.md @@ -24,6 +24,15 @@ can be manually downloaded and installed. From there, you should be able to run the client: `helm help`. +### From Snap (Linux) + +The Snap package for Helm is maintained by +[Snapcrafters](https://github.com/snapcrafters/helm). + +``` +$ sudo snap install helm +``` + ### From Homebrew (macOS) Members of the Kubernetes community have contributed a Helm formula build to @@ -122,6 +131,7 @@ You can explicitly tell `helm init` to... - Install a particular image (version) with `--tiller-image` - Install to a particular cluster with `--kube-context` - Install into a particular namespace with `--tiller-namespace` +- Install Tiller with a Service Account with `--service-account` (for [RBAC enabled clusters](securing_installation.md#rbac)) Once Tiller is installed, running `helm version` should show you both the client and server version. (If it shows only the client version, diff --git a/docs/kubernetes_distros.md b/docs/kubernetes_distros.md index 8b80519ec..bb14043da 100644 --- a/docs/kubernetes_distros.md +++ b/docs/kubernetes_distros.md @@ -18,8 +18,9 @@ Hyperkube you may need to do some manual configuration. ## GKE -Google's GKE hosted Kubernetes platform is known to work with Helm, and requires -no additional configuration. +Google's GKE hosted Kubernetes platform enables RBAC by default. You will need to create a service account for tiller, and use the --service-account flag when initializing the helm server. + +See [Tiller and role-based access control](https://docs.helm.sh/using_helm/#role-based-access-control) for more information. ## Ubuntu with 'kubeadm' @@ -48,4 +49,3 @@ Helm Client and Helm Server (Tiller) are pre-installed with [Platform9 Managed K Helm (both client and server) has been tested and is working on Mesospheres DC/OS 1.11 Kubernetes platform, and requires no additional configuration. - diff --git a/docs/logos/helm-blue-vector.svg b/docs/logos/helm-blue-vector.svg new file mode 100644 index 000000000..45f2c2f86 --- /dev/null +++ b/docs/logos/helm-blue-vector.svg @@ -0,0 +1,43 @@ + + + + +logo +Created with Sketch. + + + + + + diff --git a/docs/logos/helm-white-vector.svg b/docs/logos/helm-white-vector.svg new file mode 100644 index 000000000..0f09be31e --- /dev/null +++ b/docs/logos/helm-white-vector.svg @@ -0,0 +1,43 @@ + + + + +logo white +Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/logos/helm.svg b/docs/logos/helm.svg new file mode 100644 index 000000000..2d8858e93 --- /dev/null +++ b/docs/logos/helm.svg @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/quickstart.md b/docs/quickstart.md index 52a7c800f..8622137b2 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -65,7 +65,7 @@ This will install Tiller into the Kubernetes cluster you saw with **TIP:** When you want to upgrade Tiller, just run `helm init --upgrade`. -By default, when Tiller is installed,it does not have authentication enabled. +By default, when Tiller is installed, it does not have authentication enabled. To learn more about configuring strong TLS authentication for Tiller, consult [the Tiller TLS guide](tiller_ssl.md). diff --git a/docs/rbac.md b/docs/rbac.md index 2a3dfe7a0..4af36203c 100644 --- a/docs/rbac.md +++ b/docs/rbac.md @@ -14,11 +14,6 @@ Once you have satisfied the pre-requisite and have a service account with the co ### Example: Service account with cluster-admin role -```console -$ kubectl create serviceaccount tiller --namespace kube-system -serviceaccount "tiller" created -``` - In `rbac-config.yaml`: ```yaml @@ -71,7 +66,7 @@ metadata: name: tiller-manager namespace: tiller-world rules: -- apiGroups: ["", "extensions", "apps"] +- apiGroups: ["", "batch", "extensions", "apps"] resources: ["*"] verbs: ["*"] ``` diff --git a/docs/related.md b/docs/related.md index 997e3f01d..bac9e899b 100644 --- a/docs/related.md +++ b/docs/related.md @@ -16,6 +16,7 @@ or [pull request](https://github.com/kubernetes/helm/pulls). - [GitLab, Consumer Driven Contracts, Helm and Kubernetes](https://medium.com/@enxebre/gitlab-consumer-driven-contracts-helm-and-kubernetes-b7235a60a1cb#.xwp1y4tgi) - [Writing a Helm Chart](https://www.influxdata.com/packaged-kubernetes-deployments-writing-helm-chart/) - [Creating a Helm Plugin in 3 Steps](http://technosophos.com/2017/03/21/creating-a-helm-plugin.html) +- [Awesome Helm](https://github.com/cdwv/awesome-helm) - List of awesome Helm resources ## Video, Audio, and Podcast @@ -38,6 +39,7 @@ or [pull request](https://github.com/kubernetes/helm/pulls). - [helm-secrets](https://github.com/futuresimple/helm-secrets) - Plugin to manage and store secrets safely - [helm-edit](https://github.com/mstrzele/helm-edit) - Plugin for editing release's values - [helm-gcs](https://github.com/nouney/helm-gcs) - Plugin to manage repositories on Google Cloud Storage +- [helm-cos](https://github.com/imroc/helm-cos) - Plugin to manage repositories on Tencent Cloud Object Storage - [helm-github](https://github.com/sagansystems/helm-github) - Plugin to install Helm Charts from Github repositories - [helm-monitor](https://github.com/ContainerSolutions/helm-monitor) - Plugin to monitor a release and rollback based on Prometheus/ElasticSearch query - [helm-k8comp](https://github.com/cststack/k8comp) - Plugin to create Helm Charts from hiera using k8comp diff --git a/docs/release_checklist.md b/docs/release_checklist.md index d678e7748..fcd3429ad 100644 --- a/docs/release_checklist.md +++ b/docs/release_checklist.md @@ -2,9 +2,36 @@ **IMPORTANT**: If your experience deviates from this document, please document the changes to keep it up-to-date. +## Release Meetings +As part of the release process, two of the weekly developer calls will be co-opted +as "release meetings." + +### Start of the Release Cycle +The first developer call after a release will be used as the release meeting to +start the next release cycle. During this meeting, the following items must be +identified: + +- Release date +- Goals/Objectives for this release +- The release manager (basically whoever is going to cut the release) +- Any other important details for the community + +All of this information should be added to the GitHub milestone for the given +release. This should give the community and maintainers a clear set of guidelines +to follow when choosing whether or not to add issues and PRs to a given release. + +### End (almost) of the Release Cycle +The developer call closest to two weeks before the scheduled release date will +be used to review any remaining PRs that should be pulled into the release. This +is the place to debate whether or not we should wait before cutting a release and +any other concerns. At the end of this meeting, if the release date has not been +pushed out, the first RC should be cut. Subsequent developer calls in between this +meeting and the release date should have some time set aside to see if any bugs +were found. Once the release date is reached, the final release can be cut + ## A Maintainer's Guide to Releasing Helm -So you're in charge of a new release for helm? Cool. Here's what to do... +So you're in charge of a new release for Helm? Cool. Here's what to do... ![TODO: Nothing](images/nothing.png) @@ -24,8 +51,8 @@ In this doc, we are going to reference a few environment variables as well, whic ```shell export RELEASE_NAME=vX.Y.0 -export RELEASE_BRANCH_NAME="release-$RELEASE_NAME" -export RELEASE_CANDIDATE_NAME="$RELEASE_NAME-rc1" +export RELEASE_BRANCH_NAME="release-X.Y" +export RELEASE_CANDIDATE_NAME="$RELEASE_NAME-rc.1" ``` If you are creating a patch release, you may want to use the following instead: @@ -34,7 +61,7 @@ If you are creating a patch release, you may want to use the following instead: export PREVIOUS_PATCH_RELEASE=vX.Y.Z export RELEASE_NAME=vX.Y.Z+1 export RELEASE_BRANCH_NAME="release-X.Y" -export RELEASE_CANDIDATE_NAME="$RELEASE_NAME-rc1" +export RELEASE_CANDIDATE_NAME="$RELEASE_NAME-rc.1" ``` ## 1. Create the Release Branch @@ -94,8 +121,6 @@ index 2109a0a..6f5a1a4 100644 BuildMetadata = "unreleased" ``` -For patch releases, the old version number will be the latest patch release, so just bump the patch number, incrementing Z by one. - ```shell git add . git commit -m "bump version to $RELEASE_CANDIDATE_NAME" @@ -141,7 +166,7 @@ wget https://kubernetes-helm.storage.googleapis.com/helm-$RELEASE_CANDIDATE_NAME windows/amd64, using PowerShell: ```shell -PS C:\> Invoke-WebRequest -Uri "https://kubernetes-helm.storage.googleapis.com/helm-$RELEASE_CANDIDATE_NAME-windows-amd64.tar.gz" -OutFile "helm-$ReleaseCandidateName-windows-amd64.tar.gz" +PS C:\> Invoke-WebRequest -Uri "https://kubernetes-helm.storage.googleapis.com/helm-$RELEASE_CANDIDATE_NAME-windows-amd64.zip" -OutFile "helm-$ReleaseCandidateName-windows-amd64.zip" ``` Then, unpack and move the binary to somewhere on your $PATH, or move it somewhere and add it to your $PATH (e.g. /usr/local/bin/helm for linux/macOS, C:\Program Files\helm\helm.exe for Windows). @@ -163,7 +188,7 @@ You will also want to update the release version number and the CHANGELOG as we After that, tag it and notify users of the new release candidate: ```shell -export RELEASE_CANDIDATE_NAME="$RELEASE_NAME-rc2" +export RELEASE_CANDIDATE_NAME="$RELEASE_NAME-rc.2" git tag --sign --annotate "${RELEASE_CANDIDATE_NAME}" --message "Helm release ${RELEASE_CANDIDATE_NAME}" git push upstream $RELEASE_CANDIDATE_NAME ``` @@ -193,7 +218,7 @@ An example release note for a minor release would look like this: Helm vX.Y.Z is a feature release. This release, we focused on . Users are encouraged to upgrade for the best experience. -The community keeps growing, and we'd love to see you there. +The community keeps growing, and we'd love to see you there! - Join the discussion in [Kubernetes Slack](https://slack.k8s.io/): - `#helm-users` for questions and just to hang out @@ -205,9 +230,13 @@ The community keeps growing, and we'd love to see you there. Download Helm X.Y. The common platform binaries are here: -- [OSX](https://storage.googleapis.com/kubernetes-helm/helm-vX.Y.Z-darwin-amd64.tar.gz) -- [Linux](https://storage.googleapis.com/kubernetes-helm/helm-vX.Y.Z-linux-amd64.tar.gz) -- [Windows](https://storage.googleapis.com/kubernetes-helm/helm-vX.Y.Z-windows-amd64.tar.gz) +- [MacOS amd64](https://storage.googleapis.com/kubernetes-helm/helm-vX.Y.Z-darwin-amd64.tar.gz) ([checksum](https://storage.googleapis.com/kubernetes-helm/helm-vX.Y.Z-darwin-amd64.tar.gz.sha256)) +- [Linux amd64](https://storage.googleapis.com/kubernetes-helm/helm-vX.Y.Z-linux-amd64.tar.gz) ([checksum](https://storage.googleapis.com/kubernetes-helm/helm-vX.Y.Z-linux-amd64.tar.gz.sha256)) +- [Linux arm](https://storage.googleapis.com/kubernetes-helm/helm-vX.Y.Z-linux-arm.tar.gz) ([checksum](https://storage.googleapis.com/kubernetes-helm/helm-vX.Y.Z-linux-arm.tar.gz.sha256)) +- [Linux arm64](https://storage.googleapis.com/kubernetes-helm/helm-vX.Y.Z-linux-arm64.tar.gz) ([checksum](https://storage.googleapis.com/kubernetes-helm/helm-vX.Y.Z-linux-arm64.tar.gz.sha256)) +- [Linux i386](https://storage.googleapis.com/kubernetes-helm/helm-vX.Y.Z-linux-386.tar.gz) ([checksum](https://storage.googleapis.com/kubernetes-helm/helm-vX.Y.Z-linux-386.tar.gz.sha256)) +- [Linux ppc64le](https://storage.googleapis.com/kubernetes-helm/helm-vX.Y.Z-linux-ppc64le.tar.gz) ([checksum](https://storage.googleapis.com/kubernetes-helm/helm-vX.Y.Z-linux-ppc64le.tar.gz.sha256)) +- [Windows amd64](https://storage.googleapis.com/kubernetes-helm/helm-vX.Y.Z-windows-amd64.zip) ([checksum](https://storage.googleapis.com/kubernetes-helm/helm-vX.Y.Z-windows-amd64.zip.sha256)) Once you have the client installed, upgrade Tiller with `helm init --upgrade`. @@ -233,7 +262,7 @@ git log --no-merges --pretty=format:'- %s %H (%aN)' $RELEASE_NAME $PREVIOUS_RELE Once finished, go into GitHub and edit the release notes for the tagged release with the notes written here. -## 9. Evangelize +## 8. Evangelize Congratulations! You're done. Go grab yourself a $DRINK_OF_CHOICE. You've earned it. diff --git a/docs/securing_installation.md b/docs/securing_installation.md index 4083bf188..a489cc837 100644 --- a/docs/securing_installation.md +++ b/docs/securing_installation.md @@ -34,7 +34,7 @@ There are four main areas to consider when securing a tiller installation: ### RBAC -Recent versions of Kubernetes employ a [role-based access control (or RBAC)](https://en.wikipedia.org/wiki/Role-based_access_control) system (as do modern operating systems) to help mitigate the damage that can done if credentials are misused or bugs exist. Even where an identity is hijacked, the identity has only so many permissions to a controlled space. This effectively adds a layer of security to limit the scope of any attack with that identity. +Recent versions of Kubernetes employ a [role-based access control (or RBAC)](https://en.wikipedia.org/wiki/Role-based_access_control) system (as do modern operating systems) to help mitigate the damage that can be done if credentials are misused or bugs exist. Even where an identity is hijacked, the identity has only so many permissions to a controlled space. This effectively adds a layer of security to limit the scope of any attack with that identity. Helm and Tiller are designed to install, remove, and modify logical applications that can contain many services interacting together. As a result, often its usefulness involves cluster-wide operations, which in a multitenant cluster means that great care must be taken with access to a cluster-wide Tiller installation to prevent improper activity. @@ -65,7 +65,7 @@ For historical reasons, Tiller stores its release information in ConfigMaps. We Secrets are the Kubernetes accepted mechanism for saving configuration data that is considered sensitive. While secrets don't themselves offer many protections, Kubernetes cluster management software often treats them differently than other objects. Thus, we suggest using secrets to store releases. -Enabling this feature currently requires setting the `--storage=secret` flag in the tiller-deploy deployment. This entails directly modifying the deployment or using `helm init --override=...`, as no helm init flag is currently available to do this for you. For more information, see [Using --override](install.md#using---override). +Enabling this feature currently requires setting the `--storage=secret` flag in the tiller-deploy deployment. This entails directly modifying the deployment or using `helm init --override 'spec.template.spec.containers[0].command'='{/tiller,--storage=secret}'`, as no helm init flag is currently available to do this for you. ### Thinking about Charts @@ -93,6 +93,7 @@ If these steps are followed, an example `helm init` command might look something ```bash $ helm init \ +--override 'spec.template.spec.containers[0].command'='{/tiller,--storage=secret}' \ --tiller-tls \ --tiller-tls-verify \ --tiller-tls-cert=cert.pem \ @@ -101,7 +102,7 @@ $ helm init \ --service-account=accountname ``` -This command will start Tiller with both strong authentication over gRPC, and a service account to which RBAC policies have been applied. +This command will start Tiller with strong authentication over gRPC, release information stored in a Kubernetes Secret, and a service account to which RBAC policies have been applied. diff --git a/docs/tiller_ssl.md b/docs/tiller_ssl.md index d7f0166c4..6db195507 100644 --- a/docs/tiller_ssl.md +++ b/docs/tiller_ssl.md @@ -148,10 +148,10 @@ $ openssl req -key helm.key.pem -new -sha256 -out helm.csr.pem (In rare cases, we've had to add the `-nodes` flag when generating the request.) -Now we sign each of these CSRs with the CA certificate we created: +Now we sign each of these CSRs with the CA certificate we created (adjust the days parameter to suit your requirements): ```console -$ openssl x509 -req -CA ca.cert.pem -CAkey ca.key.pem -CAcreateserial -in tiller.csr.pem -out tiller.cert.pem +$ openssl x509 -req -CA ca.cert.pem -CAkey ca.key.pem -CAcreateserial -in tiller.csr.pem -out tiller.cert.pem -days 365 Signature ok subject=/C=US/ST=CO/L=Boulder/O=Tiller Server/CN=tiller-server Getting CA Private Key @@ -161,7 +161,7 @@ Enter pass phrase for ca.key.pem: And again for the client certificate: ```console -$ openssl x509 -req -CA ca.cert.pem -CAkey ca.key.pem -CAcreateserial -in helm.csr.pem -out helm.cert.pem +$ openssl x509 -req -CA ca.cert.pem -CAkey ca.key.pem -CAcreateserial -in helm.csr.pem -out helm.cert.pem -days 365 ``` At this point, the important files for us are these: @@ -284,6 +284,13 @@ the host name that Helm connects to matches the host name on the certificate. In some cases this is awkward, since Helm will connect over localhost, or the FQDN is not available for public resolution. +*If I use `--tls-verify` on the client, I get `Error: x509: certificate has expired or is not yet valid`* + +Your helm certificate has expired, you need to sign a new certificate using your private key and the CA (and consider increasing the number of days) + +If your tiller certificate has expired, you'll need to sign a new certificate, base64 encode it and update the Tiller Secret: +`kubectl edit secret tiller-secret` + ## References https://github.com/denji/golang-tls diff --git a/docs/using_helm.md b/docs/using_helm.md index 6bf7bc40a..b7fec60ed 100755 --- a/docs/using_helm.md +++ b/docs/using_helm.md @@ -43,7 +43,7 @@ carefully curated and maintained charts. This chart repository is named You can see which charts are available by running `helm search`: -``` +```console $ helm search NAME VERSION DESCRIPTION stable/drupal 0.3.2 One of the most versatile open source content m... @@ -56,7 +56,7 @@ stable/mysql 0.1.0 Chart for MySQL With no filter, `helm search` shows you all of the available charts. You can narrow down your results by searching with a filter: -``` +```console $ helm search mysql NAME VERSION DESCRIPTION stable/mysql 0.1.0 Chart for MySQL @@ -69,7 +69,7 @@ Why is `mariadb` in the list? Because its package description relates it to MySQL. We can use `helm inspect chart` to see this: -``` +```console $ helm inspect stable/mariadb Fetched stable/mariadb to mariadb-0.5.1.tgz description: Chart for MariaDB @@ -91,7 +91,7 @@ package you want to install, you can use `helm install` to install it. To install a new package, use the `helm install` command. At its simplest, it takes only one argument: The name of the chart. -``` +```console $ helm install stable/mariadb Fetched stable/mariadb-0.3.0 to /Users/mattbutcher/Code/Go/src/k8s.io/helm/mariadb-0.3.0.tgz happy-panda @@ -139,7 +139,7 @@ may take a long time to install into the cluster. To keep track of a release's state, or to re-read configuration information, you can use `helm status`: -``` +```console $ helm status happy-panda Last Deployed: Wed Sep 28 12:32:28 2016 Namespace: default @@ -227,7 +227,7 @@ There are two ways to pass configuration data during install: - `--values` (or `-f`): Specify a YAML file with overrides. This can be specified multiple times and the rightmost file will take precedence -- `--set`: Specify overrides on the command line. +- `--set` (and its variants `--set-string` and `--set-file`): Specify overrides on the command line. If both are used, `--set` values are merged into `--values` with higher precedence. Overrides specified with `--set` are persisted in a configmap. Values that have been @@ -285,7 +285,7 @@ servers: ``` Sometimes you need to use special characters in your `--set` lines. You can use -a backslash to escape the characters; `--set name=value1\,value2` will become: +a backslash to escape the characters; `--set name="value1\,value2"` will become: ```yaml name: "value1,value2" @@ -304,6 +304,35 @@ Deeply nested data structures can be difficult to express using `--set`. Chart designers are encouraged to consider the `--set` usage when designing the format of a `values.yaml` file. +Helm will cast certain values specified with `--set` to integers. +For example, `--set foo=true` results Helm to cast `true` into an int64 value. +In case you want a string, use a `--set`'s variant named `--set-string`. `--set-string foo=true` results in a string value of `"true"`. + +`--set-file key=filepath` is another variant of `--set`. +It reads the file and use its content as a value. +An example use case of it is to inject a multi-line text into values without dealing with indentation in YAML. +Say you want to create a [brigade](https://github.com/Azure/brigade) project with certain value containing 5 lines JavaScript code, you might write a `values.yaml` like: + +```yaml +defaultScript: | + const { events, Job } = require("brigadier") + function run(e, project) { + console.log("hello default script") + } + events.on("run", run) +``` + +Being embedded in a YAML, this makes it harder for you to use IDE features and testing framework and so on that supports writing code. +Instead, you can use `--set-file defaultScript=brigade.js` with `brigade.js` containing: + +```javascript +const { events, Job } = require("brigadier") +function run(e, project) { + console.log("hello default script") +} +events.on("run", run) +``` + ### More Installation Methods The `helm install` command can install from several sources: @@ -392,14 +421,14 @@ is not a full list of cli flags. To see a description of all flags, just run When it is time to uninstall or delete a release from the cluster, use the `helm delete` command: -``` +```console $ helm delete happy-panda ``` This will remove the release from the cluster. You can see all of your currently deployed releases with the `helm list` command: -``` +```console $ helm list NAME VERSION UPDATED STATUS CHART inky-cat 1 Wed Sep 28 12:59:46 2016 DEPLOYED alpine-0.1.0 diff --git a/glide.lock b/glide.lock index a91c31b7b..eef256fd1 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: 4023a1644d60060fbf2fdbbe5b73cbb4b957eb686ce925640d102db2d1858676 -updated: 2018-04-14T11:27:34.604716498-04:00 +hash: 41304a2eabc68608507c034304ce87cbf76924c90caaafbe42a9be16e6265868 +updated: 2018-06-19T14:50:56.238468981-05:00 imports: - name: cloud.google.com/go version: 3b1ae45394a234c385be014e9a488f2bb6eef821 @@ -89,7 +89,7 @@ imports: subpackages: - spdy - name: github.com/evanphx/json-patch - version: 944e07253867aacae43c04b2e6a239005443f33a + version: 94e38aa1586e8a6c8a75770bddf5ff84c48a106b - name: github.com/exponent-io/jsonpath version: d6023ce2651d8eafb5c75bb0c7167536102ec9f5 - name: github.com/fatih/camelcase @@ -250,7 +250,7 @@ imports: - name: github.com/spf13/pflag version: 9ff6c6923cfffbcd502984b8e0c80539a94968b7 - name: github.com/technosophos/moniker - version: ab470f5e105a44d0c87ea21bacd6a335c4816d83 + version: a5dbd03a2245d554160e3ae6bfdcf969fe58b431 - name: golang.org/x/crypto version: 81e90905daefcd6fd217b62423c0908922eadb30 subpackages: @@ -359,9 +359,9 @@ imports: - json - jwt - name: gopkg.in/yaml.v2 - version: 53feefa2559fb8dfa8d81baad31be332c97d6c77 + version: 670d4cfef0544295bc27a114dbac37980d83185a - name: k8s.io/api - version: c699ec51538f0cfd4afa8bfcfe1e0779cafbe666 + version: 8b7507fac302640dd5f1efbf9643199952cc58db subpackages: - admission/v1beta1 - admissionregistration/v1alpha1 @@ -398,7 +398,7 @@ imports: subpackages: - pkg/features - name: k8s.io/apimachinery - version: 54101a56dda9a0962bc48751c058eb4c546dcbb9 + version: f6313580a4d36c7c74a3d845dda6e116642c4f90 subpackages: - pkg/api/equality - pkg/api/errors @@ -455,7 +455,7 @@ imports: - third_party/forked/golang/netutil - third_party/forked/golang/reflect - name: k8s.io/apiserver - version: ea53f8588c655568158b4ff53f5ec6fa4ebfc332 + version: f7914ed3085badf66a1b6f3a5218ada28f7bd084 subpackages: - pkg/apis/audit - pkg/authentication/authenticator @@ -640,12 +640,12 @@ imports: - util/retry - util/workqueue - name: k8s.io/kube-openapi - version: 50ae88d24ede7b8bad68e23c805b5d3da5c8abaf + version: 39cb288412c48cb533ba4be5d6c28620b9a0c1b4 subpackages: - pkg/util/proto - pkg/util/proto/validation - name: k8s.io/kubernetes - version: baab3992147260d47cb59b9c485a24fdeff2e457 + version: 32ac1c9073b132b8ba18aa830f46b77dcceb0723 subpackages: - pkg/api/events - pkg/api/legacyscheme @@ -767,7 +767,6 @@ imports: - pkg/client/clientset_generated/internalclientset/typed/settings/internalversion/fake - pkg/client/clientset_generated/internalclientset/typed/storage/internalversion - pkg/client/clientset_generated/internalclientset/typed/storage/internalversion/fake - - pkg/client/conditions - pkg/cloudprovider - pkg/controller - pkg/controller/daemon diff --git a/glide.yaml b/glide.yaml index fc3dcc37d..a101a11ee 100644 --- a/glide.yaml +++ b/glide.yaml @@ -13,7 +13,7 @@ import: - package: github.com/imdario/mergo version: 6633656539c1639d9d78127b7d47c622b5d7b6dc - package: github.com/Masterminds/sprig - version: ^2.14.1 + version: ^2.15.0 - package: github.com/ghodss/yaml - package: github.com/Masterminds/semver version: ~1.3.1 diff --git a/pkg/chartutil/capabilities.go b/pkg/chartutil/capabilities.go index d26aa1707..d7e660b8a 100644 --- a/pkg/chartutil/capabilities.go +++ b/pkg/chartutil/capabilities.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/chartutil/capabilities_test.go b/pkg/chartutil/capabilities_test.go index ac20f0038..1f7020a39 100644 --- a/pkg/chartutil/capabilities_test.go +++ b/pkg/chartutil/capabilities_test.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/chartutil/chartfile.go b/pkg/chartutil/chartfile.go index c2879cdae..f997d15fe 100644 --- a/pkg/chartutil/chartfile.go +++ b/pkg/chartutil/chartfile.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/chartutil/chartfile_test.go b/pkg/chartutil/chartfile_test.go index 5b36dc955..e55fbbd48 100755 --- a/pkg/chartutil/chartfile_test.go +++ b/pkg/chartutil/chartfile_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/chartutil/create.go b/pkg/chartutil/create.go index 30c6310b2..97056c175 100644 --- a/pkg/chartutil/create.go +++ b/pkg/chartutil/create.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -129,8 +129,8 @@ kind: Ingress metadata: name: {{ $fullName }} labels: - app: {{ template ".name" . }} - chart: {{ template ".chart" . }} + app: {{ include ".name" . }} + chart: {{ include ".chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} {{- with .Values.ingress.annotations }} @@ -164,22 +164,22 @@ spec: const defaultDeployment = `apiVersion: apps/v1beta2 kind: Deployment metadata: - name: {{ template ".fullname" . }} + name: {{ include ".fullname" . }} labels: - app: {{ template ".name" . }} - chart: {{ template ".chart" . }} + app: {{ include ".name" . }} + chart: {{ include ".chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: - app: {{ template ".name" . }} + app: {{ include ".name" . }} release: {{ .Release.Name }} template: metadata: labels: - app: {{ template ".name" . }} + app: {{ include ".name" . }} release: {{ .Release.Name }} spec: containers: @@ -217,10 +217,10 @@ spec: const defaultService = `apiVersion: v1 kind: Service metadata: - name: {{ template ".fullname" . }} + name: {{ include ".fullname" . }} labels: - app: {{ template ".name" . }} - chart: {{ template ".chart" . }} + app: {{ include ".name" . }} + chart: {{ include ".chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} spec: @@ -231,7 +231,7 @@ spec: protocol: TCP name: http selector: - app: {{ template ".name" . }} + app: {{ include ".name" . }} release: {{ .Release.Name }} ` @@ -241,16 +241,16 @@ const defaultNotes = `1. Get the application URL by running these commands: http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }} {{- end }} {{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template ".fullname" . }}) + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include ".fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get svc -w {{ template ".fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template ".fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + You can watch the status of by running 'kubectl get svc -w {{ include ".fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include ".fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') echo http://$SERVICE_IP:{{ .Values.service.port }} {{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template ".name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ include ".name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") echo "Visit http://127.0.0.1:8080 to use your application" kubectl port-forward $POD_NAME 8080:80 {{- end }} diff --git a/pkg/chartutil/create_test.go b/pkg/chartutil/create_test.go index e9af83ad2..96c467e7e 100644 --- a/pkg/chartutil/create_test.go +++ b/pkg/chartutil/create_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/chartutil/doc.go b/pkg/chartutil/doc.go index 1190d968d..cb3f5d1f1 100644 --- a/pkg/chartutil/doc.go +++ b/pkg/chartutil/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/chartutil/expand.go b/pkg/chartutil/expand.go index 126e14e80..1d49b159f 100644 --- a/pkg/chartutil/expand.go +++ b/pkg/chartutil/expand.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/chartutil/files.go b/pkg/chartutil/files.go index a09bb8f43..c5496a8b0 100644 --- a/pkg/chartutil/files.go +++ b/pkg/chartutil/files.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/chartutil/files_test.go b/pkg/chartutil/files_test.go index 731c82e6f..1488b7986 100644 --- a/pkg/chartutil/files_test.go +++ b/pkg/chartutil/files_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/chartutil/load.go b/pkg/chartutil/load.go index c5246b8d7..b3daefac7 100644 --- a/pkg/chartutil/load.go +++ b/pkg/chartutil/load.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/chartutil/load_test.go b/pkg/chartutil/load_test.go index 454500489..5cb15fbdc 100644 --- a/pkg/chartutil/load_test.go +++ b/pkg/chartutil/load_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/chartutil/requirements.go b/pkg/chartutil/requirements.go index 6ef6508d9..566123122 100644 --- a/pkg/chartutil/requirements.go +++ b/pkg/chartutil/requirements.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/chartutil/requirements_test.go b/pkg/chartutil/requirements_test.go index 24388f86c..0afde17e1 100644 --- a/pkg/chartutil/requirements_test.go +++ b/pkg/chartutil/requirements_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/chartutil/save.go b/pkg/chartutil/save.go index bff32dde5..9b85d0714 100644 --- a/pkg/chartutil/save.go +++ b/pkg/chartutil/save.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import ( "io/ioutil" "os" "path/filepath" + "time" "github.com/ghodss/yaml" @@ -205,9 +206,10 @@ func writeTarContents(out *tar.Writer, c *chart.Chart, prefix string) error { func writeToTar(out *tar.Writer, name string, body []byte) error { // TODO: Do we need to create dummy parent directory names if none exist? h := &tar.Header{ - Name: name, - Mode: 0755, - Size: int64(len(body)), + Name: filepath.ToSlash(name), + Mode: 0755, + Size: int64(len(body)), + ModTime: time.Now(), } if err := out.WriteHeader(h); err != nil { return err diff --git a/pkg/chartutil/save_test.go b/pkg/chartutil/save_test.go index 5e1564299..0ec305e78 100644 --- a/pkg/chartutil/save_test.go +++ b/pkg/chartutil/save_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -17,10 +17,14 @@ limitations under the License. package chartutil import ( + "archive/tar" + "compress/gzip" + "io" "io/ioutil" "os" "strings" "testing" + "time" "github.com/golang/protobuf/ptypes/any" "k8s.io/helm/pkg/proto/hapi/chart" @@ -73,6 +77,82 @@ func TestSave(t *testing.T) { } } +func TestSavePreservesTimestamps(t *testing.T) { + // Test executes so quickly that if we don't subtract a second, the + // check will fail because `initialCreateTime` will be identical to the + // written timestamp for the files. + initialCreateTime := time.Now().Add(-1 * time.Second) + + tmp, err := ioutil.TempDir("", "helm-") + if err != nil { + t.Fatal(err) + } + defer os.RemoveAll(tmp) + + c := &chart.Chart{ + Metadata: &chart.Metadata{ + Name: "ahab", + Version: "1.2.3.4", + }, + Values: &chart.Config{ + Raw: "ship: Pequod", + }, + Files: []*any.Any{ + {TypeUrl: "scheherazade/shahryar.txt", Value: []byte("1,001 Nights")}, + }, + } + + where, err := Save(c, tmp) + if err != nil { + t.Fatalf("Failed to save: %s", err) + } + + allHeaders, err := retrieveAllHeadersFromTar(where) + if err != nil { + t.Fatalf("Failed to parse tar: %v", err) + } + + for _, header := range allHeaders { + if header.ModTime.Before(initialCreateTime) { + t.Fatalf("File timestamp not preserved: %v", header.ModTime) + } + } +} + +// We could refactor `load.go` to use this `retrieveAllHeadersFromTar` function +// as well, so we are not duplicating components of the code which iterate +// through the tar. +func retrieveAllHeadersFromTar(path string) ([]*tar.Header, error) { + raw, err := os.Open(path) + if err != nil { + return nil, err + } + defer raw.Close() + + unzipped, err := gzip.NewReader(raw) + if err != nil { + return nil, err + } + defer unzipped.Close() + + tr := tar.NewReader(unzipped) + headers := []*tar.Header{} + for { + hd, err := tr.Next() + if err == io.EOF { + break + } + + if err != nil { + return nil, err + } + + headers = append(headers, hd) + } + + return headers, nil +} + func TestSaveDir(t *testing.T) { tmp, err := ioutil.TempDir("", "helm-") if err != nil { diff --git a/pkg/chartutil/testdata/subpop/charts/subchart1/templates/service.yaml b/pkg/chartutil/testdata/subpop/charts/subchart1/templates/service.yaml index 3835a3d0b..e06d19b90 100644 --- a/pkg/chartutil/testdata/subpop/charts/subchart1/templates/service.yaml +++ b/pkg/chartutil/testdata/subpop/charts/subchart1/templates/service.yaml @@ -6,6 +6,8 @@ metadata: chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" namespace: "{{ .Release.Namespace }}" release-name: "{{ .Release.Name }}" + release-is-upgrade: "{{ .Release.IsUpgrade }}" + release-is-install: "{{ .Release.IsInstall }}" kube-version/major: "{{ .Capabilities.KubeVersion.Major }}" kube-version/minor: "{{ .Capabilities.KubeVersion.Minor }}" kube-version/gitversion: "v{{ .Capabilities.KubeVersion.Major }}.{{ .Capabilities.KubeVersion.Minor }}.0" diff --git a/pkg/chartutil/transform.go b/pkg/chartutil/transform.go index 7cbb754fb..fbee8e690 100644 --- a/pkg/chartutil/transform.go +++ b/pkg/chartutil/transform.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/chartutil/values.go b/pkg/chartutil/values.go index 66a2658d5..1ea7edd8c 100644 --- a/pkg/chartutil/values.go +++ b/pkg/chartutil/values.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/chartutil/values_test.go b/pkg/chartutil/values_test.go index d9b03c21a..f54b25827 100644 --- a/pkg/chartutil/values_test.go +++ b/pkg/chartutil/values_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/downloader/chart_downloader.go b/pkg/downloader/chart_downloader.go index 59b9d4d75..92c8f9165 100644 --- a/pkg/downloader/chart_downloader.go +++ b/pkg/downloader/chart_downloader.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/downloader/chart_downloader_test.go b/pkg/downloader/chart_downloader_test.go index 80efa77e8..5967eee70 100644 --- a/pkg/downloader/chart_downloader_test.go +++ b/pkg/downloader/chart_downloader_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/downloader/doc.go b/pkg/downloader/doc.go index fb54936b8..c70b2f695 100644 --- a/pkg/downloader/doc.go +++ b/pkg/downloader/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/downloader/manager.go b/pkg/downloader/manager.go index 9ee1f6f6d..67f9dc7bf 100644 --- a/pkg/downloader/manager.go +++ b/pkg/downloader/manager.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/downloader/manager_test.go b/pkg/downloader/manager_test.go index 1ff2a9c17..8c2377e47 100644 --- a/pkg/downloader/manager_test.go +++ b/pkg/downloader/manager_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/engine/doc.go b/pkg/engine/doc.go index 53c4084b0..63c036605 100644 --- a/pkg/engine/doc.go +++ b/pkg/engine/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/engine/engine.go b/pkg/engine/engine.go index 7a940fc84..e29e044f9 100644 --- a/pkg/engine/engine.go +++ b/pkg/engine/engine.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/engine/engine_test.go b/pkg/engine/engine_test.go index 8ffb3d87c..91a3fd795 100644 --- a/pkg/engine/engine_test.go +++ b/pkg/engine/engine_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/getter/doc.go b/pkg/getter/doc.go index fe51e4967..c53ef1ae0 100644 --- a/pkg/getter/doc.go +++ b/pkg/getter/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/getter/getter.go b/pkg/getter/getter.go index ca018884a..c595fec69 100644 --- a/pkg/getter/getter.go +++ b/pkg/getter/getter.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/getter/getter_test.go b/pkg/getter/getter_test.go index 6d38a0d28..d03c82686 100644 --- a/pkg/getter/getter_test.go +++ b/pkg/getter/getter_test.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/getter/httpgetter.go b/pkg/getter/httpgetter.go index 990cb8cc5..4987e951a 100644 --- a/pkg/getter/httpgetter.go +++ b/pkg/getter/httpgetter.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -81,19 +81,17 @@ func newHTTPGetter(URL, CertFile, KeyFile, CAFile string) (Getter, error) { // NewHTTPGetter constructs a valid http/https client as HttpGetter func NewHTTPGetter(URL, CertFile, KeyFile, CAFile string) (*HttpGetter, error) { var client HttpGetter + tr := &http.Transport{ + DisableCompression: true, + } if (CertFile != "" && KeyFile != "") || CAFile != "" { tlsConf, err := tlsutil.NewTLSConfig(URL, CertFile, KeyFile, CAFile) if err != nil { return &client, fmt.Errorf("can't create TLS config: %s", err.Error()) } - client.client = &http.Client{ - Transport: &http.Transport{ - TLSClientConfig: tlsConf, - Proxy: http.ProxyFromEnvironment, - }, - } - } else { - client.client = http.DefaultClient + tr.TLSClientConfig = tlsConf + tr.Proxy = http.ProxyFromEnvironment } + client.client = &http.Client{Transport: tr} return &client, nil } diff --git a/pkg/getter/httpgetter_test.go b/pkg/getter/httpgetter_test.go index ec730f401..fbe330390 100644 --- a/pkg/getter/httpgetter_test.go +++ b/pkg/getter/httpgetter_test.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -16,21 +16,29 @@ limitations under the License. package getter import ( + "io" "net/http" + "net/http/httptest" + "os" "path/filepath" + "strconv" "testing" ) +type TestFileHandler struct{} + +func (h *TestFileHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { + HandleClient(w, r) +} + func TestHTTPGetter(t *testing.T) { g, err := newHTTPGetter("http://example.com", "", "", "") if err != nil { t.Fatal(err) } - if hg, ok := g.(*HttpGetter); !ok { + if _, ok := g.(*HttpGetter); !ok { t.Fatal("Expected newHTTPGetter to produce an HttpGetter") - } else if hg.client != http.DefaultClient { - t.Fatal("Expected newHTTPGetter to return a default HTTP client.") } // Test with SSL: @@ -58,3 +66,42 @@ func TestHTTPGetter(t *testing.T) { t.Fatal("Expected newHTTPGetter to return a non-default HTTP client") } } + +func HandleClient(writer http.ResponseWriter, request *http.Request) { + f, _ := os.Open("testdata/sssd-0.1.0.tgz") + defer f.Close() + + b := make([]byte, 512) + f.Read(b) + //Get the file size + FileStat, _ := f.Stat() + FileSize := strconv.FormatInt(FileStat.Size(), 10) + + //Simulating improper header values from bitbucket + writer.Header().Set("Content-Type", "application/x-tar") + writer.Header().Set("Content-Encoding", "gzip") + writer.Header().Set("Content-Length", FileSize) + + f.Seek(0, 0) + io.Copy(writer, f) + return +} + +func TestHTTPGetterTarDownload(t *testing.T) { + h := &TestFileHandler{} + server := httptest.NewServer(h) + defer server.Close() + + g, err := newHTTPGetter(server.URL, "", "", "") + if err != nil { + t.Fatal(err) + } + + data, _ := g.Get(server.URL) + mimeType := http.DetectContentType(data.Bytes()) + + expectedMimeType := "application/x-gzip" + if mimeType != expectedMimeType { + t.Fatalf("Expected response with MIME type %s, but got %s", expectedMimeType, mimeType) + } +} diff --git a/pkg/getter/plugingetter.go b/pkg/getter/plugingetter.go index c747eef7f..8f2099de0 100644 --- a/pkg/getter/plugingetter.go +++ b/pkg/getter/plugingetter.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -69,6 +69,7 @@ func (p *pluginGetter) Get(href string) (*bytes.Buffer, error) { buf := bytes.NewBuffer(nil) prog.Stdout = buf prog.Stderr = os.Stderr + prog.Stdin = os.Stdin if err := prog.Run(); err != nil { if eerr, ok := err.(*exec.ExitError); ok { os.Stderr.Write(eerr.Stderr) diff --git a/pkg/getter/plugingetter_test.go b/pkg/getter/plugingetter_test.go index f1fe9bf29..9bfe6144d 100644 --- a/pkg/getter/plugingetter_test.go +++ b/pkg/getter/plugingetter_test.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/getter/testdata/sssd-0.1.0.tgz b/pkg/getter/testdata/sssd-0.1.0.tgz new file mode 100644 index 000000000..2f34fece6 Binary files /dev/null and b/pkg/getter/testdata/sssd-0.1.0.tgz differ diff --git a/pkg/helm/client.go b/pkg/helm/client.go index 465ca0af8..f9774392f 100644 --- a/pkg/helm/client.go +++ b/pkg/helm/client.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/helm/client_test.go b/pkg/helm/client_test.go index 95e044499..30d8e2002 100644 --- a/pkg/helm/client_test.go +++ b/pkg/helm/client_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/helm/environment/environment.go b/pkg/helm/environment/environment.go index 2980e6dc9..4241bbb8a 100644 --- a/pkg/helm/environment/environment.go +++ b/pkg/helm/environment/environment.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -49,6 +49,8 @@ type EnvSettings struct { Debug bool // KubeContext is the name of the kubeconfig context. KubeContext string + // KubeConfig is the path to an explicit kubeconfig file. This overwrites the value in $KUBECONFIG + KubeConfig string } // AddFlags binds flags to the given flagset. @@ -56,6 +58,7 @@ func (s *EnvSettings) AddFlags(fs *pflag.FlagSet) { fs.StringVar((*string)(&s.Home), "home", DefaultHelmHome, "location of your Helm config. Overrides $HELM_HOME") fs.StringVar(&s.TillerHost, "host", "", "address of Tiller. Overrides $HELM_HOST") fs.StringVar(&s.KubeContext, "kube-context", "", "name of the kubeconfig context to use") + fs.StringVar(&s.KubeConfig, "kubeconfig", "", "absolute path to the kubeconfig file to use") fs.BoolVar(&s.Debug, "debug", false, "enable verbose output") fs.StringVar(&s.TillerNamespace, "tiller-namespace", "kube-system", "namespace of Tiller") fs.Int64Var(&s.TillerConnectionTimeout, "tiller-connection-timeout", int64(300), "the duration (in seconds) Helm will wait to establish a connection to tiller") diff --git a/pkg/helm/environment/environment_test.go b/pkg/helm/environment/environment_test.go index 8f0caa388..35958e791 100644 --- a/pkg/helm/environment/environment_test.go +++ b/pkg/helm/environment/environment_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -35,8 +35,8 @@ func TestEnvSettings(t *testing.T) { envars map[string]string // expected values - home, host, ns, kcontext, plugins string - debug bool + home, host, ns, kcontext, kconfig, plugins string + debug bool }{ { name: "defaults", @@ -47,11 +47,12 @@ func TestEnvSettings(t *testing.T) { }, { name: "with flags set", - args: []string{"--home", "/foo", "--host=here", "--debug", "--tiller-namespace=myns"}, + args: []string{"--home", "/foo", "--host=here", "--debug", "--tiller-namespace=myns", "--kubeconfig", "/bar"}, home: "/foo", plugins: helmpath.Home("/foo").Plugins(), host: "here", ns: "myns", + kconfig: "/bar", debug: true, }, { @@ -111,6 +112,9 @@ func TestEnvSettings(t *testing.T) { if settings.KubeContext != tt.kcontext { t.Errorf("expected kube-context %q, got %q", tt.kcontext, settings.KubeContext) } + if settings.KubeConfig != tt.kconfig { + t.Errorf("expected kubeconfig %q, got %q", tt.kconfig, settings.KubeConfig) + } cleanup() }) diff --git a/pkg/helm/fake.go b/pkg/helm/fake.go index 0a9e77c44..a3b0ebc84 100644 --- a/pkg/helm/fake.go +++ b/pkg/helm/fake.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ package helm // import "k8s.io/helm/pkg/helm" import ( "errors" - "fmt" "math/rand" "sync" @@ -27,6 +26,7 @@ import ( "k8s.io/helm/pkg/proto/hapi/release" rls "k8s.io/helm/pkg/proto/hapi/services" "k8s.io/helm/pkg/proto/hapi/version" + storage "k8s.io/helm/pkg/storage/driver" ) // FakeClient implements Interface @@ -49,9 +49,28 @@ var _ Interface = (*FakeClient)(nil) // ListReleases lists the current releases func (c *FakeClient) ListReleases(opts ...ReleaseListOption) (*rls.ListReleasesResponse, error) { + reqOpts := c.Opts + for _, opt := range opts { + opt(&reqOpts) + } + req := &reqOpts.listReq + rels := c.Rels + count := int64(len(c.Rels)) + var next string + limit := req.GetLimit() + // TODO: Handle all other options. + if limit != 0 && limit < count { + rels = rels[:limit] + count = limit + next = c.Rels[limit].GetName() + } + resp := &rls.ListReleasesResponse{ - Count: int64(len(c.Rels)), - Releases: c.Rels, + Count: count, + Releases: rels, + } + if next != "" { + resp.Next = next } return resp, nil } @@ -69,6 +88,7 @@ func (c *FakeClient) InstallReleaseFromChart(chart *chart.Chart, ns string, opts } releaseName := c.Opts.instReq.Name + releaseDescription := c.Opts.instReq.Description // Check to see if the release already exists. rel, err := c.ReleaseStatus(releaseName, nil) @@ -76,8 +96,10 @@ func (c *FakeClient) InstallReleaseFromChart(chart *chart.Chart, ns string, opts return nil, errors.New("cannot re-use a name that is still in use") } - release := ReleaseMock(&MockReleaseOptions{Name: releaseName, Namespace: ns}) - c.Rels = append(c.Rels, release) + release := ReleaseMock(&MockReleaseOptions{Name: releaseName, Namespace: ns, Description: releaseDescription}) + if !c.Opts.dryRun { + c.Rels = append(c.Rels, release) + } return &rls.InstallReleaseResponse{ Release: release, @@ -95,7 +117,7 @@ func (c *FakeClient) DeleteRelease(rlsName string, opts ...DeleteOption) (*rls.U } } - return nil, fmt.Errorf("No such release: %s", rlsName) + return nil, storage.ErrReleaseNotFound(rlsName) } // GetVersion returns a fake version @@ -139,7 +161,7 @@ func (c *FakeClient) ReleaseStatus(rlsName string, opts ...StatusOption) (*rls.G }, nil } } - return nil, fmt.Errorf("No such release: %s", rlsName) + return nil, storage.ErrReleaseNotFound(rlsName) } // ReleaseContent returns the configuration for the matching release name in the fake release client. @@ -151,7 +173,7 @@ func (c *FakeClient) ReleaseContent(rlsName string, opts ...ContentOption) (resp }, nil } } - return resp, fmt.Errorf("No such release: %s", rlsName) + return resp, storage.ErrReleaseNotFound(rlsName) } // ReleaseHistory returns a release's revision history. @@ -206,11 +228,12 @@ metadata: // MockReleaseOptions allows for user-configurable options on mock release objects. type MockReleaseOptions struct { - Name string - Version int32 - Chart *chart.Chart - StatusCode release.Status_Code - Namespace string + Name string + Version int32 + Chart *chart.Chart + StatusCode release.Status_Code + Namespace string + Description string } // ReleaseMock creates a mock release object based on options set by MockReleaseOptions. This function should typically not be used outside of testing. @@ -232,6 +255,11 @@ func ReleaseMock(opts *MockReleaseOptions) *release.Release { namespace = "default" } + description := opts.Description + if description == "" { + description = "Release mock" + } + ch := opts.Chart if opts.Chart == nil { ch = &chart.Chart{ @@ -256,7 +284,7 @@ func ReleaseMock(opts *MockReleaseOptions) *release.Release { FirstDeployed: &date, LastDeployed: &date, Status: &release.Status{Code: scode}, - Description: "Release mock", + Description: description, }, Chart: ch, Config: &chart.Config{Raw: `name: "value"`}, diff --git a/pkg/helm/fake_test.go b/pkg/helm/fake_test.go index 9c0a53759..f16fbaf4c 100644 --- a/pkg/helm/fake_test.go +++ b/pkg/helm/fake_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -150,6 +150,23 @@ func TestFakeClient_InstallReleaseFromChart(t *testing.T) { }, wantErr: false, }, + { + name: "Add release with description.", + fields: fields{ + Rels: []*release.Release{}, + }, + args: args{ + ns: "default", + opts: []InstallOption{ReleaseName("new-release"), InstallDescription("foo-bar")}, + }, + want: &rls.InstallReleaseResponse{ + Release: ReleaseMock(&MockReleaseOptions{Name: "new-release", Description: "foo-bar"}), + }, + relsAfter: []*release.Release{ + ReleaseMock(&MockReleaseOptions{Name: "new-release", Description: "foo-bar"}), + }, + wantErr: false, + }, { name: "Try to add a release where the name already exists.", fields: fields{ diff --git a/pkg/helm/helm_test.go b/pkg/helm/helm_test.go index 2b0436581..fe7150cc0 100644 --- a/pkg/helm/helm_test.go +++ b/pkg/helm/helm_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/helm/helmpath/helmhome.go b/pkg/helm/helmpath/helmhome.go index b5ec4909e..9608ea6dd 100644 --- a/pkg/helm/helmpath/helmhome.go +++ b/pkg/helm/helmpath/helmhome.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/helm/helmpath/helmhome_unix_test.go b/pkg/helm/helmpath/helmhome_unix_test.go index 494d0f6b4..ca9035554 100644 --- a/pkg/helm/helmpath/helmhome_unix_test.go +++ b/pkg/helm/helmpath/helmhome_unix_test.go @@ -1,4 +1,4 @@ -// Copyright 2016 The Kubernetes Authors All rights reserved. +// Copyright The Helm Authors. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at diff --git a/pkg/helm/helmpath/helmhome_windows_test.go b/pkg/helm/helmpath/helmhome_windows_test.go index e416bfd58..db1341421 100644 --- a/pkg/helm/helmpath/helmhome_windows_test.go +++ b/pkg/helm/helmpath/helmhome_windows_test.go @@ -1,4 +1,4 @@ -// Copyright 2016 The Kubernetes Authors All rights reserved. +// Copyright The Helm Authors. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at diff --git a/pkg/helm/interface.go b/pkg/helm/interface.go index 10c04c710..d09b6cf8f 100644 --- a/pkg/helm/interface.go +++ b/pkg/helm/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/helm/option.go b/pkg/helm/option.go index 602e1e3a3..5579ae76d 100644 --- a/pkg/helm/option.go +++ b/pkg/helm/option.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -262,6 +262,34 @@ func UpdateValueOverrides(raw []byte) UpdateOption { } } +// InstallDescription specifies the description for the release +func InstallDescription(description string) InstallOption { + return func(opts *options) { + opts.instReq.Description = description + } +} + +// UpgradeDescription specifies the description for the update +func UpgradeDescription(description string) UpdateOption { + return func(opts *options) { + opts.updateReq.Description = description + } +} + +// RollbackDescription specifies the description for the release +func RollbackDescription(description string) RollbackOption { + return func(opts *options) { + opts.rollbackReq.Description = description + } +} + +// DeleteDescription specifies the description for the release +func DeleteDescription(description string) DeleteOption { + return func(opts *options) { + opts.uninstallReq.Description = description + } +} + // DeleteDisableHooks will disable hooks for a deletion operation. func DeleteDisableHooks(disable bool) DeleteOption { return func(opts *options) { diff --git a/pkg/helm/portforwarder/pod.go b/pkg/helm/portforwarder/pod.go index 7c2355204..239eb2730 100644 --- a/pkg/helm/portforwarder/pod.go +++ b/pkg/helm/portforwarder/pod.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -32,7 +32,7 @@ func isPodReady(pod *v1.Pod) bool { return isPodReadyConditionTrue(pod.Status) } -// isPodReady retruns true if a pod is ready; false otherwise. +// isPodReadyConditionTrue returns true if a pod is ready; false otherwise. func isPodReadyConditionTrue(status v1.PodStatus) bool { condition := getPodReadyCondition(status) return condition != nil && condition.Status == v1.ConditionTrue diff --git a/pkg/helm/portforwarder/portforwarder.go b/pkg/helm/portforwarder/portforwarder.go index 878610d5f..cc3261d1c 100644 --- a/pkg/helm/portforwarder/portforwarder.go +++ b/pkg/helm/portforwarder/portforwarder.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/helm/portforwarder/portforwarder_test.go b/pkg/helm/portforwarder/portforwarder_test.go index e4c148991..ad5a23bc8 100644 --- a/pkg/helm/portforwarder/portforwarder_test.go +++ b/pkg/helm/portforwarder/portforwarder_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/hooks/hooks.go b/pkg/hooks/hooks.go index 64118333d..5083672cd 100644 --- a/pkg/hooks/hooks.go +++ b/pkg/hooks/hooks.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/ignore/doc.go b/pkg/ignore/doc.go index 7281c33a9..85cc91060 100644 --- a/pkg/ignore/doc.go +++ b/pkg/ignore/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/ignore/rules.go b/pkg/ignore/rules.go index 185d289bb..9a8e08327 100644 --- a/pkg/ignore/rules.go +++ b/pkg/ignore/rules.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/ignore/rules_test.go b/pkg/ignore/rules_test.go index 17b8bf403..a2f709097 100644 --- a/pkg/ignore/rules_test.go +++ b/pkg/ignore/rules_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/kube/client.go b/pkg/kube/client.go index 926174ef1..39187da42 100644 --- a/pkg/kube/client.go +++ b/pkg/kube/client.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/kube/client_test.go b/pkg/kube/client_test.go index 47049810a..6e33ca27f 100644 --- a/pkg/kube/client_test.go +++ b/pkg/kube/client_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/kube/config.go b/pkg/kube/config.go index b6560486e..7504d9028 100644 --- a/pkg/kube/config.go +++ b/pkg/kube/config.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,10 +16,12 @@ limitations under the License. package kube // import "k8s.io/helm/pkg/kube" -import "k8s.io/client-go/tools/clientcmd" +import ( + "k8s.io/client-go/tools/clientcmd" +) // GetConfig returns a Kubernetes client config for a given context. -func GetConfig(context string) clientcmd.ClientConfig { +func GetConfig(context string, kubeconfig string) clientcmd.ClientConfig { rules := clientcmd.NewDefaultClientConfigLoadingRules() rules.DefaultClientConfig = &clientcmd.DefaultClientConfig @@ -28,5 +30,10 @@ func GetConfig(context string) clientcmd.ClientConfig { if context != "" { overrides.CurrentContext = context } + + if kubeconfig != "" { + rules.ExplicitPath = kubeconfig + } + return clientcmd.NewNonInteractiveDeferredLoadingClientConfig(rules, overrides) } diff --git a/pkg/kube/log.go b/pkg/kube/log.go index fbe51823a..fc3683b1d 100644 --- a/pkg/kube/log.go +++ b/pkg/kube/log.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/kube/namespace.go b/pkg/kube/namespace.go index 9d2793d87..57e62bab7 100644 --- a/pkg/kube/namespace.go +++ b/pkg/kube/namespace.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -27,6 +27,9 @@ func createNamespace(client internalclientset.Interface, namespace string) error ns := &core.Namespace{ ObjectMeta: metav1.ObjectMeta{ Name: namespace, + Labels: map[string]string{ + "name": namespace, + }, }, } _, err := client.Core().Namespaces().Create(ns) @@ -40,7 +43,16 @@ func getNamespace(client internalclientset.Interface, namespace string) (*core.N func ensureNamespace(client internalclientset.Interface, namespace string) error { _, err := getNamespace(client, namespace) if err != nil && errors.IsNotFound(err) { - return createNamespace(client, namespace) + err = createNamespace(client, namespace) + + // If multiple commands which run `ensureNamespace` are run in + // parallel, then protect against the race condition in which + // the namespace did not exist when `getNamespace` was executed, + // but did exist when `createNamespace` was executed. If that + // happens, we can just proceed as normal. + if errors.IsAlreadyExists(err) { + return nil + } } return err } diff --git a/pkg/kube/namespace_test.go b/pkg/kube/namespace_test.go index eb96557d0..79e8e880c 100644 --- a/pkg/kube/namespace_test.go +++ b/pkg/kube/namespace_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/kube/result.go b/pkg/kube/result.go index 87c7e6ac1..f90d77ad5 100644 --- a/pkg/kube/result.go +++ b/pkg/kube/result.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/kube/result_test.go b/pkg/kube/result_test.go index 962e90426..0780ad9fc 100644 --- a/pkg/kube/result_test.go +++ b/pkg/kube/result_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/kube/tunnel.go b/pkg/kube/tunnel.go index 08280f25d..f4eaa7e26 100644 --- a/pkg/kube/tunnel.go +++ b/pkg/kube/tunnel.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/kube/tunnel_test.go b/pkg/kube/tunnel_test.go index 264200ddf..37fb296a3 100644 --- a/pkg/kube/tunnel_test.go +++ b/pkg/kube/tunnel_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/kube/wait.go b/pkg/kube/wait.go index 88f3c7d34..ed9bc10a6 100644 --- a/pkg/kube/wait.go +++ b/pkg/kube/wait.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/lint/lint.go b/pkg/lint/lint.go index 256eab906..aa8df5814 100644 --- a/pkg/lint/lint.go +++ b/pkg/lint/lint.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/lint/lint_test.go b/pkg/lint/lint_test.go index d84faa10b..84dfbf508 100644 --- a/pkg/lint/lint_test.go +++ b/pkg/lint/lint_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/lint/rules/chartfile.go b/pkg/lint/rules/chartfile.go index 0dab0d250..12f028af1 100644 --- a/pkg/lint/rules/chartfile.go +++ b/pkg/lint/rules/chartfile.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/lint/rules/chartfile_test.go b/pkg/lint/rules/chartfile_test.go index 99dc4de0f..235e5fc4c 100644 --- a/pkg/lint/rules/chartfile_test.go +++ b/pkg/lint/rules/chartfile_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/lint/rules/template.go b/pkg/lint/rules/template.go index a8b6a6757..8b51b14f8 100644 --- a/pkg/lint/rules/template.go +++ b/pkg/lint/rules/template.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/lint/rules/template_test.go b/pkg/lint/rules/template_test.go index cb1be94a2..41a7384e7 100644 --- a/pkg/lint/rules/template_test.go +++ b/pkg/lint/rules/template_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/lint/rules/values.go b/pkg/lint/rules/values.go index 9b97598f0..4781cc176 100644 --- a/pkg/lint/rules/values.go +++ b/pkg/lint/rules/values.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/lint/support/doc.go b/pkg/lint/support/doc.go index 4cf7272e4..ede608906 100644 --- a/pkg/lint/support/doc.go +++ b/pkg/lint/support/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/lint/support/message.go b/pkg/lint/support/message.go index 6a878031a..4dd485c98 100644 --- a/pkg/lint/support/message.go +++ b/pkg/lint/support/message.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/lint/support/message_test.go b/pkg/lint/support/message_test.go index 4a9c33c34..55675eeee 100644 --- a/pkg/lint/support/message_test.go +++ b/pkg/lint/support/message_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/plugin/cache/cache.go b/pkg/plugin/cache/cache.go index a1d3224c8..d846126f1 100644 --- a/pkg/plugin/cache/cache.go +++ b/pkg/plugin/cache/cache.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/plugin/hooks.go b/pkg/plugin/hooks.go index b5ca032ac..70ce5d122 100644 --- a/pkg/plugin/hooks.go +++ b/pkg/plugin/hooks.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/plugin/installer/base.go b/pkg/plugin/installer/base.go index 0664dae76..15ce3cbcf 100644 --- a/pkg/plugin/installer/base.go +++ b/pkg/plugin/installer/base.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/plugin/installer/doc.go b/pkg/plugin/installer/doc.go index a2a66f3e1..0089e33f8 100644 --- a/pkg/plugin/installer/doc.go +++ b/pkg/plugin/installer/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/plugin/installer/http_installer.go b/pkg/plugin/installer/http_installer.go index b5c205de6..fd58b88ca 100644 --- a/pkg/plugin/installer/http_installer.go +++ b/pkg/plugin/installer/http_installer.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/plugin/installer/http_installer_test.go b/pkg/plugin/installer/http_installer_test.go index bab5f7a92..73af75e8c 100644 --- a/pkg/plugin/installer/http_installer_test.go +++ b/pkg/plugin/installer/http_installer_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/plugin/installer/installer.go b/pkg/plugin/installer/installer.go index 02aee9f46..76c751d50 100644 --- a/pkg/plugin/installer/installer.go +++ b/pkg/plugin/installer/installer.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/plugin/installer/local_installer.go b/pkg/plugin/installer/local_installer.go index 3cf6bb422..f39086a6e 100644 --- a/pkg/plugin/installer/local_installer.go +++ b/pkg/plugin/installer/local_installer.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/plugin/installer/local_installer_test.go b/pkg/plugin/installer/local_installer_test.go index 6a7c957d6..fb5fa2675 100644 --- a/pkg/plugin/installer/local_installer_test.go +++ b/pkg/plugin/installer/local_installer_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/plugin/installer/vcs_installer.go b/pkg/plugin/installer/vcs_installer.go index 0a373a971..4b502dae4 100644 --- a/pkg/plugin/installer/vcs_installer.go +++ b/pkg/plugin/installer/vcs_installer.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/plugin/installer/vcs_installer_test.go b/pkg/plugin/installer/vcs_installer_test.go index d6eb32c1b..548a7a49a 100644 --- a/pkg/plugin/installer/vcs_installer_test.go +++ b/pkg/plugin/installer/vcs_installer_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/plugin/plugin.go b/pkg/plugin/plugin.go index b3458c2d8..07fcc700a 100644 --- a/pkg/plugin/plugin.go +++ b/pkg/plugin/plugin.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/plugin/plugin_test.go b/pkg/plugin/plugin_test.go index 5ddbf15f3..338d949f8 100644 --- a/pkg/plugin/plugin_test.go +++ b/pkg/plugin/plugin_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/proto/hapi/services/tiller.pb.go b/pkg/proto/hapi/services/tiller.pb.go index 4d23bcdad..c0b9ab7d3 100644 --- a/pkg/proto/hapi/services/tiller.pb.go +++ b/pkg/proto/hapi/services/tiller.pb.go @@ -376,6 +376,8 @@ type UpdateReleaseRequest struct { ReuseValues bool `protobuf:"varint,10,opt,name=reuse_values,json=reuseValues" json:"reuse_values,omitempty"` // Force resource update through delete/recreate if needed. Force bool `protobuf:"varint,11,opt,name=force" json:"force,omitempty"` + // Description, if set, will set the description for the updated release + Description string `protobuf:"bytes,12,opt,name=description" json:"description,omitempty"` } func (m *UpdateReleaseRequest) Reset() { *m = UpdateReleaseRequest{} } @@ -460,6 +462,13 @@ func (m *UpdateReleaseRequest) GetForce() bool { return false } +func (m *UpdateReleaseRequest) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + // UpdateReleaseResponse is the response to an update request. type UpdateReleaseResponse struct { Release *hapi_release5.Release `protobuf:"bytes,1,opt,name=release" json:"release,omitempty"` @@ -495,6 +504,8 @@ type RollbackReleaseRequest struct { Wait bool `protobuf:"varint,7,opt,name=wait" json:"wait,omitempty"` // Force resource update through delete/recreate if needed. Force bool `protobuf:"varint,8,opt,name=force" json:"force,omitempty"` + // Description, if set, will set the description for the rollback + Description string `protobuf:"bytes,9,opt,name=description" json:"description,omitempty"` } func (m *RollbackReleaseRequest) Reset() { *m = RollbackReleaseRequest{} } @@ -558,6 +569,13 @@ func (m *RollbackReleaseRequest) GetForce() bool { return false } +func (m *RollbackReleaseRequest) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + // RollbackReleaseResponse is the response to an update request. type RollbackReleaseResponse struct { Release *hapi_release5.Release `protobuf:"bytes,1,opt,name=release" json:"release,omitempty"` @@ -601,6 +619,8 @@ type InstallReleaseRequest struct { // before marking the release as successful. It will wait for as long as timeout Wait bool `protobuf:"varint,9,opt,name=wait" json:"wait,omitempty"` DisableCrdHook bool `protobuf:"varint,10,opt,name=disable_crd_hook,json=disableCrdHook" json:"disable_crd_hook,omitempty"` + // Description, if set, will set the description for the installed release + Description string `protobuf:"bytes,11,opt,name=description" json:"description,omitempty"` } func (m *InstallReleaseRequest) Reset() { *m = InstallReleaseRequest{} } @@ -678,6 +698,13 @@ func (m *InstallReleaseRequest) GetDisableCrdHook() bool { return false } +func (m *InstallReleaseRequest) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + // InstallReleaseResponse is the response from a release installation. type InstallReleaseResponse struct { Release *hapi_release5.Release `protobuf:"bytes,1,opt,name=release" json:"release,omitempty"` @@ -705,6 +732,8 @@ type UninstallReleaseRequest struct { Purge bool `protobuf:"varint,3,opt,name=purge" json:"purge,omitempty"` // timeout specifies the max amount of time any kubernetes client command can run. Timeout int64 `protobuf:"varint,4,opt,name=timeout" json:"timeout,omitempty"` + // Description, if set, will set the description for the uninnstalled release + Description string `protobuf:"bytes,5,opt,name=description" json:"description,omitempty"` } func (m *UninstallReleaseRequest) Reset() { *m = UninstallReleaseRequest{} } @@ -740,6 +769,13 @@ func (m *UninstallReleaseRequest) GetTimeout() int64 { return 0 } +func (m *UninstallReleaseRequest) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + // UninstallReleaseResponse represents a successful response to an uninstall request. type UninstallReleaseResponse struct { // Release is the release that was marked deleted. @@ -1376,83 +1412,85 @@ var _ReleaseService_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("hapi/services/tiller.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1235 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xdd, 0x6e, 0xe3, 0xc4, - 0x17, 0xaf, 0xf3, 0x9d, 0x93, 0x6e, 0xfe, 0xd9, 0x69, 0xda, 0xba, 0xfe, 0x2f, 0xa8, 0x18, 0xc1, - 0x66, 0x17, 0x36, 0x85, 0xc0, 0x0d, 0x12, 0x42, 0xea, 0x66, 0xa3, 0xb6, 0x50, 0xba, 0x92, 0xb3, - 0x5d, 0x24, 0x04, 0x44, 0x6e, 0x32, 0x69, 0xcd, 0x3a, 0x76, 0xf0, 0x8c, 0xcb, 0xf6, 0x96, 0x3b, - 0xde, 0x8a, 0x77, 0xe0, 0x92, 0x4b, 0x78, 0x10, 0x34, 0x5f, 0xae, 0x27, 0xb5, 0x5b, 0xd3, 0x9b, - 0x78, 0x66, 0xce, 0xf7, 0xef, 0x9c, 0x39, 0x73, 0x02, 0xd6, 0x85, 0xbb, 0xf4, 0xf6, 0x08, 0x8e, - 0x2e, 0xbd, 0x29, 0x26, 0x7b, 0xd4, 0xf3, 0x7d, 0x1c, 0xf5, 0x97, 0x51, 0x48, 0x43, 0xd4, 0x65, - 0xb4, 0xbe, 0xa2, 0xf5, 0x05, 0xcd, 0xda, 0xe2, 0x12, 0xd3, 0x0b, 0x37, 0xa2, 0xe2, 0x57, 0x70, - 0x5b, 0xdb, 0xe9, 0xf3, 0x30, 0x98, 0x7b, 0xe7, 0x92, 0x20, 0x4c, 0x44, 0xd8, 0xc7, 0x2e, 0xc1, - 0xea, 0xab, 0x09, 0x29, 0x9a, 0x17, 0xcc, 0x43, 0x49, 0xf8, 0xbf, 0x46, 0xa0, 0x98, 0xd0, 0x49, - 0x14, 0x07, 0x92, 0xb8, 0xa3, 0x11, 0x09, 0x75, 0x69, 0x4c, 0x34, 0x63, 0x97, 0x38, 0x22, 0x5e, - 0x18, 0xa8, 0xaf, 0xa0, 0xd9, 0x7f, 0x94, 0x60, 0xe3, 0xd8, 0x23, 0xd4, 0x11, 0x82, 0xc4, 0xc1, - 0xbf, 0xc4, 0x98, 0x50, 0xd4, 0x85, 0xaa, 0xef, 0x2d, 0x3c, 0x6a, 0x1a, 0xbb, 0x46, 0xaf, 0xec, - 0x88, 0x0d, 0xda, 0x82, 0x5a, 0x38, 0x9f, 0x13, 0x4c, 0xcd, 0xd2, 0xae, 0xd1, 0x6b, 0x3a, 0x72, - 0x87, 0xbe, 0x82, 0x3a, 0x09, 0x23, 0x3a, 0x39, 0xbb, 0x32, 0xcb, 0xbb, 0x46, 0xaf, 0x3d, 0xf8, - 0xa0, 0x9f, 0x85, 0x53, 0x9f, 0x59, 0x1a, 0x87, 0x11, 0xed, 0xb3, 0x9f, 0xe7, 0x57, 0x4e, 0x8d, - 0xf0, 0x2f, 0xd3, 0x3b, 0xf7, 0x7c, 0x8a, 0x23, 0xb3, 0x22, 0xf4, 0x8a, 0x1d, 0x3a, 0x00, 0xe0, - 0x7a, 0xc3, 0x68, 0x86, 0x23, 0xb3, 0xca, 0x55, 0xf7, 0x0a, 0xa8, 0x7e, 0xc9, 0xf8, 0x9d, 0x26, - 0x51, 0x4b, 0xf4, 0x25, 0xac, 0x0b, 0x48, 0x26, 0xd3, 0x70, 0x86, 0x89, 0x59, 0xdb, 0x2d, 0xf7, - 0xda, 0x83, 0x1d, 0xa1, 0x4a, 0xc1, 0x3f, 0x16, 0xa0, 0x0d, 0xc3, 0x19, 0x76, 0x5a, 0x82, 0x9d, - 0xad, 0x09, 0x7a, 0x04, 0xcd, 0xc0, 0x5d, 0x60, 0xb2, 0x74, 0xa7, 0xd8, 0xac, 0x73, 0x0f, 0xaf, - 0x0f, 0xec, 0x9f, 0xa0, 0xa1, 0x8c, 0xdb, 0x03, 0xa8, 0x89, 0xd0, 0x50, 0x0b, 0xea, 0xa7, 0x27, - 0xdf, 0x9c, 0xbc, 0xfc, 0xee, 0xa4, 0xb3, 0x86, 0x1a, 0x50, 0x39, 0xd9, 0xff, 0x76, 0xd4, 0x31, - 0xd0, 0x43, 0x78, 0x70, 0xbc, 0x3f, 0x7e, 0x35, 0x71, 0x46, 0xc7, 0xa3, 0xfd, 0xf1, 0xe8, 0x45, - 0xa7, 0x64, 0xbf, 0x0b, 0xcd, 0xc4, 0x67, 0x54, 0x87, 0xf2, 0xfe, 0x78, 0x28, 0x44, 0x5e, 0x8c, - 0xc6, 0xc3, 0x8e, 0x61, 0xff, 0x6e, 0x40, 0x57, 0x4f, 0x11, 0x59, 0x86, 0x01, 0xc1, 0x2c, 0x47, - 0xd3, 0x30, 0x0e, 0x92, 0x1c, 0xf1, 0x0d, 0x42, 0x50, 0x09, 0xf0, 0x5b, 0x95, 0x21, 0xbe, 0x66, - 0x9c, 0x34, 0xa4, 0xae, 0xcf, 0xb3, 0x53, 0x76, 0xc4, 0x06, 0x7d, 0x0a, 0x0d, 0x19, 0x3a, 0x31, - 0x2b, 0xbb, 0xe5, 0x5e, 0x6b, 0xb0, 0xa9, 0x03, 0x22, 0x2d, 0x3a, 0x09, 0x9b, 0x7d, 0x00, 0xdb, - 0x07, 0x58, 0x79, 0x22, 0xf0, 0x52, 0x15, 0xc3, 0xec, 0xba, 0x0b, 0xcc, 0x9d, 0x61, 0x76, 0xdd, - 0x05, 0x46, 0x26, 0xd4, 0x65, 0xb9, 0x71, 0x77, 0xaa, 0x8e, 0xda, 0xda, 0x14, 0xcc, 0x9b, 0x8a, - 0x64, 0x5c, 0x59, 0x9a, 0x3e, 0x84, 0x0a, 0xbb, 0x09, 0x5c, 0x4d, 0x6b, 0x80, 0x74, 0x3f, 0x8f, - 0x82, 0x79, 0xe8, 0x70, 0xba, 0x9e, 0xaa, 0xf2, 0x6a, 0xaa, 0x0e, 0xd3, 0x56, 0x87, 0x61, 0x40, - 0x71, 0x40, 0xef, 0xe7, 0xff, 0x31, 0xec, 0x64, 0x68, 0x92, 0x01, 0xec, 0x41, 0x5d, 0xba, 0xc6, - 0xb5, 0xe5, 0xe2, 0xaa, 0xb8, 0xec, 0xbf, 0x4b, 0xd0, 0x3d, 0x5d, 0xce, 0x5c, 0x8a, 0x15, 0xe9, - 0x16, 0xa7, 0x1e, 0x43, 0x95, 0x77, 0x14, 0x89, 0xc5, 0x43, 0xa1, 0x5b, 0xb4, 0x9d, 0x21, 0xfb, - 0x75, 0x04, 0x1d, 0x3d, 0x85, 0xda, 0xa5, 0xeb, 0xc7, 0x98, 0x70, 0x20, 0x12, 0xd4, 0x24, 0x27, - 0x6f, 0x47, 0x8e, 0xe4, 0x40, 0xdb, 0x50, 0x9f, 0x45, 0x57, 0xac, 0x9f, 0xf0, 0x2b, 0xd8, 0x70, - 0x6a, 0xb3, 0xe8, 0xca, 0x89, 0x03, 0xf4, 0x3e, 0x3c, 0x98, 0x79, 0xc4, 0x3d, 0xf3, 0xf1, 0xe4, - 0x22, 0x0c, 0xdf, 0x10, 0x7e, 0x0b, 0x1b, 0xce, 0xba, 0x3c, 0x3c, 0x64, 0x67, 0xc8, 0x62, 0x95, - 0x34, 0x8d, 0xb0, 0x4b, 0xb1, 0x59, 0xe3, 0xf4, 0x64, 0xcf, 0x30, 0xa4, 0xde, 0x02, 0x87, 0x31, - 0xe5, 0x57, 0xa7, 0xec, 0xa8, 0x2d, 0x7a, 0x0f, 0xd6, 0x23, 0x4c, 0x30, 0x9d, 0x48, 0x2f, 0x1b, - 0x5c, 0xb2, 0xc5, 0xcf, 0x5e, 0x0b, 0xb7, 0x10, 0x54, 0x7e, 0x75, 0x3d, 0x6a, 0x36, 0x39, 0x89, - 0xaf, 0x85, 0x58, 0x4c, 0xb0, 0x12, 0x03, 0x25, 0x16, 0x13, 0x2c, 0xc5, 0xba, 0x50, 0x9d, 0x87, - 0xd1, 0x14, 0x9b, 0x2d, 0x4e, 0x13, 0x1b, 0xfb, 0x10, 0x36, 0x57, 0x40, 0xbe, 0x6f, 0xbe, 0xfe, - 0x31, 0x60, 0xcb, 0x09, 0x7d, 0xff, 0xcc, 0x9d, 0xbe, 0x29, 0x90, 0xb1, 0x14, 0xb8, 0xa5, 0xdb, - 0xc1, 0x2d, 0x67, 0x80, 0x9b, 0x2a, 0xc2, 0x8a, 0x56, 0x84, 0x1a, 0xec, 0xd5, 0x7c, 0xd8, 0x6b, - 0x3a, 0xec, 0x0a, 0xd3, 0x7a, 0x0a, 0xd3, 0x04, 0xb0, 0x46, 0x1a, 0xb0, 0xaf, 0x61, 0xfb, 0x46, - 0x94, 0xf7, 0x85, 0xec, 0xcf, 0x12, 0x6c, 0x1e, 0x05, 0x84, 0xba, 0xbe, 0xbf, 0x82, 0x58, 0x52, - 0xcf, 0x46, 0xe1, 0x7a, 0x2e, 0xfd, 0x97, 0x7a, 0x2e, 0x6b, 0x90, 0xab, 0xfc, 0x54, 0x52, 0xf9, - 0x29, 0x54, 0xe3, 0x5a, 0x67, 0xa9, 0xad, 0x74, 0x16, 0xf4, 0x0e, 0x80, 0x28, 0x4a, 0xae, 0x5c, - 0x40, 0xdb, 0xe4, 0x27, 0x27, 0xb2, 0x91, 0xa8, 0x6c, 0x34, 0xb2, 0xb3, 0x91, 0xae, 0xf0, 0x1e, - 0x74, 0x94, 0x3f, 0xd3, 0x68, 0xc6, 0x7d, 0x92, 0x55, 0xde, 0x96, 0xe7, 0xc3, 0x68, 0xc6, 0xbc, - 0xb2, 0x8f, 0x60, 0x6b, 0x15, 0xd4, 0xfb, 0x26, 0xe8, 0x37, 0x03, 0xb6, 0x4f, 0x03, 0x2f, 0x33, - 0x45, 0x59, 0x45, 0x7d, 0x03, 0xb4, 0x52, 0x06, 0x68, 0x5d, 0xa8, 0x2e, 0xe3, 0xe8, 0x1c, 0xcb, - 0x24, 0x88, 0x4d, 0x1a, 0x8d, 0x8a, 0x86, 0x86, 0x3d, 0x01, 0xf3, 0xa6, 0x0f, 0xf7, 0x8c, 0x88, - 0x79, 0x9d, 0xbc, 0x19, 0x4d, 0xf1, 0x3e, 0xd8, 0x1b, 0xf0, 0xf0, 0x00, 0xd3, 0xd7, 0xe2, 0x02, - 0xc9, 0xf0, 0xec, 0x11, 0xa0, 0xf4, 0xe1, 0xb5, 0x3d, 0x79, 0xa4, 0xdb, 0x53, 0x03, 0x94, 0xe2, - 0x57, 0x5c, 0xf6, 0x17, 0x5c, 0xf7, 0xa1, 0x47, 0x68, 0x18, 0x5d, 0xdd, 0x06, 0x5d, 0x07, 0xca, - 0x0b, 0xf7, 0xad, 0x7c, 0x52, 0xd8, 0xd2, 0x3e, 0xe0, 0x1e, 0x24, 0xa2, 0xd2, 0x83, 0xf4, 0x03, - 0x6d, 0x14, 0x7b, 0xa0, 0x7f, 0x00, 0xf4, 0x0a, 0x27, 0xb3, 0xc2, 0x1d, 0x6f, 0x9b, 0x4a, 0x42, - 0x49, 0x2f, 0x49, 0x13, 0xea, 0x53, 0x1f, 0xbb, 0x41, 0xbc, 0x94, 0x69, 0x53, 0x5b, 0xfb, 0x47, - 0xd8, 0xd0, 0xb4, 0x4b, 0x3f, 0x59, 0x3c, 0xe4, 0x5c, 0x6a, 0x67, 0x4b, 0xf4, 0x39, 0xd4, 0xc4, - 0x00, 0xc5, 0x75, 0xb7, 0x07, 0x8f, 0x74, 0xbf, 0xb9, 0x92, 0x38, 0x90, 0x13, 0x97, 0x23, 0x79, - 0x07, 0x7f, 0x35, 0xa0, 0xad, 0x46, 0x02, 0x31, 0xde, 0x21, 0x0f, 0xd6, 0xd3, 0xb3, 0x0f, 0x7a, - 0x92, 0x3f, 0xfd, 0xad, 0x8c, 0xb0, 0xd6, 0xd3, 0x22, 0xac, 0x22, 0x02, 0x7b, 0xed, 0x13, 0x03, - 0x11, 0xe8, 0xac, 0x8e, 0x24, 0xe8, 0x59, 0xb6, 0x8e, 0x9c, 0x19, 0xc8, 0xea, 0x17, 0x65, 0x57, - 0x66, 0xd1, 0x25, 0xaf, 0x19, 0x7d, 0x8e, 0x40, 0x77, 0xaa, 0xd1, 0x47, 0x17, 0x6b, 0xaf, 0x30, - 0x7f, 0x62, 0xf7, 0x67, 0x78, 0xa0, 0xbd, 0x85, 0x28, 0x07, 0xad, 0xac, 0xa9, 0xc4, 0xfa, 0xa8, - 0x10, 0x6f, 0x62, 0x6b, 0x01, 0x6d, 0xbd, 0x49, 0xa1, 0x1c, 0x05, 0x99, 0xef, 0x83, 0xf5, 0x71, - 0x31, 0xe6, 0xc4, 0x1c, 0x81, 0xce, 0x6a, 0x0f, 0xc9, 0xcb, 0x63, 0x4e, 0xbf, 0xcb, 0xcb, 0x63, - 0x5e, 0x6b, 0xb2, 0xd7, 0x90, 0x0b, 0x70, 0xdd, 0x42, 0xd0, 0xe3, 0xdc, 0x84, 0xe8, 0x9d, 0xc7, - 0xea, 0xdd, 0xcd, 0x98, 0x98, 0x58, 0xc2, 0xff, 0x56, 0x5e, 0x63, 0x94, 0x03, 0x4d, 0xf6, 0x68, - 0x62, 0x3d, 0x2b, 0xc8, 0xbd, 0x12, 0x94, 0xec, 0x4a, 0xb7, 0x04, 0xa5, 0xb7, 0xbc, 0x5b, 0x82, - 0x5a, 0x69, 0x70, 0xf6, 0x1a, 0xf2, 0xa0, 0xed, 0xc4, 0x81, 0x34, 0xcd, 0xda, 0x02, 0xca, 0x91, - 0xbe, 0xd9, 0xd5, 0xac, 0x27, 0x05, 0x38, 0xaf, 0xef, 0xf7, 0x73, 0xf8, 0xbe, 0xa1, 0x58, 0xcf, - 0x6a, 0xfc, 0xdf, 0xef, 0x67, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x5d, 0xc3, 0xd5, 0x55, 0xeb, - 0x0f, 0x00, 0x00, + // 1267 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xed, 0x6e, 0xe3, 0x44, + 0x17, 0x6e, 0xe2, 0x7c, 0x9e, 0x74, 0xf3, 0x66, 0x67, 0xb3, 0xad, 0xeb, 0x77, 0x41, 0xc1, 0x08, + 0x36, 0xbb, 0xb0, 0x29, 0x04, 0xfe, 0x20, 0x21, 0xa4, 0x6e, 0x36, 0x6a, 0x0b, 0xa5, 0x2b, 0x39, + 0xdb, 0x45, 0x42, 0x40, 0xe4, 0x26, 0x93, 0xd6, 0xac, 0x63, 0x07, 0xcf, 0xb8, 0x6c, 0x2f, 0x00, + 0x24, 0xee, 0x83, 0x0b, 0xe1, 0x3e, 0xb8, 0x0e, 0xfe, 0x23, 0xcf, 0x87, 0xeb, 0x71, 0xec, 0xd4, + 0xf4, 0x4f, 0xe3, 0x99, 0x73, 0xe6, 0x7c, 0x3c, 0xcf, 0x9c, 0x33, 0xa7, 0x60, 0x5c, 0xda, 0x2b, + 0x67, 0x9f, 0xe0, 0xe0, 0xca, 0x99, 0x61, 0xb2, 0x4f, 0x1d, 0xd7, 0xc5, 0xc1, 0x60, 0x15, 0xf8, + 0xd4, 0x47, 0xdd, 0x48, 0x36, 0x90, 0xb2, 0x01, 0x97, 0x19, 0x3b, 0xec, 0xc4, 0xec, 0xd2, 0x0e, + 0x28, 0xff, 0xcb, 0xb5, 0x8d, 0xdd, 0xe4, 0xbe, 0xef, 0x2d, 0x9c, 0x0b, 0x21, 0xe0, 0x2e, 0x02, + 0xec, 0x62, 0x9b, 0x60, 0xf9, 0xab, 0x1c, 0x92, 0x32, 0xc7, 0x5b, 0xf8, 0x42, 0xf0, 0x7f, 0x45, + 0x40, 0x31, 0xa1, 0xd3, 0x20, 0xf4, 0x84, 0x70, 0x4f, 0x11, 0x12, 0x6a, 0xd3, 0x90, 0x28, 0xce, + 0xae, 0x70, 0x40, 0x1c, 0xdf, 0x93, 0xbf, 0x5c, 0x66, 0xfe, 0x55, 0x86, 0x07, 0x27, 0x0e, 0xa1, + 0x16, 0x3f, 0x48, 0x2c, 0xfc, 0x4b, 0x88, 0x09, 0x45, 0x5d, 0xa8, 0xba, 0xce, 0xd2, 0xa1, 0x7a, + 0xa9, 0x57, 0xea, 0x6b, 0x16, 0x5f, 0xa0, 0x1d, 0xa8, 0xf9, 0x8b, 0x05, 0xc1, 0x54, 0x2f, 0xf7, + 0x4a, 0xfd, 0xa6, 0x25, 0x56, 0xe8, 0x2b, 0xa8, 0x13, 0x3f, 0xa0, 0xd3, 0xf3, 0x6b, 0x5d, 0xeb, + 0x95, 0xfa, 0xed, 0xe1, 0x07, 0x83, 0x2c, 0x9c, 0x06, 0x91, 0xa7, 0x89, 0x1f, 0xd0, 0x41, 0xf4, + 0xe7, 0xf9, 0xb5, 0x55, 0x23, 0xec, 0x37, 0xb2, 0xbb, 0x70, 0x5c, 0x8a, 0x03, 0xbd, 0xc2, 0xed, + 0xf2, 0x15, 0x3a, 0x04, 0x60, 0x76, 0xfd, 0x60, 0x8e, 0x03, 0xbd, 0xca, 0x4c, 0xf7, 0x0b, 0x98, + 0x7e, 0x19, 0xe9, 0x5b, 0x4d, 0x22, 0x3f, 0xd1, 0x97, 0xb0, 0xcd, 0x21, 0x99, 0xce, 0xfc, 0x39, + 0x26, 0x7a, 0xad, 0xa7, 0xf5, 0xdb, 0xc3, 0x3d, 0x6e, 0x4a, 0xc2, 0x3f, 0xe1, 0xa0, 0x8d, 0xfc, + 0x39, 0xb6, 0x5a, 0x5c, 0x3d, 0xfa, 0x26, 0xe8, 0x11, 0x34, 0x3d, 0x7b, 0x89, 0xc9, 0xca, 0x9e, + 0x61, 0xbd, 0xce, 0x22, 0xbc, 0xd9, 0x30, 0x7f, 0x82, 0x86, 0x74, 0x6e, 0x0e, 0xa1, 0xc6, 0x53, + 0x43, 0x2d, 0xa8, 0x9f, 0x9d, 0x7e, 0x73, 0xfa, 0xf2, 0xbb, 0xd3, 0xce, 0x16, 0x6a, 0x40, 0xe5, + 0xf4, 0xe0, 0xdb, 0x71, 0xa7, 0x84, 0xee, 0xc3, 0xbd, 0x93, 0x83, 0xc9, 0xab, 0xa9, 0x35, 0x3e, + 0x19, 0x1f, 0x4c, 0xc6, 0x2f, 0x3a, 0x65, 0xf3, 0x5d, 0x68, 0xc6, 0x31, 0xa3, 0x3a, 0x68, 0x07, + 0x93, 0x11, 0x3f, 0xf2, 0x62, 0x3c, 0x19, 0x75, 0x4a, 0xe6, 0x1f, 0x25, 0xe8, 0xaa, 0x14, 0x91, + 0x95, 0xef, 0x11, 0x1c, 0x71, 0x34, 0xf3, 0x43, 0x2f, 0xe6, 0x88, 0x2d, 0x10, 0x82, 0x8a, 0x87, + 0xdf, 0x4a, 0x86, 0xd8, 0x77, 0xa4, 0x49, 0x7d, 0x6a, 0xbb, 0x8c, 0x1d, 0xcd, 0xe2, 0x0b, 0xf4, + 0x29, 0x34, 0x44, 0xea, 0x44, 0xaf, 0xf4, 0xb4, 0x7e, 0x6b, 0xf8, 0x50, 0x05, 0x44, 0x78, 0xb4, + 0x62, 0x35, 0xf3, 0x10, 0x76, 0x0f, 0xb1, 0x8c, 0x84, 0xe3, 0x25, 0x6f, 0x4c, 0xe4, 0xd7, 0x5e, + 0x62, 0x16, 0x4c, 0xe4, 0xd7, 0x5e, 0x62, 0xa4, 0x43, 0x5d, 0x5c, 0x37, 0x16, 0x4e, 0xd5, 0x92, + 0x4b, 0x93, 0x82, 0xbe, 0x6e, 0x48, 0xe4, 0x95, 0x65, 0xe9, 0x43, 0xa8, 0x44, 0x95, 0xc0, 0xcc, + 0xb4, 0x86, 0x48, 0x8d, 0xf3, 0xd8, 0x5b, 0xf8, 0x16, 0x93, 0xab, 0x54, 0x69, 0x69, 0xaa, 0x8e, + 0x92, 0x5e, 0x47, 0xbe, 0x47, 0xb1, 0x47, 0xef, 0x16, 0xff, 0x09, 0xec, 0x65, 0x58, 0x12, 0x09, + 0xec, 0x43, 0x5d, 0x84, 0xc6, 0xac, 0xe5, 0xe2, 0x2a, 0xb5, 0xcc, 0xdf, 0x34, 0xe8, 0x9e, 0xad, + 0xe6, 0x36, 0xc5, 0x52, 0xb4, 0x21, 0xa8, 0xc7, 0x50, 0x65, 0x1d, 0x45, 0x60, 0x71, 0x9f, 0xdb, + 0xe6, 0x6d, 0x67, 0x14, 0xfd, 0xb5, 0xb8, 0x1c, 0x3d, 0x85, 0xda, 0x95, 0xed, 0x86, 0x98, 0x30, + 0x20, 0x62, 0xd4, 0x84, 0x26, 0x6b, 0x47, 0x96, 0xd0, 0x40, 0xbb, 0x50, 0x9f, 0x07, 0xd7, 0x51, + 0x3f, 0x61, 0x25, 0xd8, 0xb0, 0x6a, 0xf3, 0xe0, 0xda, 0x0a, 0x3d, 0xf4, 0x3e, 0xdc, 0x9b, 0x3b, + 0xc4, 0x3e, 0x77, 0xf1, 0xf4, 0xd2, 0xf7, 0xdf, 0x10, 0x56, 0x85, 0x0d, 0x6b, 0x5b, 0x6c, 0x1e, + 0x45, 0x7b, 0xc8, 0x88, 0x6e, 0xd2, 0x2c, 0xc0, 0x36, 0xc5, 0x7a, 0x8d, 0xc9, 0xe3, 0x75, 0x84, + 0x21, 0x75, 0x96, 0xd8, 0x0f, 0x29, 0x2b, 0x1d, 0xcd, 0x92, 0x4b, 0xf4, 0x1e, 0x6c, 0x07, 0x98, + 0x60, 0x3a, 0x15, 0x51, 0x36, 0xd8, 0xc9, 0x16, 0xdb, 0x7b, 0xcd, 0xc3, 0x42, 0x50, 0xf9, 0xd5, + 0x76, 0xa8, 0xde, 0x64, 0x22, 0xf6, 0xcd, 0x8f, 0x85, 0x04, 0xcb, 0x63, 0x20, 0x8f, 0x85, 0x04, + 0x8b, 0x63, 0x5d, 0xa8, 0x2e, 0xfc, 0x60, 0x86, 0xf5, 0x16, 0x93, 0xf1, 0x05, 0xea, 0x41, 0x6b, + 0x8e, 0xc9, 0x2c, 0x70, 0x56, 0x34, 0x62, 0x74, 0x9b, 0x61, 0x9a, 0xdc, 0x32, 0x8f, 0xe0, 0x61, + 0x8a, 0x86, 0xbb, 0x32, 0xfa, 0x7b, 0x19, 0x76, 0x2c, 0xdf, 0x75, 0xcf, 0xed, 0xd9, 0x9b, 0x02, + 0x9c, 0x26, 0xe0, 0x2f, 0x6f, 0x86, 0x5f, 0xcb, 0x80, 0x3f, 0x71, 0x4d, 0x2b, 0xca, 0x35, 0x55, + 0x88, 0xa9, 0xe6, 0x13, 0x53, 0x53, 0x89, 0x91, 0xa8, 0xd7, 0x13, 0xa8, 0xc7, 0x90, 0x36, 0x36, + 0x40, 0xda, 0x5c, 0x87, 0xf4, 0x6b, 0xd8, 0x5d, 0xc3, 0xe1, 0xae, 0xa0, 0xfe, 0x53, 0x86, 0x87, + 0xc7, 0x1e, 0xa1, 0xb6, 0xeb, 0xa6, 0x30, 0x8d, 0x6b, 0xa2, 0x54, 0xb8, 0x26, 0xca, 0xff, 0xa5, + 0x26, 0x34, 0x85, 0x14, 0xc9, 0x60, 0x25, 0xc1, 0x60, 0xa1, 0x3a, 0x51, 0xba, 0x53, 0x2d, 0xd5, + 0x9d, 0xd0, 0x3b, 0x00, 0xfc, 0x62, 0x33, 0xe3, 0x1c, 0xfc, 0x26, 0xdb, 0x39, 0x15, 0xcd, 0x48, + 0xf2, 0xd5, 0xc8, 0xe6, 0x2b, 0x59, 0x25, 0x7d, 0xe8, 0xc8, 0x78, 0x66, 0xc1, 0x9c, 0xc5, 0x24, + 0x2a, 0xa5, 0x2d, 0xf6, 0x47, 0xc1, 0x3c, 0x8a, 0x2a, 0xcd, 0x61, 0x6b, 0x9d, 0xc3, 0x63, 0xd8, + 0x49, 0xc3, 0x7e, 0x57, 0x0a, 0xff, 0x2c, 0xc1, 0xee, 0x99, 0xe7, 0x64, 0x92, 0x98, 0x55, 0x18, + 0x6b, 0xb0, 0x96, 0x33, 0x60, 0xed, 0x42, 0x75, 0x15, 0x06, 0x17, 0x58, 0xd0, 0xc4, 0x17, 0x49, + 0xbc, 0x2a, 0x2a, 0x5e, 0xa9, 0x8c, 0xab, 0xeb, 0x19, 0x4f, 0x41, 0x5f, 0x8f, 0xf2, 0x8e, 0x39, + 0x47, 0x79, 0xc5, 0x6f, 0x57, 0x93, 0xbf, 0x53, 0xe6, 0x03, 0xb8, 0x7f, 0x88, 0xe9, 0x6b, 0x5e, + 0xa6, 0x02, 0x00, 0x73, 0x0c, 0x28, 0xb9, 0x79, 0xe3, 0x4f, 0x6c, 0xa9, 0xfe, 0xe4, 0x20, 0x27, + 0xf5, 0xa5, 0x96, 0xf9, 0x05, 0xb3, 0x7d, 0xe4, 0x10, 0xea, 0x07, 0xd7, 0x9b, 0xc0, 0xed, 0x80, + 0xb6, 0xb4, 0xdf, 0x8a, 0xa7, 0x2d, 0xfa, 0x34, 0x0f, 0x59, 0x04, 0xf1, 0x51, 0x11, 0x41, 0x72, + 0x50, 0x28, 0x15, 0x1b, 0x14, 0x7e, 0x00, 0xf4, 0x0a, 0xc7, 0x33, 0xcb, 0x2d, 0x6f, 0xac, 0xa4, + 0xa9, 0xac, 0xd2, 0xa4, 0x43, 0x7d, 0xe6, 0x62, 0xdb, 0x0b, 0x57, 0x82, 0x58, 0xb9, 0x34, 0x7f, + 0x84, 0x07, 0x8a, 0x75, 0x11, 0x67, 0x94, 0x0f, 0xb9, 0x10, 0xd6, 0xa3, 0x4f, 0xf4, 0x39, 0xd4, + 0xf8, 0x20, 0xc7, 0x6c, 0xb7, 0x87, 0x8f, 0xd4, 0xb8, 0x99, 0x91, 0xd0, 0x13, 0x93, 0x9f, 0x25, + 0x74, 0x87, 0x7f, 0x37, 0xa0, 0x2d, 0x47, 0x13, 0x3e, 0x66, 0x22, 0x07, 0xb6, 0x93, 0x33, 0x18, + 0x7a, 0x92, 0x3f, 0x85, 0xa6, 0x46, 0x69, 0xe3, 0x69, 0x11, 0x55, 0x9e, 0x81, 0xb9, 0xf5, 0x49, + 0x09, 0x11, 0xe8, 0xa4, 0x47, 0x23, 0xf4, 0x2c, 0xdb, 0x46, 0xce, 0x2c, 0x66, 0x0c, 0x8a, 0xaa, + 0x4b, 0xb7, 0xe8, 0x8a, 0xdd, 0x19, 0x75, 0x9e, 0x41, 0xb7, 0x9a, 0x51, 0x47, 0x28, 0x63, 0xbf, + 0xb0, 0x7e, 0xec, 0xf7, 0x67, 0xb8, 0xa7, 0xbc, 0xb8, 0x28, 0x07, 0xad, 0xac, 0xe9, 0xc8, 0xf8, + 0xa8, 0x90, 0x6e, 0xec, 0x6b, 0x09, 0x6d, 0xb5, 0x8d, 0xa1, 0x1c, 0x03, 0x99, 0x6f, 0x8c, 0xf1, + 0x71, 0x31, 0xe5, 0xd8, 0x1d, 0x81, 0x4e, 0xba, 0x87, 0xe4, 0xf1, 0x98, 0xd3, 0x11, 0xf3, 0x78, + 0xcc, 0x6b, 0x4d, 0xe6, 0x16, 0xb2, 0x01, 0x6e, 0x5a, 0x08, 0x7a, 0x9c, 0x4b, 0x88, 0xda, 0x79, + 0x8c, 0xfe, 0xed, 0x8a, 0xb1, 0x8b, 0x15, 0xfc, 0x2f, 0xf5, 0xa2, 0xa3, 0x1c, 0x68, 0xb2, 0x07, + 0x20, 0xe3, 0x59, 0x41, 0xed, 0x54, 0x52, 0xa2, 0x2b, 0x6d, 0x48, 0x4a, 0x6d, 0x79, 0x1b, 0x92, + 0x4a, 0x35, 0x38, 0x73, 0x0b, 0x39, 0xd0, 0xb6, 0x42, 0x4f, 0xb8, 0x8e, 0xda, 0x02, 0xca, 0x39, + 0xbd, 0xde, 0xd5, 0x8c, 0x27, 0x05, 0x34, 0x6f, 0xea, 0xfb, 0x39, 0x7c, 0xdf, 0x90, 0xaa, 0xe7, + 0x35, 0xf6, 0x5f, 0xf8, 0x67, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x9d, 0x73, 0x4f, 0x4d, 0x73, + 0x10, 0x00, 0x00, } diff --git a/pkg/provenance/doc.go b/pkg/provenance/doc.go index dacfa9e69..bee484944 100644 --- a/pkg/provenance/doc.go +++ b/pkg/provenance/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/provenance/sign.go b/pkg/provenance/sign.go index ecd6612a3..5e23c2dda 100644 --- a/pkg/provenance/sign.go +++ b/pkg/provenance/sign.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/provenance/sign_test.go b/pkg/provenance/sign_test.go index 388941deb..d74e23887 100644 --- a/pkg/provenance/sign_test.go +++ b/pkg/provenance/sign_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/releasetesting/environment.go b/pkg/releasetesting/environment.go index 3b3d07933..17a22c21d 100644 --- a/pkg/releasetesting/environment.go +++ b/pkg/releasetesting/environment.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/releasetesting/environment_test.go b/pkg/releasetesting/environment_test.go index 0199b74eb..4403ab6a9 100644 --- a/pkg/releasetesting/environment_test.go +++ b/pkg/releasetesting/environment_test.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/releasetesting/test_suite.go b/pkg/releasetesting/test_suite.go index 2e42400ce..79f00301e 100644 --- a/pkg/releasetesting/test_suite.go +++ b/pkg/releasetesting/test_suite.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/releasetesting/test_suite_test.go b/pkg/releasetesting/test_suite_test.go index e6cc8bcf5..828b14e99 100644 --- a/pkg/releasetesting/test_suite_test.go +++ b/pkg/releasetesting/test_suite_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -134,7 +134,7 @@ func TestRun(t *testing.T) { } if result2.Status != release.TestRun_FAILURE { - t.Errorf("Expected test result to be successful, got: %v", result2.Status) + t.Errorf("Expected test result to be failure, got: %v", result2.Status) } } diff --git a/pkg/releaseutil/filter.go b/pkg/releaseutil/filter.go index fdd2cc381..458da705f 100644 --- a/pkg/releaseutil/filter.go +++ b/pkg/releaseutil/filter.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/releaseutil/filter_test.go b/pkg/releaseutil/filter_test.go index 590952363..802b1db7a 100644 --- a/pkg/releaseutil/filter_test.go +++ b/pkg/releaseutil/filter_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/releaseutil/manifest.go b/pkg/releaseutil/manifest.go index a0449cc55..78c2979c4 100644 --- a/pkg/releaseutil/manifest.go +++ b/pkg/releaseutil/manifest.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/releaseutil/manifest_test.go b/pkg/releaseutil/manifest_test.go index 7906279ad..8e0793d5f 100644 --- a/pkg/releaseutil/manifest_test.go +++ b/pkg/releaseutil/manifest_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/releaseutil/sorter.go b/pkg/releaseutil/sorter.go index 1b744d72c..1a13298b0 100644 --- a/pkg/releaseutil/sorter.go +++ b/pkg/releaseutil/sorter.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/releaseutil/sorter_test.go b/pkg/releaseutil/sorter_test.go index 7d4e31e2e..a3323bd96 100644 --- a/pkg/releaseutil/sorter_test.go +++ b/pkg/releaseutil/sorter_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/repo/chartrepo.go b/pkg/repo/chartrepo.go index 438f66d7c..6e14d8c03 100644 --- a/pkg/repo/chartrepo.go +++ b/pkg/repo/chartrepo.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/repo/chartrepo_test.go b/pkg/repo/chartrepo_test.go index 948ee12d3..44834178e 100644 --- a/pkg/repo/chartrepo_test.go +++ b/pkg/repo/chartrepo_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/repo/doc.go b/pkg/repo/doc.go index fb8b3f4b2..19ccf267c 100644 --- a/pkg/repo/doc.go +++ b/pkg/repo/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/repo/index.go b/pkg/repo/index.go index 174ceea01..01bf4a8ca 100644 --- a/pkg/repo/index.go +++ b/pkg/repo/index.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/repo/index_test.go b/pkg/repo/index_test.go index ba426b174..2ce817ce3 100644 --- a/pkg/repo/index_test.go +++ b/pkg/repo/index_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/repo/local.go b/pkg/repo/local.go index f13a4d0ac..caca1b9c2 100644 --- a/pkg/repo/local.go +++ b/pkg/repo/local.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/repo/local_test.go b/pkg/repo/local_test.go index 1e5359dee..cf6cf2d11 100644 --- a/pkg/repo/local_test.go +++ b/pkg/repo/local_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/repo/repo.go b/pkg/repo/repo.go index b5bba164e..fa550357a 100644 --- a/pkg/repo/repo.go +++ b/pkg/repo/repo.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/repo/repo_test.go b/pkg/repo/repo_test.go index 4b5bcdbf5..264e9bc3c 100644 --- a/pkg/repo/repo_test.go +++ b/pkg/repo/repo_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/repo/repotest/doc.go b/pkg/repo/repotest/doc.go index 34d4bc6b0..3bf98aa7e 100644 --- a/pkg/repo/repotest/doc.go +++ b/pkg/repo/repotest/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/repo/repotest/server.go b/pkg/repo/repotest/server.go index 8ea9103a0..36ab10d70 100644 --- a/pkg/repo/repotest/server.go +++ b/pkg/repo/repotest/server.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/repo/repotest/server_test.go b/pkg/repo/repotest/server_test.go index 61c056172..e4819fbf7 100644 --- a/pkg/repo/repotest/server_test.go +++ b/pkg/repo/repotest/server_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/resolver/resolver.go b/pkg/resolver/resolver.go index ec8ea2cce..8177df2d3 100644 --- a/pkg/resolver/resolver.go +++ b/pkg/resolver/resolver.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/resolver/resolver_test.go b/pkg/resolver/resolver_test.go index 78a0bc46c..689ffbc32 100644 --- a/pkg/resolver/resolver_test.go +++ b/pkg/resolver/resolver_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/rudder/client.go b/pkg/rudder/client.go index 219bb010a..093a0c360 100644 --- a/pkg/rudder/client.go +++ b/pkg/rudder/client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/storage/driver/cfgmaps.go b/pkg/storage/driver/cfgmaps.go index 51fa8f8f6..3f5ee204a 100644 --- a/pkg/storage/driver/cfgmaps.go +++ b/pkg/storage/driver/cfgmaps.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/storage/driver/cfgmaps_test.go b/pkg/storage/driver/cfgmaps_test.go index 7501ad9cb..c028e9fdf 100644 --- a/pkg/storage/driver/cfgmaps_test.go +++ b/pkg/storage/driver/cfgmaps_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/storage/driver/driver.go b/pkg/storage/driver/driver.go index e01d35d64..d8c4122b5 100644 --- a/pkg/storage/driver/driver.go +++ b/pkg/storage/driver/driver.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/storage/driver/labels.go b/pkg/storage/driver/labels.go index 8668d665b..eb7118fe5 100644 --- a/pkg/storage/driver/labels.go +++ b/pkg/storage/driver/labels.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/storage/driver/labels_test.go b/pkg/storage/driver/labels_test.go index af0bd24e5..e8d7fc90c 100644 --- a/pkg/storage/driver/labels_test.go +++ b/pkg/storage/driver/labels_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/storage/driver/memory.go b/pkg/storage/driver/memory.go index ceb0d67dd..ea3faf26b 100644 --- a/pkg/storage/driver/memory.go +++ b/pkg/storage/driver/memory.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/storage/driver/memory_test.go b/pkg/storage/driver/memory_test.go index 1062071e7..4f45cf72b 100644 --- a/pkg/storage/driver/memory_test.go +++ b/pkg/storage/driver/memory_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/storage/driver/mock_test.go b/pkg/storage/driver/mock_test.go index 979d11cb6..1ebe7f650 100644 --- a/pkg/storage/driver/mock_test.go +++ b/pkg/storage/driver/mock_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/storage/driver/records.go b/pkg/storage/driver/records.go index ce72308a8..bc793d8b3 100644 --- a/pkg/storage/driver/records.go +++ b/pkg/storage/driver/records.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/storage/driver/records_test.go b/pkg/storage/driver/records_test.go index 79380afb8..8063ab9dc 100644 --- a/pkg/storage/driver/records_test.go +++ b/pkg/storage/driver/records_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/storage/driver/secrets.go b/pkg/storage/driver/secrets.go index e8f3984f6..1b8064e53 100644 --- a/pkg/storage/driver/secrets.go +++ b/pkg/storage/driver/secrets.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/storage/driver/secrets_test.go b/pkg/storage/driver/secrets_test.go index e6f62e702..6c9c63ad4 100644 --- a/pkg/storage/driver/secrets_test.go +++ b/pkg/storage/driver/secrets_test.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/storage/driver/util.go b/pkg/storage/driver/util.go index 65fb17e7c..7807382b6 100644 --- a/pkg/storage/driver/util.go +++ b/pkg/storage/driver/util.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/storage/storage.go b/pkg/storage/storage.go index 4b39e0bb2..40fc558a1 100644 --- a/pkg/storage/storage.go +++ b/pkg/storage/storage.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -163,7 +163,7 @@ func (s *Storage) History(name string) ([]*rspb.Release, error) { return s.Driver.Query(map[string]string{"NAME": name, "OWNER": "TILLER"}) } -// removeLeastRecent removes items from history until the lengh number of releases +// removeLeastRecent removes items from history until the length number of releases // does not exceed max. // // We allow max to be set explicitly so that calling functions can "make space" diff --git a/pkg/storage/storage_test.go b/pkg/storage/storage_test.go index fb2824de7..19d786ad9 100644 --- a/pkg/storage/storage_test.go +++ b/pkg/storage/storage_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/strvals/doc.go b/pkg/strvals/doc.go index d2b859e67..f17290587 100644 --- a/pkg/strvals/doc.go +++ b/pkg/strvals/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/strvals/parser.go b/pkg/strvals/parser.go index 90670a4dd..1fd9ab81e 100644 --- a/pkg/strvals/parser.go +++ b/pkg/strvals/parser.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -50,6 +50,20 @@ func Parse(s string) (map[string]interface{}, error) { return vals, err } +// ParseFile parses a set line, but its final value is loaded from the file at the path specified by the original value. +// +// A set line is of the form name1=path1,name2=path2 +// +// When the files at path1 and path2 contained "val1" and "val2" respectively, the set line is consumed as +// name1=val1,name2=val2 +func ParseFile(s string, runesToVal runesToVal) (map[string]interface{}, error) { + vals := map[string]interface{}{} + scanner := bytes.NewBufferString(s) + t := newFileParser(scanner, vals, runesToVal) + err := t.parse() + return vals, err +} + // ParseString parses a set line and forces a string value. // // A set line is of the form name1=value1,name2=value2 @@ -71,6 +85,15 @@ func ParseInto(s string, dest map[string]interface{}) error { return t.parse() } +// ParseIntoFile parses a filevals line and merges the result into dest. +// +// This method always returns a string as the value. +func ParseIntoFile(s string, dest map[string]interface{}, runesToVal runesToVal) error { + scanner := bytes.NewBufferString(s) + t := newFileParser(scanner, dest, runesToVal) + return t.parse() +} + // ParseIntoString parses a strvals line nad merges the result into dest. // // This method always returns a string as the value. @@ -87,13 +110,22 @@ func ParseIntoString(s string, dest map[string]interface{}) error { // where data is the final parsed data from the parses with correct types // where st is a boolean to figure out if we're forcing it to parse values as string type parser struct { - sc *bytes.Buffer - data map[string]interface{} - st bool + sc *bytes.Buffer + data map[string]interface{} + runesToVal runesToVal } +type runesToVal func([]rune) (interface{}, error) + func newParser(sc *bytes.Buffer, data map[string]interface{}, stringBool bool) *parser { - return &parser{sc: sc, data: data, st: stringBool} + rs2v := func(rs []rune) (interface{}, error) { + return typedVal(rs, stringBool), nil + } + return &parser{sc: sc, data: data, runesToVal: rs2v} +} + +func newFileParser(sc *bytes.Buffer, data map[string]interface{}, runesToVal runesToVal) *parser { + return &parser{sc: sc, data: data, runesToVal: runesToVal} } func (t *parser) parse() error { @@ -157,8 +189,12 @@ func (t *parser) key(data map[string]interface{}) error { set(data, string(k), "") return e case ErrNotList: - v, e := t.val() - set(data, string(k), typedVal(v, t.st)) + rs, e := t.val() + if e != nil && e != io.EOF { + return e + } + v, e := t.runesToVal(rs) + set(data, string(k), v) return e default: return e @@ -230,8 +266,12 @@ func (t *parser) listItem(list []interface{}, i int) ([]interface{}, error) { case io.EOF: return setIndex(list, i, ""), err case ErrNotList: - v, e := t.val() - return setIndex(list, i, typedVal(v, t.st)), e + rs, e := t.val() + if e != nil && e != io.EOF { + return list, e + } + v, e := t.runesToVal(rs) + return setIndex(list, i, v), e default: return list, e } @@ -279,7 +319,7 @@ func (t *parser) valList() ([]interface{}, error) { list := []interface{}{} stop := runeSet([]rune{',', '}'}) for { - switch v, last, err := runesUntil(t.sc, stop); { + switch rs, last, err := runesUntil(t.sc, stop); { case err != nil: if err == io.EOF { err = errors.New("list must terminate with '}'") @@ -290,10 +330,15 @@ func (t *parser) valList() ([]interface{}, error) { if r, _, e := t.sc.ReadRune(); e == nil && r != ',' { t.sc.UnreadRune() } - list = append(list, typedVal(v, t.st)) - return list, nil + v, e := t.runesToVal(rs) + list = append(list, v) + return list, e case last == ',': - list = append(list, typedVal(v, t.st)) + v, e := t.runesToVal(rs) + if e != nil { + return list, e + } + list = append(list, v) } } } @@ -325,6 +370,11 @@ func inMap(k rune, m map[rune]bool) bool { func typedVal(v []rune, st bool) interface{} { val := string(v) + + if st { + return val + } + if strings.EqualFold(val, "true") { return true } @@ -337,8 +387,8 @@ func typedVal(v []rune, st bool) interface{} { return nil } - // If this value does not start with zero, and not returnString, try parsing it to an int - if !st && len(val) != 0 && val[0] != '0' { + // If this value does not start with zero, try parsing it to an int + if len(val) != 0 && val[0] != '0' { if iv, err := strconv.ParseInt(val, 10, 64); err == nil { return iv } diff --git a/pkg/strvals/parser_test.go b/pkg/strvals/parser_test.go index c897cf0a7..e5d878149 100644 --- a/pkg/strvals/parser_test.go +++ b/pkg/strvals/parser_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -75,6 +75,16 @@ func TestParseSet(t *testing.T) { expect: map[string]interface{}{"long_int_string": "1234567890"}, err: false, }, + { + str: "boolean=true", + expect: map[string]interface{}{"boolean": "true"}, + err: false, + }, + { + str: "is_null=null", + expect: map[string]interface{}{"is_null": "null"}, + err: false, + }, } tests := []struct { str string @@ -117,6 +127,15 @@ func TestParseSet(t *testing.T) { str: "long_int=1234567890", expect: map[string]interface{}{"long_int": 1234567890}, }, + { + str: "boolean=true", + expect: map[string]interface{}{"boolean": true}, + }, + { + str: "is_null=null", + expect: map[string]interface{}{"is_null": nil}, + err: false, + }, { str: "name1,name2=", err: true, @@ -336,12 +355,13 @@ func TestParseInto(t *testing.T) { "inner2": "value2", }, } - input := "outer.inner1=value1,outer.inner3=value3" + input := "outer.inner1=value1,outer.inner3=value3,outer.inner4=4" expect := map[string]interface{}{ "outer": map[string]interface{}{ "inner1": "value1", "inner2": "value2", "inner3": "value3", + "inner4": 4, }, } @@ -362,6 +382,72 @@ func TestParseInto(t *testing.T) { t.Errorf("%s: Expected:\n%s\nGot:\n%s", input, y1, y2) } } +func TestParseIntoString(t *testing.T) { + got := map[string]interface{}{ + "outer": map[string]interface{}{ + "inner1": "overwrite", + "inner2": "value2", + }, + } + input := "outer.inner1=1,outer.inner3=3" + expect := map[string]interface{}{ + "outer": map[string]interface{}{ + "inner1": "1", + "inner2": "value2", + "inner3": "3", + }, + } + + if err := ParseIntoString(input, got); err != nil { + t.Fatal(err) + } + + y1, err := yaml.Marshal(expect) + if err != nil { + t.Fatal(err) + } + y2, err := yaml.Marshal(got) + if err != nil { + t.Fatalf("Error serializing parsed value: %s", err) + } + + if string(y1) != string(y2) { + t.Errorf("%s: Expected:\n%s\nGot:\n%s", input, y1, y2) + } +} + +func TestParseIntoFile(t *testing.T) { + got := map[string]interface{}{} + input := "name1=path1" + expect := map[string]interface{}{ + "name1": "value1", + } + rs2v := func(rs []rune) (interface{}, error) { + v := string(rs) + if v != "path1" { + t.Errorf("%s: runesToVal: Expected value path1, got %s", input, v) + return "", nil + } + return "value1", nil + } + + if err := ParseIntoFile(input, got, rs2v); err != nil { + t.Fatal(err) + } + + y1, err := yaml.Marshal(expect) + if err != nil { + t.Fatal(err) + } + y2, err := yaml.Marshal(got) + if err != nil { + t.Fatalf("Error serializing parsed value: %s", err) + } + + if string(y1) != string(y2) { + t.Errorf("%s: Expected:\n%s\nGot:\n%s", input, y1, y2) + } +} func TestToYAML(t *testing.T) { // The TestParse does the hard part. We just verify that YAML formatting is diff --git a/pkg/sympath/walk.go b/pkg/sympath/walk.go index 77fa04153..b2500284a 100644 --- a/pkg/sympath/walk.go +++ b/pkg/sympath/walk.go @@ -4,7 +4,7 @@ the BSD license. https://github.com/golang/go/blob/master/LICENSE -Copyright 2017 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/sympath/walk_test.go b/pkg/sympath/walk_test.go index d86d8dabd..ab8e0eb4c 100644 --- a/pkg/sympath/walk_test.go +++ b/pkg/sympath/walk_test.go @@ -4,7 +4,7 @@ the BSD license. https://github.com/golang/go/blob/master/LICENSE -Copyright 2017 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pkg/tiller/environment/environment.go b/pkg/tiller/environment/environment.go index 366fdf522..b38230bab 100644 --- a/pkg/tiller/environment/environment.go +++ b/pkg/tiller/environment/environment.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -98,8 +98,6 @@ type Engine interface { type KubeClient interface { // Create creates one or more resources. // - // namespace must contain a valid existing namespace. - // // reader must contain a YAML stream (one or more YAML documents separated // by "\n---\n"). Create(namespace string, reader io.Reader, timeout int64, shouldWait bool) error diff --git a/pkg/tiller/environment/environment_test.go b/pkg/tiller/environment/environment_test.go index d8c82b901..0c10cda37 100644 --- a/pkg/tiller/environment/environment_test.go +++ b/pkg/tiller/environment/environment_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/tiller/hook_sorter.go b/pkg/tiller/hook_sorter.go index 42d546620..11fa61533 100644 --- a/pkg/tiller/hook_sorter.go +++ b/pkg/tiller/hook_sorter.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/tiller/hook_sorter_test.go b/pkg/tiller/hook_sorter_test.go index ac5b9bf8d..efe960ca4 100644 --- a/pkg/tiller/hook_sorter_test.go +++ b/pkg/tiller/hook_sorter_test.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/tiller/hooks.go b/pkg/tiller/hooks.go index 2dd085ed7..d53ed504f 100644 --- a/pkg/tiller/hooks.go +++ b/pkg/tiller/hooks.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/tiller/hooks_test.go b/pkg/tiller/hooks_test.go index 658f859f4..8bd928500 100644 --- a/pkg/tiller/hooks_test.go +++ b/pkg/tiller/hooks_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/tiller/kind_sorter.go b/pkg/tiller/kind_sorter.go index 43726d53e..65e3f478d 100644 --- a/pkg/tiller/kind_sorter.go +++ b/pkg/tiller/kind_sorter.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/tiller/kind_sorter_test.go b/pkg/tiller/kind_sorter_test.go index 8d01fac17..fb3e8ad57 100644 --- a/pkg/tiller/kind_sorter_test.go +++ b/pkg/tiller/kind_sorter_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/tiller/release_content.go b/pkg/tiller/release_content.go index fd783d6b6..2315f1aaa 100644 --- a/pkg/tiller/release_content.go +++ b/pkg/tiller/release_content.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/tiller/release_content_test.go b/pkg/tiller/release_content_test.go index 7c003f709..4a29c5d3e 100644 --- a/pkg/tiller/release_content_test.go +++ b/pkg/tiller/release_content_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/tiller/release_history.go b/pkg/tiller/release_history.go index 0dd525978..fe7ad1395 100644 --- a/pkg/tiller/release_history.go +++ b/pkg/tiller/release_history.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/tiller/release_history_test.go b/pkg/tiller/release_history_test.go index 5df98410f..58b7fad9a 100644 --- a/pkg/tiller/release_history_test.go +++ b/pkg/tiller/release_history_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/tiller/release_install.go b/pkg/tiller/release_install.go index 0b8f4da5b..973da3581 100644 --- a/pkg/tiller/release_install.go +++ b/pkg/tiller/release_install.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -250,7 +250,11 @@ func (s *ReleaseServer) performRelease(r *release.Release, req *services.Install } r.Info.Status.Code = release.Status_DEPLOYED - r.Info.Description = "Install complete" + if req.Description == "" { + r.Info.Description = "Install complete" + } else { + r.Info.Description = req.Description + } // This is a tricky case. The release has been created, but the result // cannot be recorded. The truest thing to tell the user is that the // release was created. However, the user will not be able to do anything diff --git a/pkg/tiller/release_install_test.go b/pkg/tiller/release_install_test.go index a244e4b72..f5e84d870 100644 --- a/pkg/tiller/release_install_test.go +++ b/pkg/tiller/release_install_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -495,3 +495,23 @@ func TestInstallRelease_WrongKubeVersion(t *testing.T) { t.Errorf("Expected %q to contain %q", err.Error(), expect) } } + +func TestInstallRelease_Description(t *testing.T) { + c := helm.NewContext() + rs := rsFixture() + rs.env.Releases.Create(releaseStub()) + + customDescription := "foo" + req := &services.InstallReleaseRequest{ + Chart: chartStub(), + Description: customDescription, + } + res, err := rs.InstallRelease(c, req) + if err != nil { + t.Errorf("Failed install: %s", err) + } + + if desc := res.Release.Info.Description; desc != customDescription { + t.Errorf("Expected description %q. Got %q", customDescription, desc) + } +} diff --git a/pkg/tiller/release_list.go b/pkg/tiller/release_list.go index 72c21d97c..3344888dc 100644 --- a/pkg/tiller/release_list.go +++ b/pkg/tiller/release_list.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/tiller/release_list_test.go b/pkg/tiller/release_list_test.go index 64877422a..7b0fe6830 100644 --- a/pkg/tiller/release_list_test.go +++ b/pkg/tiller/release_list_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/tiller/release_modules.go b/pkg/tiller/release_modules.go index 876e1ba37..a587581ed 100644 --- a/pkg/tiller/release_modules.go +++ b/pkg/tiller/release_modules.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/tiller/release_rollback.go b/pkg/tiller/release_rollback.go index fa3d943f4..75e282fb8 100644 --- a/pkg/tiller/release_rollback.go +++ b/pkg/tiller/release_rollback.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -86,6 +86,11 @@ func (s *ReleaseServer) prepareRollback(req *services.RollbackReleaseRequest) (* return nil, nil, err } + description := req.Description + if req.Description == "" { + description = fmt.Sprintf("Rollback to %d", previousVersion) + } + // Store a new release object with previous release's configuration targetRelease := &release.Release{ Name: req.Name, @@ -101,7 +106,7 @@ func (s *ReleaseServer) prepareRollback(req *services.RollbackReleaseRequest) (* }, // Because we lose the reference to previous version elsewhere, we set the // message here, and only override it later if we experience failure. - Description: fmt.Sprintf("Rollback to %d", previousVersion), + Description: description, }, Version: currentRelease.Version + 1, Manifest: previousRelease.Manifest, diff --git a/pkg/tiller/release_rollback_test.go b/pkg/tiller/release_rollback_test.go index b73501a36..d7909ed8b 100644 --- a/pkg/tiller/release_rollback_test.go +++ b/pkg/tiller/release_rollback_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -252,3 +252,35 @@ func TestRollbackReleaseFailure(t *testing.T) { t.Errorf("Expected SUPERSEDED status on previous Release version. Got %v", oldStatus) } } + +func TestRollbackReleaseWithCustomDescription(t *testing.T) { + c := helm.NewContext() + rs := rsFixture() + rel := releaseStub() + rs.env.Releases.Create(rel) + upgradedRel := upgradeReleaseVersion(rel) + rs.env.Releases.Update(rel) + rs.env.Releases.Create(upgradedRel) + + customDescription := "foo" + req := &services.RollbackReleaseRequest{ + Name: rel.Name, + Description: customDescription, + } + res, err := rs.RollbackRelease(c, req) + if err != nil { + t.Fatalf("Failed rollback: %s", err) + } + + if res.Release.Name == "" { + t.Errorf("Expected release name.") + } + + if res.Release.Name != rel.Name { + t.Errorf("Updated release name does not match previous release name. Expected %s, got %s", rel.Name, res.Release.Name) + } + + if res.Release.Info.Description != customDescription { + t.Errorf("Expected Description to be %q, got %q", customDescription, res.Release.Info.Description) + } +} diff --git a/pkg/tiller/release_server.go b/pkg/tiller/release_server.go index 1a2b3c4da..bde4c8465 100644 --- a/pkg/tiller/release_server.go +++ b/pkg/tiller/release_server.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -190,7 +190,7 @@ func (s *ReleaseServer) uniqName(start string, reuse bool) (string, error) { s.Log("name %s exists but is not in use, reusing name", start) return start, nil } else if reuse { - return "", errors.New("cannot re-use a name that is still in use") + return "", fmt.Errorf("a released named %s is in use, cannot re-use a name that is still in use", start) } return "", fmt.Errorf("a release named %s already exists.\nRun: helm ls --all %s; to check the status of the release\nOr run: helm del --purge %s; to delete it", start, start, start) diff --git a/pkg/tiller/release_server_test.go b/pkg/tiller/release_server_test.go index 96cb84a75..b3b1bc49d 100644 --- a/pkg/tiller/release_server_test.go +++ b/pkg/tiller/release_server_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/tiller/release_status.go b/pkg/tiller/release_status.go index e0d75877d..3f8047118 100644 --- a/pkg/tiller/release_status.go +++ b/pkg/tiller/release_status.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/tiller/release_status_test.go b/pkg/tiller/release_status_test.go index 4ba0f6cd5..69a710143 100644 --- a/pkg/tiller/release_status_test.go +++ b/pkg/tiller/release_status_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/tiller/release_testing.go b/pkg/tiller/release_testing.go index a44b67e6f..06d41e323 100644 --- a/pkg/tiller/release_testing.go +++ b/pkg/tiller/release_testing.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/tiller/release_testing_test.go b/pkg/tiller/release_testing_test.go index f8d92ebcc..e0fc7df41 100644 --- a/pkg/tiller/release_testing_test.go +++ b/pkg/tiller/release_testing_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/tiller/release_uninstall.go b/pkg/tiller/release_uninstall.go index 423b6e7ef..2ae3e4c36 100644 --- a/pkg/tiller/release_uninstall.go +++ b/pkg/tiller/release_uninstall.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -97,7 +97,11 @@ func (s *ReleaseServer) UninstallRelease(c ctx.Context, req *services.UninstallR } rel.Info.Status.Code = release.Status_DELETED - rel.Info.Description = "Deletion complete" + if req.Description == "" { + rel.Info.Description = "Deletion complete" + } else { + rel.Info.Description = req.Description + } if req.Purge { s.Log("purge requested for %s", req.Name) diff --git a/pkg/tiller/release_uninstall_test.go b/pkg/tiller/release_uninstall_test.go index 20bfd2486..d33e9c2a6 100644 --- a/pkg/tiller/release_uninstall_test.go +++ b/pkg/tiller/release_uninstall_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -176,3 +176,24 @@ func TestUninstallReleaseNoHooks(t *testing.T) { t.Errorf("Expected LastRun to be zero, got %d.", res.Release.Hooks[0].LastRun.Seconds) } } + +func TestUninstallReleaseCustomDescription(t *testing.T) { + c := helm.NewContext() + rs := rsFixture() + rs.env.Releases.Create(releaseStub()) + + customDescription := "foo" + req := &services.UninstallReleaseRequest{ + Name: "angry-panda", + Description: "foo", + } + + res, err := rs.UninstallRelease(c, req) + if err != nil { + t.Errorf("Failed uninstall: %s", err) + } + + if res.Release.Info.Description != customDescription { + t.Errorf("Expected description to be %q, got %q", customDescription, res.Release.Info.Description) + } +} diff --git a/pkg/tiller/release_update.go b/pkg/tiller/release_update.go index 6f5d37331..5cd82dfc5 100644 --- a/pkg/tiller/release_update.go +++ b/pkg/tiller/release_update.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -161,6 +161,10 @@ func (s *ReleaseServer) performUpdateForce(req *services.UpdateReleaseRequest) ( Timeout: req.Timeout, Wait: req.Wait, }) + + // update new release with next revision number so as to append to the old release's history + newRelease.Version = oldRelease.Version + 1 + res := &services.UpdateReleaseResponse{Release: newRelease} if err != nil { s.Log("failed update prepare step: %s", err) @@ -172,6 +176,12 @@ func (s *ReleaseServer) performUpdateForce(req *services.UpdateReleaseRequest) ( return res, err } + if req.DryRun { + s.Log("dry run for %s", newRelease.Name) + res.Release.Info.Description = "Dry run complete" + return res, nil + } + // From here on out, the release is considered to be in Status_DELETING or Status_DELETED // state. There is no turning back. oldRelease.Info.Status.Code = release.Status_DELETING @@ -218,8 +228,6 @@ func (s *ReleaseServer) performUpdateForce(req *services.UpdateReleaseRequest) ( } } - // update new release with next revision number so as to append to the old release's history - newRelease.Version = oldRelease.Version + 1 s.recordRelease(newRelease, false) if err := s.ReleaseModule.Update(oldRelease, newRelease, req, s.env); err != nil { msg := fmt.Sprintf("Upgrade %q failed: %s", newRelease.Name, err) @@ -243,7 +251,11 @@ func (s *ReleaseServer) performUpdateForce(req *services.UpdateReleaseRequest) ( } newRelease.Info.Status.Code = release.Status_DEPLOYED - newRelease.Info.Description = "Upgrade complete" + if req.Description == "" { + newRelease.Info.Description = "Upgrade complete" + } else { + newRelease.Info.Description = req.Description + } s.recordRelease(newRelease, true) return res, nil @@ -287,7 +299,11 @@ func (s *ReleaseServer) performUpdate(originalRelease, updatedRelease *release.R s.recordRelease(originalRelease, true) updatedRelease.Info.Status.Code = release.Status_DEPLOYED - updatedRelease.Info.Description = "Upgrade complete" + if req.Description == "" { + updatedRelease.Info.Description = "Upgrade complete" + } else { + updatedRelease.Info.Description = req.Description + } return res, nil } diff --git a/pkg/tiller/release_update_test.go b/pkg/tiller/release_update_test.go index a1b9a4bff..519b839fc 100644 --- a/pkg/tiller/release_update_test.go +++ b/pkg/tiller/release_update_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -432,6 +432,55 @@ func TestUpdateReleaseNoChanges(t *testing.T) { } } +func TestUpdateReleaseCustomDescription(t *testing.T) { + c := helm.NewContext() + rs := rsFixture() + rel := releaseStub() + rs.env.Releases.Create(rel) + + customDescription := "foo" + + req := &services.UpdateReleaseRequest{ + Name: rel.Name, + Chart: rel.GetChart(), + Description: customDescription, + } + + res, err := rs.UpdateRelease(c, req) + if err != nil { + t.Fatalf("Failed updated: %s", err) + } + if res.Release.Info.Description != customDescription { + t.Errorf("Expected release description to be %q, got %q", customDescription, res.Release.Info.Description) + } + compareStoredAndReturnedRelease(t, *rs, *res) +} + +func TestUpdateReleaseCustomDescription_Force(t *testing.T) { + c := helm.NewContext() + rs := rsFixture() + rel := releaseStub() + rs.env.Releases.Create(rel) + + customDescription := "foo" + + req := &services.UpdateReleaseRequest{ + Name: rel.Name, + Chart: rel.GetChart(), + Force: true, + Description: customDescription, + } + + res, err := rs.UpdateRelease(c, req) + if err != nil { + t.Fatalf("Failed updated: %s", err) + } + if res.Release.Info.Description != customDescription { + t.Errorf("Expected release description to be %q, got %q", customDescription, res.Release.Info.Description) + } + compareStoredAndReturnedRelease(t, *rs, *res) +} + func compareStoredAndReturnedRelease(t *testing.T, rs ReleaseServer, res services.UpdateReleaseResponse) *release.Release { storedRelease, err := rs.env.Releases.Get(res.Release.Name, res.Release.Version) if err != nil { diff --git a/pkg/tiller/release_version.go b/pkg/tiller/release_version.go index 66b7137bb..0656a1ab9 100644 --- a/pkg/tiller/release_version.go +++ b/pkg/tiller/release_version.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/tiller/resource_policy.go b/pkg/tiller/resource_policy.go index 66da1283f..cca2391d8 100644 --- a/pkg/tiller/resource_policy.go +++ b/pkg/tiller/resource_policy.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/tiller/server.go b/pkg/tiller/server.go index 818cfd47a..0fbcd4533 100644 --- a/pkg/tiller/server.go +++ b/pkg/tiller/server.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/timeconv/doc.go b/pkg/timeconv/doc.go index 235167391..0565a45cd 100644 --- a/pkg/timeconv/doc.go +++ b/pkg/timeconv/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/timeconv/timeconv.go b/pkg/timeconv/timeconv.go index 24ff10f4e..4d11abfe6 100644 --- a/pkg/timeconv/timeconv.go +++ b/pkg/timeconv/timeconv.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/timeconv/timeconv_test.go b/pkg/timeconv/timeconv_test.go index f673df3c9..bd22a238d 100644 --- a/pkg/timeconv/timeconv_test.go +++ b/pkg/timeconv/timeconv_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/tlsutil/cfg.go b/pkg/tlsutil/cfg.go index 9ce3109e1..408867db1 100644 --- a/pkg/tlsutil/cfg.go +++ b/pkg/tlsutil/cfg.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/tlsutil/tls.go b/pkg/tlsutil/tls.go index c166a1662..6b0052acc 100644 --- a/pkg/tlsutil/tls.go +++ b/pkg/tlsutil/tls.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/tlsutil/tlsutil_test.go b/pkg/tlsutil/tlsutil_test.go index 4f04d50ab..a4b3c9c22 100644 --- a/pkg/tlsutil/tlsutil_test.go +++ b/pkg/tlsutil/tlsutil_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/urlutil/urlutil.go b/pkg/urlutil/urlutil.go index fb67708ae..272907de0 100644 --- a/pkg/urlutil/urlutil.go +++ b/pkg/urlutil/urlutil.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/urlutil/urlutil_test.go b/pkg/urlutil/urlutil_test.go index f0c82c0a9..616c4f14f 100644 --- a/pkg/urlutil/urlutil_test.go +++ b/pkg/urlutil/urlutil_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/version/compatible.go b/pkg/version/compatible.go index 735610778..d0516a9d0 100644 --- a/pkg/version/compatible.go +++ b/pkg/version/compatible.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/version/compatible_test.go b/pkg/version/compatible_test.go index adc1c489e..7a3b23a7d 100644 --- a/pkg/version/compatible_test.go +++ b/pkg/version/compatible_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/version/doc.go b/pkg/version/doc.go index 23c9e500d..3b61dd50e 100644 --- a/pkg/version/doc.go +++ b/pkg/version/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/version/version.go b/pkg/version/version.go index 6f5a1a452..b2ea2c50f 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/version/version_test.go b/pkg/version/version_test.go index e0e4cac0f..eba573533 100644 --- a/pkg/version/version_test.go +++ b/pkg/version/version_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors All rights reserved. +Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile index ca5ad2225..82dfa0d4c 100644 --- a/rootfs/Dockerfile +++ b/rootfs/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2016 The Kubernetes Authors. +# Copyright The Helm Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,13 +14,14 @@ FROM alpine:3.7 -RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/* +RUN apk update && apk add ca-certificates socat && rm -rf /var/cache/apk/* ENV HOME /tmp -COPY tiller /bin/tiller +COPY helm /helm +COPY tiller /tiller EXPOSE 44134 USER nobody -ENTRYPOINT ["/bin/tiller"] +ENTRYPOINT ["/tiller"] diff --git a/rootfs/Dockerfile.experimental b/rootfs/Dockerfile.experimental index 66a218477..ca0c87f30 100644 --- a/rootfs/Dockerfile.experimental +++ b/rootfs/Dockerfile.experimental @@ -1,4 +1,4 @@ -# Copyright 2017 The Kubernetes Authors. +# Copyright The Helm Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,9 +18,9 @@ RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/* ENV HOME /tmp -COPY tiller /bin/tiller +COPY tiller /tiller EXPOSE 44134 USER nobody -ENTRYPOINT ["/bin/tiller", "--experimental-release"] +ENTRYPOINT ["/tiller", "--experimental-release"] diff --git a/rootfs/Dockerfile.rudder b/rootfs/Dockerfile.rudder index 6bb3a2d92..61afb8af8 100644 --- a/rootfs/Dockerfile.rudder +++ b/rootfs/Dockerfile.rudder @@ -1,4 +1,4 @@ -# Copyright 2017 The Kubernetes Authors. +# Copyright The Helm Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/coverage.sh b/scripts/coverage.sh index 1863d5835..62d495769 100755 --- a/scripts/coverage.sh +++ b/scripts/coverage.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright 2016 The Kubernetes Authors All rights reserved. +# Copyright The Helm Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/get b/scripts/get index af0960abf..79dd69500 100755 --- a/scripts/get +++ b/scripts/get @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright 2016 The Kubernetes Authors All rights reserved. +# Copyright The Helm Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -63,7 +63,7 @@ verifySupported() { local supported="darwin-386\ndarwin-amd64\nlinux-386\nlinux-amd64\nlinux-arm\nlinux-arm64\nlinux-ppc64le\nwindows-386\nwindows-amd64" if ! echo "${supported}" | grep -q "${OS}-${ARCH}"; then echo "No prebuilt binary for ${OS}-${ARCH}." - echo "To build from source, go to https://github.com/kubernetes/helm" + echo "To build from source, go to https://github.com/helm/helm" exit 1 fi @@ -76,7 +76,7 @@ verifySupported() { # checkDesiredVersion checks if the desired version is available. checkDesiredVersion() { # Use the GitHub releases webpage for the project to find the desired version for this project. - local release_url="https://github.com/kubernetes/helm/releases/${DESIRED_VERSION:-latest}" + local release_url="https://github.com/helm/helm/releases/${DESIRED_VERSION:-latest}" if type "curl" > /dev/null; then TAG=$(curl -SsL $release_url | awk '/\/tag\//' | grep -v no-underline | cut -d '"' -f 2 | awk '{n=split($NF,a,"/");print a[n]}' | awk 'a !~ $0{print}; {a=$0}') elif type "wget" > /dev/null; then @@ -155,7 +155,7 @@ fail_trap() { else echo "Failed to install $PROJECT_NAME" fi - echo -e "\tFor support, go to https://github.com/kubernetes/helm." + echo -e "\tFor support, go to https://github.com/helm/helm." fi cleanup exit $result @@ -182,7 +182,7 @@ help () { echo -e "\te.g. --version v2.4.0 or -v latest" } -# cleanup temporary files to avoid https://github.com/kubernetes/helm/issues/2977 +# cleanup temporary files to avoid https://github.com/helm/helm/issues/2977 cleanup() { if [[ -d "${HELM_TMP_ROOT:-}" ]]; then rm -rf "$HELM_TMP_ROOT" diff --git a/scripts/sync-repo.sh b/scripts/sync-repo.sh index 3795b1a7c..453102072 100755 --- a/scripts/sync-repo.sh +++ b/scripts/sync-repo.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright 2016 The Kubernetes Authors All rights reserved. +# Copyright The Helm Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/update-docs.sh b/scripts/update-docs.sh index e014b537e..d3018be50 100755 --- a/scripts/update-docs.sh +++ b/scripts/update-docs.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright 2017 The Kubernetes Authors All rights reserved. +# Copyright The Helm Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/util.sh b/scripts/util.sh index 09caaf972..c1e6c3751 100644 --- a/scripts/util.sh +++ b/scripts/util.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright 2016 The Kubernetes Authors All rights reserved. +# Copyright The Helm Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/validate-go.sh b/scripts/validate-go.sh index 2ecf5dfb3..328ce40f9 100755 --- a/scripts/validate-go.sh +++ b/scripts/validate-go.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright 2016 The Kubernetes Authors All rights reserved. +# Copyright The Helm Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/validate-license.sh b/scripts/validate-license.sh index fe7ec481b..12c76f75c 100755 --- a/scripts/validate-license.sh +++ b/scripts/validate-license.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright 2016 The Kubernetes Authors All rights reserved. +# Copyright The Helm Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,10 +27,19 @@ find_files() { \( -name '*.go' -o -name '*.sh' -o -name 'Dockerfile' \) } -failed=($(find_files | xargs grep -L 'Licensed under the Apache License, Version 2.0 (the "License");')) -if (( ${#failed[@]} > 0 )); then +failed_license_header=($(find_files | xargs grep -L 'Licensed under the Apache License, Version 2.0 (the "License");')) +if (( ${#failed_license_header[@]} > 0 )); then echo "Some source files are missing license headers." - for f in "${failed[@]}"; do + for f in "${failed_license_header[@]}"; do + echo " $f" + done + exit 1 +fi + +failed_copyright_header=($(find_files | xargs grep -L 'Copyright The Helm Authors.')) +if (( ${#failed_copyright_header[@]} > 0 )); then + echo "Some source files are missing the copyright header." + for f in "${failed_copyright_header[@]}"; do echo " $f" done exit 1 diff --git a/scripts/verify-docs.sh b/scripts/verify-docs.sh index b0b799eac..b176b036e 100755 --- a/scripts/verify-docs.sh +++ b/scripts/verify-docs.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright 2017 The Kubernetes Authors All rights reserved. +# Copyright The Helm Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.