Merge branch 'master' into feat/app-version

Signed-off-by: Kevin Labesse <kevin@labesse.me>
pull/5492/head
Kevin Labesse 7 years ago
commit de6b33782c

@ -4,7 +4,7 @@ jobs:
working_directory: /go/src/k8s.io/helm working_directory: /go/src/k8s.io/helm
parallelism: 3 parallelism: 3
docker: docker:
- image: golang:1.12 - image: golang:1.12.1
environment: environment:
PROJECT_NAME: "kubernetes-helm" PROJECT_NAME: "kubernetes-helm"
steps: steps:

@ -1,6 +1,6 @@
# Contributing Guidelines # 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 ## Reporting a Security Issue

@ -1,6 +1,6 @@
DOCKER_REGISTRY ?= gcr.io DOCKER_REGISTRY ?= gcr.io
IMAGE_PREFIX ?= kubernetes-helm IMAGE_PREFIX ?= kubernetes-helm
DEV_IMAGE ?= golang:1.12 DEV_IMAGE ?= golang:1.12.1
SHORT_NAME ?= tiller SHORT_NAME ?= tiller
SHORT_NAME_RUDDER ?= rudder SHORT_NAME_RUDDER ?= rudder
TARGETS ?= darwin/amd64 linux/amd64 linux/386 linux/arm linux/arm64 linux/ppc64le linux/s390x windows/amd64 TARGETS ?= darwin/amd64 linux/amd64 linux/386 linux/arm linux/arm64 linux/ppc64le linux/s390x windows/amd64

@ -31,13 +31,13 @@ const (
// Uninstall uses Kubernetes client to uninstall Tiller. // Uninstall uses Kubernetes client to uninstall Tiller.
func Uninstall(client kubernetes.Interface, opts *Options) error { 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 return err
} }
if err := deleteDeployment(client, opts.Namespace); err != nil { if err := deleteDeployment(client, opts.Namespace); err != nil {
return err return err
} }
return deleteSecret(client.Core(), opts.Namespace) return deleteSecret(client.CoreV1(), opts.Namespace)
} }
// deleteService deletes the Tiller Service resource // deleteService deletes the Tiller Service resource

@ -26,7 +26,7 @@ are recommended, and _should_ be placed onto a chart for global consistency. Tho
Name|Status|Description 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. `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/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/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 }}`. `app.kubernetes.io/version` | OPT | The version of the app and can be set to `{{ .Chart.AppVersion }}`.

@ -88,7 +88,7 @@ data is lost after one parse.
## Consider How Users Will Use Your Values ## 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 chart's `values.yaml` file
- A values file supplied by `helm install -f` or `helm upgrade -f` - A values file supplied by `helm install -f` or `helm upgrade -f`

@ -1,6 +1,6 @@
# Creating a NOTES.txt File # 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. 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.

@ -29,7 +29,7 @@ data:
drink: {{ .Values.favoriteDrink }} 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. Let's see how this renders.

128
glide.lock generated

