Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Stono committed Oct 6, 2021
0 parents commit b8a1445
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
24 changes: 24 additions & 0 deletions Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: example
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Demonstrating a helm bug

- kubectl apply -f crd.yaml
- helm upgrade example --install .
```
❯ helm upgrade example --install .
Release "example" does not exist. Installing it now.
NAME: example
LAST DEPLOYED: Wed Oct 6 10:43:23 2021
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
```

- edit [templates/instance1.yaml](templates/instance1.yaml) to be `spec.name=invalid`, and remove [templates/instance2.yaml](templates/instance2.yaml) from the chart
- helm upgrade example --install .

```
❯ helm upgrade example --install .
Error: UPGRADE FAILED: cannot patch "example1" with kind Example: Example.stono.io "example1" is invalid: spec.name: Invalid value: "": spec.name in body should match '^valid$'
```

- Attempt to (but unable to) roll back to previous release:
```
❯ helm rollback example 1
Error: no Example with the name "example2" found
```
30 changes: 30 additions & 0 deletions crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
labels:
app: example
name: examples.stono.io
spec:
conversion:
strategy: None
group: stono.io
names:
kind: Example
listKind: ExampleList
plural: examples
singular: example
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
name:
type: string
pattern: '^valid$'
served: true
storage: true
7 changes: 7 additions & 0 deletions templates/instance1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: stono.io/v1
kind: Example
metadata:
name: example1
namespace: default
spec:
name: valid
7 changes: 7 additions & 0 deletions templates/instance2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: stono.io/v1
kind: Example
metadata:
name: example2
namespace: default
spec:
name: valid

0 comments on commit b8a1445

Please sign in to comment.