diff --git a/.circleci/config.yml b/.circleci/config.yml index c83ee10cf..7bba262a8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ jobs: working_directory: /go/src/k8s.io/helm parallelism: 3 docker: - - image: golang:1.12 + - image: golang:1.12.1 environment: PROJECT_NAME: "kubernetes-helm" steps: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c9716d0ce..fc35e0643 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing Guidelines -The Kubernetes Helm project accepts contributions via GitHub pull requests. This document outlines the process to help get your contribution accepted. +The Helm project accepts contributions via GitHub pull requests. This document outlines the process to help get your contribution accepted. ## Reporting a Security Issue diff --git a/Makefile b/Makefile index f4b08ace8..3584521a4 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ DOCKER_REGISTRY ?= gcr.io IMAGE_PREFIX ?= kubernetes-helm -DEV_IMAGE ?= golang:1.12 +DEV_IMAGE ?= golang:1.12.1 SHORT_NAME ?= tiller SHORT_NAME_RUDDER ?= rudder TARGETS ?= darwin/amd64 linux/amd64 linux/386 linux/arm linux/arm64 linux/ppc64le linux/s390x windows/amd64 diff --git a/cmd/helm/installer/uninstall.go b/cmd/helm/installer/uninstall.go index 87fbd4050..b1d78004e 100644 --- a/cmd/helm/installer/uninstall.go +++ b/cmd/helm/installer/uninstall.go @@ -31,13 +31,13 @@ const ( // Uninstall uses Kubernetes client to uninstall Tiller. func Uninstall(client kubernetes.Interface, opts *Options) error { - if err := deleteService(client.Core(), opts.Namespace); err != nil { + if err := deleteService(client.CoreV1(), opts.Namespace); err != nil { return err } if err := deleteDeployment(client, opts.Namespace); err != nil { return err } - return deleteSecret(client.Core(), opts.Namespace) + return deleteSecret(client.CoreV1(), opts.Namespace) } // deleteService deletes the Tiller Service resource diff --git a/docs/chart_best_practices/labels.md b/docs/chart_best_practices/labels.md index 6b7d24c49..5a41ed1cc 100644 --- a/docs/chart_best_practices/labels.md +++ b/docs/chart_best_practices/labels.md @@ -26,7 +26,7 @@ are recommended, and _should_ be placed onto a chart for global consistency. Tho Name|Status|Description -----|------|---------- `app.kubernetes.io/name` | REC | This should be the app name, reflecting the entire app. Usually `{{ template "name" . }}` is used for this. This is used by many Kubernetes manifests, and is not Helm-specific. -`helm.sh/chart` | REC | This should be the chart name and version: `{{ .Chart.Name }}-{{ .Chart.Version \| replace "+" "_" }}`. +`helm.sh/chart` | REC | This should be the chart name and version: `{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}`. `app.kubernetes.io/managed-by` | REC | This should always be set to `{{ .Release.Service }}`. It is for finding all things managed by Tiller. `app.kubernetes.io/instance` | REC | This should be the `{{ .Release.Name }}`. It aids in differentiating between different instances of the same application. `app.kubernetes.io/version` | OPT | The version of the app and can be set to `{{ .Chart.AppVersion }}`. diff --git a/docs/chart_best_practices/values.md b/docs/chart_best_practices/values.md index 28e3a3eac..bdc53e338 100644 --- a/docs/chart_best_practices/values.md +++ b/docs/chart_best_practices/values.md @@ -88,7 +88,7 @@ data is lost after one parse. ## Consider How Users Will Use Your Values -There are three potential sources of values: +There are four potential sources of values: - A chart's `values.yaml` file - A values file supplied by `helm install -f` or `helm upgrade -f` diff --git a/docs/chart_template_guide/notes_files.md b/docs/chart_template_guide/notes_files.md index 5a8b78ca4..670f78fc2 100644 --- a/docs/chart_template_guide/notes_files.md +++ b/docs/chart_template_guide/notes_files.md @@ -1,6 +1,6 @@ # Creating a NOTES.txt File -In this section we are going to look at Helm's tool for providing instructions to your chart users. At the end of a `chart install` or `chart upgrade`, Helm can print out a block of helpful information for users. This information is highly customizable using templates. +In this section we are going to look at Helm's tool for providing instructions to your chart users. At the end of a `helm install` or `helm upgrade`, Helm can print out a block of helpful information for users. This information is highly customizable using templates. To add installation notes to your chart, simply create a `templates/NOTES.txt` file. This file is plain text, but it is processed like as a template, and has all the normal template functions and objects available. diff --git a/docs/chart_template_guide/values_files.md b/docs/chart_template_guide/values_files.md index 218da19dc..0a72b6bc2 100644 --- a/docs/chart_template_guide/values_files.md +++ b/docs/chart_template_guide/values_files.md @@ -29,7 +29,7 @@ data: drink: {{ .Values.favoriteDrink }} ``` -Notice on the last line we access `favoriteDrink` as an attribute of `Values`: `{{ .Values.favoriteDrink}}`. +Notice on the last line we access `favoriteDrink` as an attribute of `Values`: `{{ .Values.favoriteDrink }}`. Let's see how this renders. diff --git a/glide.lock b/glide.lock index 824e30041..eedbd9381 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: f86919aea9f9b6df70967eb0b00d8a3807a2f5e924d7bd82d317f7969fddb3ef -updated: 2019-03-17T20:36:59.222397-07:00 +hash: 9a8f0b6c906f605bb879fbcdf0c122096f7698fe6a975ec4e6648f2ee85fce3e +updated: 2019-03-26T10:33:38.977361532-07:00 imports: - name: cloud.google.com/go version: 3b1ae45394a234c385be014e9a488f2bb6eef821 @@ -84,6 +84,10 @@ imports: version: 449fdfce4d962303d702fec724ef0ad181c92528 subpackages: - spdy +- name: github.com/emicklei/go-restful + version: ff4f55a206334ef123e4f79bbf348980da81ca46 + subpackages: + - log - name: github.com/evanphx/json-patch version: 5858425f75500d40c52783dce87d085a483ce135 - name: github.com/exponent-io/jsonpath @@ -91,7 +95,7 @@ imports: - name: github.com/fatih/camelcase version: f6a740d52f961c60348ebb109adde9f4635d7540 - name: github.com/ghodss/yaml - version: 73d445a93680fa1a78ae23a5839bad48f32ba1ee + version: c7ce16629ff4cd059ed96ed06419dd3856fd3577 - name: github.com/go-openapi/jsonpointer version: ef5f0afec364d3b9396b7b77b43dbe26bf1f8004 - name: github.com/go-openapi/jsonreference @@ -130,7 +134,7 @@ imports: - name: github.com/google/btree version: 7d79101e329e5a3adf994758c578dab82b90c017 - name: github.com/google/gofuzz - version: 44d81051d367757e1c7c6a5a86423ece9afcf63c + version: 24818f796faf91cd76ec7bddd72458fbced7a6c1 - name: github.com/google/uuid version: 064e2069ce9c359c118179501254f67d7d37ba24 - name: github.com/googleapis/gnostic @@ -140,7 +144,7 @@ imports: - compiler - extensions - name: github.com/gophercloud/gophercloud - version: 781450b3c4fcb4f5182bcc5133adb4b2e4a09d1d + version: c818fa66e4c88b30db28038fe3f18f2f4a0db9a8 subpackages: - openstack - openstack/identity/v2/tenants @@ -160,7 +164,7 @@ imports: - name: github.com/grpc-ecosystem/go-grpc-prometheus version: 0c1b191dbfe51efdabe3c14b9f6f3b96429e0722 - name: github.com/hashicorp/golang-lru - version: a0d98a5f288019575c6d1f4bb1573fef2d1fcdc4 + version: 20f1fb78b0740ba8c3cb143a61e86ba5c8669768 subpackages: - simplelru - name: github.com/huandu/xstrings @@ -171,6 +175,8 @@ imports: version: 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75 - name: github.com/json-iterator/go version: ab8a2e0c74be9d3be70b3184d9acc634935ded82 +- name: github.com/liggitt/tabwriter + version: 89fcab3d43de07060e4fd4c1547430ed57e87f24 - name: github.com/mailru/easyjson version: 2f5df55504ebc322e4d52d34df6a1f5b503bf26d subpackages: @@ -215,7 +221,7 @@ imports: subpackages: - go - name: github.com/prometheus/common - version: 13ba4ddd0caa9c28ca7b7bffe1dfa9ed8d5ef207 + version: cfeb6f9992ffa54aaa4f2170ade4067ee478b250 subpackages: - expfmt - internal/bitbucket.org/ww/goautoneg @@ -259,15 +265,15 @@ imports: - scrypt - ssh/terminal - name: golang.org/x/net - version: 0ed95abb35c445290478a5348a7b38bb154135fd + version: 65e2d4e15006aab9813ff8769e768bbf4bb667a0 subpackages: - context - context/ctxhttp + - http/httpguts - http2 - http2/hpack - idna - internal/timeseries - - lex/httplex - trace - name: golang.org/x/oauth2 version: a6bd8cefa1811bd24b86f8902872e4e8225f74c4 @@ -368,12 +374,11 @@ imports: - json - jwt - name: gopkg.in/yaml.v2 - version: 670d4cfef0544295bc27a114dbac37980d83185a + version: 5420a8b6744d3b0345ab293f6fcba19c978f1183 - name: k8s.io/api - version: 5cb15d34447165a97c76ed5a60e4e99c8a01ecfe + version: 40a48860b5abbba9aa891b02b32da429b08d96a0 subpackages: - admission/v1beta1 - - admissionregistration/v1alpha1 - admissionregistration/v1beta1 - apps/v1 - apps/v1beta1 @@ -390,16 +395,21 @@ imports: - batch/v1beta1 - batch/v2alpha1 - certificates/v1beta1 + - coordination/v1 - coordination/v1beta1 - core/v1 - events/v1beta1 - extensions/v1beta1 - imagepolicy/v1alpha1 - networking/v1 + - networking/v1beta1 + - node/v1alpha1 + - node/v1beta1 - policy/v1beta1 - rbac/v1 - rbac/v1alpha1 - rbac/v1beta1 + - scheduling/v1 - scheduling/v1alpha1 - scheduling/v1beta1 - settings/v1alpha1 @@ -407,11 +417,11 @@ imports: - storage/v1alpha1 - storage/v1beta1 - name: k8s.io/apiextensions-apiserver - version: d002e88f6236312f0289d9d1deab106751718ff0 + version: 53c4693659ed354d76121458fb819202dd1635fa subpackages: - pkg/features - name: k8s.io/apimachinery - version: 86fb29eff6288413d76bd8506874fddd9fccdff0 + version: d7deff9243b165ee192f5551710ea4285dcfd615 subpackages: - pkg/api/equality - pkg/api/errors @@ -467,7 +477,7 @@ imports: - third_party/forked/golang/netutil - third_party/forked/golang/reflect - name: k8s.io/apiserver - version: 79427f02047f9189a75b8cdaadccaf65a126853e + version: 8b27c41bdbb11ff103caa673315e097bf0289171 subpackages: - pkg/authentication/authenticator - pkg/authentication/serviceaccount @@ -475,23 +485,31 @@ imports: - pkg/features - pkg/util/feature - name: k8s.io/cli-runtime - version: a9e421a7932607ce4623ff45add8274499cca193 + version: 2899ed30580fdbc8286718edb4382b529463099d subpackages: - pkg/genericclioptions - - pkg/genericclioptions/printers - - pkg/genericclioptions/resource + - pkg/kustomize + - pkg/kustomize/k8sdeps + - pkg/kustomize/k8sdeps/configmapandsecret + - pkg/kustomize/k8sdeps/kunstruct + - pkg/kustomize/k8sdeps/kv + - pkg/kustomize/k8sdeps/transformer + - pkg/kustomize/k8sdeps/transformer/hash + - pkg/kustomize/k8sdeps/transformer/patch + - pkg/kustomize/k8sdeps/validator + - pkg/printers + - pkg/resource - name: k8s.io/client-go - version: b40b2a5939e43f7ffe0028ad67586b7ce50bb675 + version: 6ee68ca5fd8355d024d02f9db0b3b667e8357a0f subpackages: - discovery + - discovery/cached/disk - discovery/fake - dynamic - dynamic/fake - kubernetes - kubernetes/fake - kubernetes/scheme - - kubernetes/typed/admissionregistration/v1alpha1 - - kubernetes/typed/admissionregistration/v1alpha1/fake - kubernetes/typed/admissionregistration/v1beta1 - kubernetes/typed/admissionregistration/v1beta1/fake - kubernetes/typed/apps/v1 @@ -524,6 +542,8 @@ imports: - kubernetes/typed/batch/v2alpha1/fake - kubernetes/typed/certificates/v1beta1 - kubernetes/typed/certificates/v1beta1/fake + - kubernetes/typed/coordination/v1 + - kubernetes/typed/coordination/v1/fake - kubernetes/typed/coordination/v1beta1 - kubernetes/typed/coordination/v1beta1/fake - kubernetes/typed/core/v1 @@ -534,6 +554,12 @@ imports: - kubernetes/typed/extensions/v1beta1/fake - kubernetes/typed/networking/v1 - kubernetes/typed/networking/v1/fake + - kubernetes/typed/networking/v1beta1 + - kubernetes/typed/networking/v1beta1/fake + - kubernetes/typed/node/v1alpha1 + - kubernetes/typed/node/v1alpha1/fake + - kubernetes/typed/node/v1beta1 + - kubernetes/typed/node/v1beta1/fake - kubernetes/typed/policy/v1beta1 - kubernetes/typed/policy/v1beta1/fake - kubernetes/typed/rbac/v1 @@ -542,6 +568,8 @@ imports: - kubernetes/typed/rbac/v1alpha1/fake - kubernetes/typed/rbac/v1beta1 - kubernetes/typed/rbac/v1beta1/fake + - kubernetes/typed/scheduling/v1 + - kubernetes/typed/scheduling/v1/fake - kubernetes/typed/scheduling/v1alpha1 - kubernetes/typed/scheduling/v1alpha1/fake - kubernetes/typed/scheduling/v1beta1 @@ -588,30 +616,35 @@ imports: - tools/pager - tools/portforward - tools/record + - tools/record/util - tools/reference - tools/remotecommand - tools/watch - transport - transport/spdy - - util/buffer - util/cert - util/connrotation - util/exec - util/flowcontrol - util/homedir - - util/integer - util/jsonpath + - util/keyutil - util/retry +- name: k8s.io/cloud-provider + version: 9c9d72d1bf90eb62005f5112f3eea019b272c44b + subpackages: + - features - name: k8s.io/klog - version: 8139d8cb77af419532b33dfa7dd09fbc5f1d344f + version: 8e90cee79f823779174776412c13478955131846 - name: k8s.io/kube-openapi - version: c59034cc13d587f5ef4e85ca0ade0c1866ae8e1d + version: b3a7cee44a305be0a69e1b9ac03018307287e1b0 subpackages: + - pkg/common - pkg/util/proto - pkg/util/proto/testing - pkg/util/proto/validation - name: k8s.io/kubernetes - version: f2c8f1cadf1808ec28476682e49a3cce2b09efbf + version: b805719a99126e54bcbc0a3d9ee8a45cd7e85632 subpackages: - pkg/api/legacyscheme - pkg/api/service @@ -644,6 +677,7 @@ imports: - pkg/apis/certificates/v1beta1 - pkg/apis/coordination - pkg/apis/coordination/install + - pkg/apis/coordination/v1 - pkg/apis/coordination/v1beta1 - pkg/apis/core - pkg/apis/core/helper @@ -659,6 +693,7 @@ imports: - pkg/apis/extensions/install - pkg/apis/extensions/v1beta1 - pkg/apis/networking + - pkg/apis/node - pkg/apis/policy - pkg/apis/policy/install - pkg/apis/policy/v1beta1 @@ -669,6 +704,7 @@ imports: - pkg/apis/rbac/v1beta1 - pkg/apis/scheduling - pkg/apis/scheduling/install + - pkg/apis/scheduling/v1 - pkg/apis/scheduling/v1alpha1 - pkg/apis/scheduling/v1beta1 - pkg/apis/settings @@ -713,30 +749,54 @@ imports: - pkg/kubectl/util/templates - pkg/kubectl/util/term - pkg/kubectl/validation - - pkg/kubelet/apis - pkg/kubelet/types - pkg/master/ports - pkg/printers - pkg/printers/internalversion - - pkg/scheduler/api - pkg/security/apparmor - pkg/serviceaccount - - pkg/util/file - pkg/util/hash - pkg/util/interrupt - pkg/util/labels - - pkg/util/net/sets - pkg/util/node - pkg/util/parsers - pkg/util/taints - pkg/version - name: k8s.io/utils - version: 66066c83e385e385ccc3c964b44fd7dcd413d0ed + version: c2654d5206da6b7b6ace12841e8f359bb89b443c subpackages: - - clock + - buffer - exec - - exec/testing + - integer + - net + - path - pointer + - trace +- name: sigs.k8s.io/kustomize + version: a6f65144121d1955266b0cd836ce954c04122dc8 + subpackages: + - pkg/commands/build + - pkg/constants + - pkg/expansion + - pkg/factory + - pkg/fs + - pkg/git + - pkg/gvk + - pkg/ifc + - pkg/ifc/transformer + - pkg/image + - pkg/internal/error + - pkg/loader + - pkg/patch + - pkg/patch/transformer + - pkg/resid + - pkg/resmap + - pkg/resource + - pkg/target + - pkg/transformers + - pkg/transformers/config + - pkg/transformers/config/defaultconfig + - pkg/types - name: sigs.k8s.io/yaml version: fd68e9863619f6ec2fdd8625fe1f02e7c877e480 - name: vbom.ml/util @@ -745,7 +805,7 @@ imports: - sortorder testImports: - name: github.com/pmezard/go-difflib - version: d8ed2627bdf02c080bf22230dbb337003b7aba2d + version: 5d4384ee4fb2527b0a1256a821ebfc92f91efefc subpackages: - difflib - name: github.com/stretchr/testify diff --git a/glide.yaml b/glide.yaml index 23a3cdaf4..8600ed0ac 100644 --- a/glide.yaml +++ b/glide.yaml @@ -51,19 +51,19 @@ import: version: 0.8.0 - package: github.com/grpc-ecosystem/go-grpc-prometheus - package: k8s.io/kubernetes - version: release-1.13 + version: release-1.14 - package: k8s.io/client-go - version: kubernetes-1.13.4 + version: kubernetes-1.14.0 - package: k8s.io/api - version: kubernetes-1.13.4 + version: kubernetes-1.14.0 - package: k8s.io/apimachinery - version: kubernetes-1.13.4 + version: kubernetes-1.14.0 - package: k8s.io/apiserver - version: kubernetes-1.13.4 + version: kubernetes-1.14.0 - package: k8s.io/cli-runtime - version: kubernetes-1.13.4 + version: kubernetes-1.14.0 - package: k8s.io/apiextensions-apiserver - version: kubernetes-1.13.4 + version: kubernetes-1.14.0 - package: github.com/cyphar/filepath-securejoin version: ^0.2.1 diff --git a/pkg/kube/client.go b/pkg/kube/client.go index 955c75ab1..66c822ebd 100644 --- a/pkg/kube/client.go +++ b/pkg/kube/client.go @@ -47,7 +47,7 @@ import ( "k8s.io/apimachinery/pkg/util/strategicpatch" "k8s.io/apimachinery/pkg/watch" "k8s.io/cli-runtime/pkg/genericclioptions" - "k8s.io/cli-runtime/pkg/genericclioptions/resource" + "k8s.io/cli-runtime/pkg/resource" "k8s.io/client-go/kubernetes/scheme" watchtools "k8s.io/client-go/tools/watch" "k8s.io/kubernetes/pkg/api/legacyscheme" @@ -74,7 +74,7 @@ type Client struct { // New creates a new Client. func New(getter genericclioptions.RESTClientGetter) *Client { if getter == nil { - getter = genericclioptions.NewConfigFlags() + getter = genericclioptions.NewConfigFlags(true) } return &Client{ Factory: cmdutil.NewFactory(getter), @@ -333,9 +333,18 @@ func (c *Client) Update(namespace string, originalReader, targetReader io.Reader } originalInfo := original.Get(info) + + // The resource already exists in the cluster, but it wasn't defined in the previous release. + // In this case, we consider it to be a resource that was previously un-managed by the release and error out, + // asking for the user to intervene. + // + // See https://github.com/helm/helm/issues/1193 for more info. if originalInfo == nil { - kind := info.Mapping.GroupVersionKind.Kind - return fmt.Errorf("no %s with the name %q found", kind, info.Name) + return fmt.Errorf( + "kind %s with the name %q already exists in the cluster and wasn't defined in the previous release. Before upgrading, please either delete the resource from the cluster or remove it from the chart", + info.Mapping.GroupVersionKind.Kind, + info.Name, + ) } if err := updateResource(c, info, originalInfo.Object, force, recreate); err != nil { diff --git a/pkg/kube/client_test.go b/pkg/kube/client_test.go index 89e630bb3..a41490f9b 100644 --- a/pkg/kube/client_test.go +++ b/pkg/kube/client_test.go @@ -25,11 +25,11 @@ import ( "strings" "testing" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/cli-runtime/pkg/genericclioptions/resource" + "k8s.io/cli-runtime/pkg/resource" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest/fake" cmdtesting "k8s.io/kubernetes/pkg/kubectl/cmd/testing" @@ -224,6 +224,43 @@ func TestUpdate(t *testing.T) { } } +func TestUpdateNonManagedResourceError(t *testing.T) { + actual := newPodList("starfish") + current := newPodList() + target := newPodList("starfish") + + tf := cmdtesting.NewTestFactory() + defer tf.Cleanup() + + tf.UnstructuredClient = &fake.RESTClient{ + NegotiatedSerializer: unstructuredSerializer, + Client: fake.CreateHTTPClient(func(req *http.Request) (*http.Response, error) { + p, m := req.URL.Path, req.Method + t.Logf("got request %s %s", p, m) + switch { + case p == "/namespaces/default/pods/starfish" && m == "GET": + return newResponse(200, &actual.Items[0]) + default: + t.Fatalf("unexpected request: %s %s", req.Method, req.URL.Path) + return nil, nil + } + }), + } + + c := &Client{ + Factory: tf, + Log: nopLogger, + } + + if err := c.Update(v1.NamespaceDefault, objBody(¤t), objBody(&target), false, false, 0, false); err != nil { + if err.Error() != "kind Pod with the name \"starfish\" already exists in the cluster and wasn't defined in the previous release. Before upgrading, please either delete the resource from the cluster or remove it from the chart" { + t.Fatal(err) + } + } else { + t.Fatalf("error expected") + } +} + func TestBuild(t *testing.T) { tests := []struct { name string diff --git a/pkg/kube/result.go b/pkg/kube/result.go index cc222a66f..cf4a4195e 100644 --- a/pkg/kube/result.go +++ b/pkg/kube/result.go @@ -16,7 +16,7 @@ limitations under the License. package kube // import "k8s.io/helm/pkg/kube" -import "k8s.io/cli-runtime/pkg/genericclioptions/resource" +import "k8s.io/cli-runtime/pkg/resource" // Result provides convenience methods for comparing collections of Infos. type Result []*resource.Info diff --git a/pkg/kube/result_test.go b/pkg/kube/result_test.go index c4cf989b8..d4c18ee6a 100644 --- a/pkg/kube/result_test.go +++ b/pkg/kube/result_test.go @@ -21,7 +21,7 @@ import ( "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/cli-runtime/pkg/genericclioptions/resource" + "k8s.io/cli-runtime/pkg/resource" ) func TestResult(t *testing.T) { diff --git a/pkg/tiller/environment/environment.go b/pkg/tiller/environment/environment.go index 290337d7b..dca7c0756 100644 --- a/pkg/tiller/environment/environment.go +++ b/pkg/tiller/environment/environment.go @@ -26,8 +26,8 @@ import ( "io" "time" - "k8s.io/api/core/v1" - "k8s.io/cli-runtime/pkg/genericclioptions/resource" + v1 "k8s.io/api/core/v1" + "k8s.io/cli-runtime/pkg/resource" "k8s.io/helm/pkg/chartutil" "k8s.io/helm/pkg/engine" diff --git a/pkg/tiller/environment/environment_test.go b/pkg/tiller/environment/environment_test.go index 5c19a9b21..9e9b549d4 100644 --- a/pkg/tiller/environment/environment_test.go +++ b/pkg/tiller/environment/environment_test.go @@ -22,8 +22,8 @@ import ( "testing" "time" - "k8s.io/api/core/v1" - "k8s.io/cli-runtime/pkg/genericclioptions/resource" + v1 "k8s.io/api/core/v1" + "k8s.io/cli-runtime/pkg/resource" "k8s.io/helm/pkg/chartutil" "k8s.io/helm/pkg/kube" diff --git a/pkg/tiller/release_server_test.go b/pkg/tiller/release_server_test.go index 4e29e4413..ecf5ffd17 100644 --- a/pkg/tiller/release_server_test.go +++ b/pkg/tiller/release_server_test.go @@ -31,8 +31,8 @@ import ( "github.com/technosophos/moniker" "golang.org/x/net/context" "google.golang.org/grpc/metadata" - "k8s.io/api/core/v1" - "k8s.io/cli-runtime/pkg/genericclioptions/resource" + v1 "k8s.io/api/core/v1" + "k8s.io/cli-runtime/pkg/resource" "k8s.io/client-go/kubernetes/fake" "k8s.io/helm/pkg/helm" diff --git a/scripts/get b/scripts/get index bc13039e2..5479abddb 100755 --- a/scripts/get +++ b/scripts/get @@ -77,16 +77,16 @@ 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/helm/helm/releases/${DESIRED_VERSION:-latest}" - if type "curl" > /dev/null; then - TAG=$(curl -SsL $release_url | awk '/\/tag\//' | grep -v no-underline | grep " /dev/null; then - TAG=$(wget -q -O - $release_url | awk '/\/tag\//' | grep -v no-underline | grep " /dev/null; then + TAG=$(curl -Ls -o /dev/null -w %{url_effective} $latest_release_url | grep -oE "[^/]+$" ) + elif type "wget" > /dev/null; then + TAG=$(wget $latest_release_url --server-response -O /dev/null 2>&1 | awk '/^ Location: /{DEST=$2} END{ print DEST}' | grep -oE "[^/]+$") + fi + else + TAG=$DESIRED_VERSION fi }