@ -1,5 +1,5 @@
hash: f86919aea9f9b6df70967eb0b00d8a3807a2f5e924d7bd82d317f7969fddb3ef hash: 9a8f0b6c906f605bb879fbcdf0c122096f7698fe6a975ec4e6648f2ee85fce3e
updated: 2019-03-17T20:36:59.222397-07:00 updated: 2019-03-26T10:33:38.977361532-07:00
imports: imports:
- name: cloud.google.com/go - name: cloud.google.com/go
version: 3b1ae45394a234c385be014e9a488f2bb6eef821 version: 3b1ae45394a234c385be014e9a488f2bb6eef821
@ -84,6 +84,10 @@ imports:
version: 449fdfce4d962303d702fec724ef0ad181c92528 version: 449fdfce4d962303d702fec724ef0ad181c92528
subpackages: subpackages:
- spdy - spdy
- name: github.com/emicklei/go-restful
version: ff4f55a206334ef123e4f79bbf348980da81ca46
subpackages:
- log
- name: github.com/evanphx/json-patch - name: github.com/evanphx/json-patch
version: 5858425f75500d40c52783dce87d085a483ce135 version: 5858425f75500d40c52783dce87d085a483ce135
- name: github.com/exponent-io/jsonpath - name: github.com/exponent-io/jsonpath
@ -91,7 +95,7 @@ imports:
- name: github.com/fatih/camelcase - name: github.com/fatih/camelcase
version: f6a740d52f961c60348ebb109adde9f4635d7540 version: f6a740d52f961c60348ebb109adde9f4635d7540
- name: github.com/ghodss/yaml - name: github.com/ghodss/yaml
version: 73d445a93680fa1a78ae23a5839bad48f32ba1ee version: c7ce16629ff4cd059ed96ed06419dd3856fd3577
- name: github.com/go-openapi/jsonpointer - name: github.com/go-openapi/jsonpointer
version: ef5f0afec364d3b9396b7b77b43dbe26bf1f8004 version: ef5f0afec364d3b9396b7b77b43dbe26bf1f8004
- name: github.com/go-openapi/jsonreference - name: github.com/go-openapi/jsonreference
@ -130,7 +134,7 @@ imports:
- name: github.com/google/btree - name: github.com/google/btree
version: 7d79101e329e5a3adf994758c578dab82b90c017 version: 7d79101e329e5a3adf994758c578dab82b90c017
- name: github.com/google/gofuzz - name: github.com/google/gofuzz
version: 44d81051d367757e1c7c6a5a86423ece9afcf63c version: 24818f796faf91cd76ec7bddd72458fbced7a6c1
- name: github.com/google/uuid - name: github.com/google/uuid
version: 064e2069ce9c359c118179501254f67d7d37ba24 version: 064e2069ce9c359c118179501254f67d7d37ba24
- name: github.com/googleapis/gnostic - name: github.com/googleapis/gnostic
@ -140,7 +144,7 @@ imports:
- compiler - compiler
- extensions - extensions
- name: github.com/gophercloud/gophercloud - name: github.com/gophercloud/gophercloud
version: 781450b3c4fcb4f5182bcc5133adb4b2e4a09d1d version: c818fa66e4c88b30db28038fe3f18f2f4a0db9a8
subpackages: subpackages:
- openstack - openstack
- openstack/identity/v2/tenants - openstack/identity/v2/tenants
@ -160,7 +164,7 @@ imports:
- name: github.com/grpc-ecosystem/go-grpc-prometheus - name: github.com/grpc-ecosystem/go-grpc-prometheus
version: 0c1b191dbfe51efdabe3c14b9f6f3b96429e0722 version: 0c1b191dbfe51efdabe3c14b9f6f3b96429e0722
- name: github.com/hashicorp/golang-lru - name: github.com/hashicorp/golang-lru
version: a0d98a5f288019575c6d1f4bb1573fef2d1fcdc4 version: 20f1fb78b0740ba8c3cb143a61e86ba5c8669768
subpackages: subpackages:
- simplelru - simplelru
- name: github.com/huandu/xstrings - name: github.com/huandu/xstrings
@ -171,6 +175,8 @@ imports:
version: 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75 version: 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75
- name: github.com/json-iterator/go - name: github.com/json-iterator/go
version: ab8a2e0c74be9d3be70b3184d9acc634935ded82 version: ab8a2e0c74be9d3be70b3184d9acc634935ded82
- name: github.com/liggitt/tabwriter
version: 89fcab3d43de07060e4fd4c1547430ed57e87f24
- name: github.com/mailru/easyjson - name: github.com/mailru/easyjson
version: 2f5df55504ebc322e4d52d34df6a1f5b503bf26d version: 2f5df55504ebc322e4d52d34df6a1f5b503bf26d
subpackages: subpackages:
@ -215,7 +221,7 @@ imports:
subpackages: subpackages:
- go - go
- name: github.com/prometheus/common - name: github.com/prometheus/common
version: 13ba4ddd0caa9c28ca7b7bffe1dfa9ed8d5ef207 version: cfeb6f9992ffa54aaa4f2170ade4067ee478b250
subpackages: subpackages:
- expfmt - expfmt
- internal/bitbucket.org/ww/goautoneg - internal/bitbucket.org/ww/goautoneg
@ -259,15 +265,15 @@ imports:
- scrypt - scrypt
- ssh/terminal - ssh/terminal
- name: golang.org/x/net - name: golang.org/x/net
version: 0ed95abb35c445290478a5348a7b38bb154135fd version: 65e2d4e15006aab9813ff8769e768bbf4bb667a0
subpackages: subpackages:
- context - context
- context/ctxhttp - context/ctxhttp
- http/httpguts
- http2 - http2
- http2/hpack - http2/hpack
- idna - idna
- internal/timeseries - internal/timeseries
- lex/httplex
- trace - trace
- name: golang.org/x/oauth2 - name: golang.org/x/oauth2
version: a6bd8cefa1811bd24b86f8902872e4e8225f74c4 version: a6bd8cefa1811bd24b86f8902872e4e8225f74c4
@ -368,12 +374,11 @@ imports:
- json - json
- jwt - jwt
- name: gopkg.in/yaml.v2 - name: gopkg.in/yaml.v2
version: 670d4cfef0544295bc27a114dbac37980d83185a version: 5420a8b6744d3b0345ab293f6fcba19c978f1183
- name: k8s.io/api - name: k8s.io/api
version: 5cb15d34447165a97c76ed5a60e4e99c8a01ecfe version: 40a48860b5abbba9aa891b02b32da429b08d96a0
subpackages: subpackages:
- admission/v1beta1 - admission/v1beta1
- admissionregistration/v1alpha1
- admissionregistration/v1beta1 - admissionregistration/v1beta1
- apps/v1 - apps/v1
- apps/v1beta1 - apps/v1beta1
@ -390,16 +395,21 @@ imports:
- batch/v1beta1 - batch/v1beta1
- batch/v2alpha1 - batch/v2alpha1
- certificates/v1beta1 - certificates/v1beta1
- coordination/v1
- coordination/v1beta1 - coordination/v1beta1
- core/v1 - core/v1
- events/v1beta1 - events/v1beta1
- extensions/v1beta1 - extensions/v1beta1
- imagepolicy/v1alpha1 - imagepolicy/v1alpha1
- networking/v1 - networking/v1
- networking/v1beta1
- node/v1alpha1
- node/v1beta1
- policy/v1beta1 - policy/v1beta1
- rbac/v1 - rbac/v1
- rbac/v1alpha1 - rbac/v1alpha1
- rbac/v1beta1 - rbac/v1beta1
- scheduling/v1
- scheduling/v1alpha1 - scheduling/v1alpha1
- scheduling/v1beta1 - scheduling/v1beta1
- settings/v1alpha1 - settings/v1alpha1
@ -407,11 +417,11 @@ imports:
- storage/v1alpha1 - storage/v1alpha1
- storage/v1beta1 - storage/v1beta1
- name: k8s.io/apiextensions-apiserver - name: k8s.io/apiextensions-apiserver
version: d002e88f6236312f0289d9d1deab106751718ff0 version: 53c4693659ed354d76121458fb819202dd1635fa
subpackages: subpackages:
- pkg/features - pkg/features
- name: k8s.io/apimachinery - name: k8s.io/apimachinery
version: 86fb29eff6288413d76bd8506874fddd9fccdff0 version: d7deff9243b165ee192f5551710ea4285dcfd615
subpackages: subpackages:
- pkg/api/equality - pkg/api/equality
- pkg/api/errors - pkg/api/errors
@ -467,7 +477,7 @@ imports:
- third_party/forked/golang/netutil - third_party/forked/golang/netutil
- third_party/forked/golang/reflect - third_party/forked/golang/reflect
- name: k8s.io/apiserver - name: k8s.io/apiserver
version: 79427f02047f9189a75b8cdaadccaf65a126853e version: 8b27c41bdbb11ff103caa673315e097bf0289171
subpackages: subpackages:
- pkg/authentication/authenticator - pkg/authentication/authenticator
- pkg/authentication/serviceaccount - pkg/authentication/serviceaccount
@ -475,23 +485,31 @@ imports:
- pkg/features - pkg/features
- pkg/util/feature - pkg/util/feature
- name: k8s.io/cli-runtime - name: k8s.io/cli-runtime
version: a9e421a7932607ce4623ff45add8274499cca193 version: 2899ed30580fdbc8286718edb4382b529463099d
subpackages: subpackages:
- pkg/genericclioptions - pkg/genericclioptions
- pkg/genericclioptions/printers - pkg/kustomize
- pkg/genericclioptions/resource - 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 - name: k8s.io/client-go
version: b40b2a5939e43f7ffe0028ad67586b7ce50bb675 version: 6ee68ca5fd8355d024d02f9db0b3b667e8357a0f
subpackages: subpackages:
- discovery - discovery
- discovery/cached/disk
- discovery/fake - discovery/fake
- dynamic - dynamic
- dynamic/fake - dynamic/fake
- kubernetes - kubernetes
- kubernetes/fake - kubernetes/fake
- kubernetes/scheme - kubernetes/scheme
- kubernetes/typed/admissionregistration/v1alpha1
- kubernetes/typed/admissionregistration/v1alpha1/fake
- kubernetes/typed/admissionregistration/v1beta1 - kubernetes/typed/admissionregistration/v1beta1
- kubernetes/typed/admissionregistration/v1beta1/fake - kubernetes/typed/admissionregistration/v1beta1/fake
- kubernetes/typed/apps/v1 - kubernetes/typed/apps/v1
@ -524,6 +542,8 @@ imports:
- kubernetes/typed/batch/v2alpha1/fake - kubernetes/typed/batch/v2alpha1/fake
- kubernetes/typed/certificates/v1beta1 - kubernetes/typed/certificates/v1beta1
- kubernetes/typed/certificates/v1beta1/fake - kubernetes/typed/certificates/v1beta1/fake
- kubernetes/typed/coordination/v1
- kubernetes/typed/coordination/v1/fake
- kubernetes/typed/coordination/v1beta1 - kubernetes/typed/coordination/v1beta1
- kubernetes/typed/coordination/v1beta1/fake - kubernetes/typed/coordination/v1beta1/fake
- kubernetes/typed/core/v1 - kubernetes/typed/core/v1
@ -534,6 +554,12 @@ imports:
- kubernetes/typed/extensions/v1beta1/fake - kubernetes/typed/extensions/v1beta1/fake
- kubernetes/typed/networking/v1 - kubernetes/typed/networking/v1
- kubernetes/typed/networking/v1/fake - 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
- kubernetes/typed/policy/v1beta1/fake - kubernetes/typed/policy/v1beta1/fake
- kubernetes/typed/rbac/v1 - kubernetes/typed/rbac/v1
@ -542,6 +568,8 @@ imports:
- kubernetes/typed/rbac/v1alpha1/fake - kubernetes/typed/rbac/v1alpha1/fake
- kubernetes/typed/rbac/v1beta1 - kubernetes/typed/rbac/v1beta1
- kubernetes/typed/rbac/v1beta1/fake - kubernetes/typed/rbac/v1beta1/fake
- kubernetes/typed/scheduling/v1
- kubernetes/typed/scheduling/v1/fake
- kubernetes/typed/scheduling/v1alpha1 - kubernetes/typed/scheduling/v1alpha1
- kubernetes/typed/scheduling/v1alpha1/fake - kubernetes/typed/scheduling/v1alpha1/fake
- kubernetes/typed/scheduling/v1beta1 - kubernetes/typed/scheduling/v1beta1
@ -588,30 +616,35 @@ imports:
- tools/pager - tools/pager
- tools/portforward - tools/portforward
- tools/record - tools/record
- tools/record/util
- tools/reference - tools/reference
- tools/remotecommand - tools/remotecommand
- tools/watch - tools/watch
- transport - transport
- transport/spdy - transport/spdy
- util/buffer
- util/cert - util/cert
- util/connrotation - util/connrotation
- util/exec - util/exec
- util/flowcontrol - util/flowcontrol
- util/homedir - util/homedir
- util/integer
- util/jsonpath - util/jsonpath
- util/keyutil
- util/retry - util/retry
- name: k8s.io/cloud-provider
version: 9c9d72d1bf90eb62005f5112f3eea019b272c44b
subpackages:
- features
- name: k8s.io/klog - name: k8s.io/klog
version: 8139d8cb77af419532b33dfa7dd09fbc5f1d344f version: 8e90cee79f823779174776412c13478955131846
- name: k8s.io/kube-openapi - name: k8s.io/kube-openapi
version: c59034cc13d587f5ef4e85ca0ade0c1866ae8e1d version: b3a7cee44a305be0a69e1b9ac03018307287e1b0
subpackages: subpackages:
- pkg/common
- pkg/util/proto - pkg/util/proto
- pkg/util/proto/testing - pkg/util/proto/testing
- pkg/util/proto/validation - pkg/util/proto/validation
- name: k8s.io/kubernetes - name: k8s.io/kubernetes
version: f2c8f1cadf1808ec28476682e49a3cce2b09efbf version: b805719a99126e54bcbc0a3d9ee8a45cd7e85632
subpackages: subpackages:
- pkg/api/legacyscheme - pkg/api/legacyscheme
- pkg/api/service - pkg/api/service
@ -644,6 +677,7 @@ imports:
- pkg/apis/certificates/v1beta1 - pkg/apis/certificates/v1beta1
- pkg/apis/coordination - pkg/apis/coordination
- pkg/apis/coordination/install - pkg/apis/coordination/install
- pkg/apis/coordination/v1
- pkg/apis/coordination/v1beta1 - pkg/apis/coordination/v1beta1
- pkg/apis/core - pkg/apis/core
- pkg/apis/core/helper - pkg/apis/core/helper
@ -659,6 +693,7 @@ imports:
- pkg/apis/extensions/install - pkg/apis/extensions/install
- pkg/apis/extensions/v1beta1 - pkg/apis/extensions/v1beta1
- pkg/apis/networking - pkg/apis/networking
- pkg/apis/node
- pkg/apis/policy - pkg/apis/policy
- pkg/apis/policy/install - pkg/apis/policy/install
- pkg/apis/policy/v1beta1 - pkg/apis/policy/v1beta1
@ -669,6 +704,7 @@ imports:
- pkg/apis/rbac/v1beta1 - pkg/apis/rbac/v1beta1
- pkg/apis/scheduling - pkg/apis/scheduling
- pkg/apis/scheduling/install - pkg/apis/scheduling/install
- pkg/apis/scheduling/v1
- pkg/apis/scheduling/v1alpha1 - pkg/apis/scheduling/v1alpha1
- pkg/apis/scheduling/v1beta1 - pkg/apis/scheduling/v1beta1
- pkg/apis/settings - pkg/apis/settings
@ -713,30 +749,54 @@ imports:
- pkg/kubectl/util/templates - pkg/kubectl/util/templates
- pkg/kubectl/util/term - pkg/kubectl/util/term
- pkg/kubectl/validation - pkg/kubectl/validation
- pkg/kubelet/apis
- pkg/kubelet/types - pkg/kubelet/types
- pkg/master/ports - pkg/master/ports
- pkg/printers - pkg/printers
- pkg/printers/internalversion - pkg/printers/internalversion
- pkg/scheduler/api
- pkg/security/apparmor - pkg/security/apparmor
- pkg/serviceaccount - pkg/serviceaccount
- pkg/util/file
- pkg/util/hash - pkg/util/hash
- pkg/util/interrupt - pkg/util/interrupt
- pkg/util/labels - pkg/util/labels
- pkg/util/net/sets
- pkg/util/node - pkg/util/node
- pkg/util/parsers - pkg/util/parsers
- pkg/util/taints - pkg/util/taints
- pkg/version - pkg/version
- name: k8s.io/utils - name: k8s.io/utils
version: 66066c83e385e385ccc3c964b44fd7dcd413d0ed version: c2654d5206da6b7b6ace12841e8f359bb89b443c
subpackages: subpackages:
- clock - buffer
- exec - exec
- exec/testing - integer
- net
- path
- pointer - 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 - name: sigs.k8s.io/yaml
version: fd68e9863619f6ec2fdd8625fe1f02e7c877e480 version: fd68e9863619f6ec2fdd8625fe1f02e7c877e480
- name: vbom.ml/util - name: vbom.ml/util
@ -745,7 +805,7 @@ imports:
- sortorder - sortorder
testImports: testImports:
- name: github.com/pmezard/go-difflib - name: github.com/pmezard/go-difflib
version: d8ed2627bdf02c080bf22230dbb337003b7aba2d version: 5d4384ee4fb2527b0a1256a821ebfc92f91efefc
subpackages: subpackages:
- difflib - difflib
- name: github.com/stretchr/testify - name: github.com/stretchr/testify

