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

@ -191,6 +191,17 @@ func TestInstall(t *testing.T) {
flags: []string{"--name-template", "{{UPPER \"foobar\"}}"},
err: true,
},
{
name: "install with app-version (allow)",
args: []string{"testdata/testcharts/alpine-app-version"},
flags: []string{"--app-version", "1.0.1"},
},
{
name: "install with app-version (not allow)",
args: []string{"testdata/testcharts/alpine"},
flags: []string{"--app-version", "1.0.1"},
err: true,
},
}
runReleaseCases(t, tests, func(c *helm.FakeClient, out io.Writer) *cobra.Command {

@ -0,0 +1,7 @@
description: Deploy a basic Alpine Linux pod
home: https://k8s.io/helm
name: alpine
sources:
- https://github.com/helm/helm
version: 0.1.0
overrideAppVersion: true

@ -0,0 +1,13 @@
#Alpine: A simple Helm chart
Run a single pod of Alpine Linux.
This example was generated using the command `helm create alpine`.
The `templates/` directory contains a very simple pod resource with a
couple of parameters.
The `values.yaml` file contains the default values for the
`alpine-pod.yaml` template.
You can install this example using `helm install docs/examples/alpine`.

@ -0,0 +1,27 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{.Release.Name}}-{{.Values.Name}}"
labels:
# The "heritage" label is used to track which tool deployed a given chart.
# It is useful for admins who want to see what releases a particular tool
# is responsible for.
app.kubernetes.io/managed-by: {{.Release.Service | quote }}
# The "release" convention makes it easy to tie a release to all of the
# Kubernetes resources that were created as part of that release.
app.kubernetes.io/instance: {{.Release.Name | quote }}
# This makes it easy to audit chart usage.
helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}"
values: {{.Values.test.Name}}
annotations:
"helm.sh/created": {{.Release.Time.Seconds | quote }}
spec:
# This shows how to use a simple value. This will look for a passed-in value
# called restartPolicy. If it is not found, it will use the default value.
# {{default "Never" .restartPolicy}} is a slightly optimized version of the
# more conventional syntax: {{.restartPolicy | default "Never"}}
restartPolicy: {{default "Never" .Values.restartPolicy}}
containers:
- name: waiter
image: "alpine:3.3"
command: ["/bin/sleep","9000"]

@ -0,0 +1,2 @@
# The pod name
Name: my-alpine

@ -183,6 +183,17 @@ func TestUpgradeCmd(t *testing.T) {
resp: helm.ReleaseMock(&helm.MockReleaseOptions{Name: "bonkers-bunny", Version: 1, Chart: ch3}),
err: true,
},
{
name: "upgrade with app-version (allow)",
args: []string{"testdata/testcharts/alpine-app-version"},
flags: []string{"--app-version", "1.0.1"},
},
{
name: "upgrade with app-version (not allow)",
args: []string{"testdata/testcharts/alpine"},
flags: []string{"--app-version", "1.0.1"},
err: true,
},
}
cmd := func(c *helm.FakeClient, out io.Writer) *cobra.Command {

Loading…
Cancel
Save