@ -51,19 +51,19 @@ import:
version: 0.8.0 version: 0.8.0
- package: github.com/grpc-ecosystem/go-grpc-prometheus - package: github.com/grpc-ecosystem/go-grpc-prometheus
- package: k8s.io/kubernetes - package: k8s.io/kubernetes
version: release-1.13 version: release-1.14
- package: k8s.io/client-go - package: k8s.io/client-go
version: kubernetes-1.13.4 version: kubernetes-1.14.0
- package: k8s.io/api - package: k8s.io/api
version: kubernetes-1.13.4 version: kubernetes-1.14.0
- package: k8s.io/apimachinery - package: k8s.io/apimachinery
version: kubernetes-1.13.4 version: kubernetes-1.14.0
- package: k8s.io/apiserver - package: k8s.io/apiserver
version: kubernetes-1.13.4 version: kubernetes-1.14.0
- package: k8s.io/cli-runtime - package: k8s.io/cli-runtime
version: kubernetes-1.13.4 version: kubernetes-1.14.0
- package: k8s.io/apiextensions-apiserver - package: k8s.io/apiextensions-apiserver
version: kubernetes-1.13.4 version: kubernetes-1.14.0
- package: github.com/cyphar/filepath-securejoin - package: github.com/cyphar/filepath-securejoin
version: ^0.2.1 version: ^0.2.1

@ -47,7 +47,7 @@ import (
"k8s.io/apimachinery/pkg/util/strategicpatch" "k8s.io/apimachinery/pkg/util/strategicpatch"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
"k8s.io/cli-runtime/pkg/genericclioptions" "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" "k8s.io/client-go/kubernetes/scheme"
watchtools "k8s.io/client-go/tools/watch" watchtools "k8s.io/client-go/tools/watch"
"k8s.io/kubernetes/pkg/api/legacyscheme" "k8s.io/kubernetes/pkg/api/legacyscheme"
@ -74,7 +74,7 @@ type Client struct {
// New creates a new Client. // New creates a new Client.
func New(getter genericclioptions.RESTClientGetter) *Client { func New(getter genericclioptions.RESTClientGetter) *Client {
if getter == nil { if getter == nil {
getter = genericclioptions.NewConfigFlags() getter = genericclioptions.NewConfigFlags(true)
} }
return &Client{ return &Client{
Factory: cmdutil.NewFactory(getter), Factory: cmdutil.NewFactory(getter),
@ -333,9 +333,18 @@ func (c *Client) Update(namespace string, originalReader, targetReader io.Reader
} }
originalInfo := original.Get(info) 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 { if originalInfo == nil {
kind := info.Mapping.GroupVersionKind.Kind return fmt.Errorf(
return fmt.Errorf("no %s with the name %q found", kind, info.Name) "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 { if err := updateResource(c, info, originalInfo.Object, force, recreate); err != nil {

@ -25,11 +25,11 @@ import (
"strings" "strings"
"testing" "testing"
"k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema" "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/kubernetes/scheme"
"k8s.io/client-go/rest/fake" "k8s.io/client-go/rest/fake"
cmdtesting "k8s.io/kubernetes/pkg/kubectl/cmd/testing" 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(&current), 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) { func TestBuild(t *testing.T) {
tests := []struct { tests := []struct {
name string name string

@ -16,7 +16,7 @@ limitations under the License.
package kube // import "k8s.io/helm/pkg/kube" 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. // Result provides convenience methods for comparing collections of Infos.
type Result []*resource.Info type Result []*resource.Info

@ -21,7 +21,7 @@ import (
"k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/cli-runtime/pkg/genericclioptions/resource" "k8s.io/cli-runtime/pkg/resource"
) )
func TestResult(t *testing.T) { func TestResult(t *testing.T) {

@ -26,8 +26,8 @@ import (
"io" "io"
"time" "time"
"k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
"k8s.io/cli-runtime/pkg/genericclioptions/resource" "k8s.io/cli-runtime/pkg/resource"
"k8s.io/helm/pkg/chartutil" "k8s.io/helm/pkg/chartutil"
"k8s.io/helm/pkg/engine" "k8s.io/helm/pkg/engine"

@ -22,8 +22,8 @@ import (
"testing" "testing"
"time" "time"
"k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
"k8s.io/cli-runtime/pkg/genericclioptions/resource" "k8s.io/cli-runtime/pkg/resource"
"k8s.io/helm/pkg/chartutil" "k8s.io/helm/pkg/chartutil"
"k8s.io/helm/pkg/kube" "k8s.io/helm/pkg/kube"

@ -31,8 +31,8 @@ import (
"github.com/technosophos/moniker" "github.com/technosophos/moniker"
"golang.org/x/net/context" "golang.org/x/net/context"
"google.golang.org/grpc/metadata" "google.golang.org/grpc/metadata"
"k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
"k8s.io/cli-runtime/pkg/genericclioptions/resource" "k8s.io/cli-runtime/pkg/resource"
"k8s.io/client-go/kubernetes/fake" "k8s.io/client-go/kubernetes/fake"
"k8s.io/helm/pkg/helm" "k8s.io/helm/pkg/helm"

@ -77,16 +77,16 @@ verifySupported() {
# checkDesiredVersion checks if the desired version is available. # checkDesiredVersion checks if the desired version is available.
checkDesiredVersion() { checkDesiredVersion() {
# Use the GitHub releases webpage for the project to find the desired version for this project. if [ "x$DESIRED_VERSION" == "x" ]; then
local release_url="https://github.com/helm/helm/releases/${DESIRED_VERSION:-latest}" # Get tag from release URL
local latest_release_url="https://github.com/helm/helm/releases/latest"
if type "curl" > /dev/null; then if type "curl" > /dev/null; then
TAG=$(curl -SsL $release_url | awk '/\/tag\//' | grep -v no-underline | grep "<a href=\"/helm/helm/releases" | head -n 1 | cut -d '"' -f 2 | awk '{n=split($NF,a,"/");print a[n]}' | awk 'a !~ $0{print}; {a=$0}') TAG=$(curl -Ls -o /dev/null -w %{url_effective} $latest_release_url | grep -oE "[^/]+$" )
elif type "wget" > /dev/null; then elif type "wget" > /dev/null; then
TAG=$(wget -q -O - $release_url | awk '/\/tag\//' | grep -v no-underline | grep "<a href=\"/helm/helm/releases" | head -n 1 | cut -d '"' -f 2 | awk '{n=split($NF,a,"/");print a[n]}' | awk 'a !~ $0{print}; {a=$0}') TAG=$(wget $latest_release_url --server-response -O /dev/null 2>&1 | awk '/^ Location: /{DEST=$2} END{ print DEST}' | grep -oE "[^/]+$")
fi fi
if [ "x$TAG" == "x" ]; then else
echo "Cannot determine ${DESIRED_VERSION} tag." TAG=$DESIRED_VERSION
exit 1
fi fi
} }

Loading…
Cancel
Save