Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install app-repository CRD via a hook #813

Merged
merged 1 commit into from
Nov 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chart/kubeapps/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: kubeapps
version: 0.9.7
version: 0.9.8
appVersion: DEVEL
description: Kubeapps is a dashboard for your Kubernetes cluster that makes it easy to deploy and manage applications in your cluster using Helm
icon: https://raw.githubusercontent.com/kubeapps/kubeapps/master/docs/img/logo.png
Expand Down
5 changes: 3 additions & 2 deletions chart/kubeapps/templates/apprepository-crd.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{{- if or (not (.Capabilities.APIVersions.Has "kubeapps.com/v1alpha1")) (.Release.IsUpgrade) -}}
{{- if not (.Capabilities.APIVersions.Has "kubeapps.com/v1alpha1") -}}
# The condition above will be true if another instance of Kubeapps is
# already installed
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: apprepositories.kubeapps.com
annotations:
"helm.sh/resource-policy": keep
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if I remember correctly, if it's installed with a hook it won't be deleted by helm, isn't it?

Copy link
Contributor Author

@migmartri migmartri Nov 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wont be deleted no.

From their docs:

Practically speaking, this means that if you create resources in a hook, you cannot rely upon helm delete to remove the resources. To destroy such resources, you need to either write code to perform this operation in a pre-delete or post-delete hook or add "helm.sh/hook-delete-policy" annotation to the hook template file.

# We also install it pre-upgrade in the case that the user has removed the CRD before upgrading
"helm.sh/hook": pre-install,post-upgrade
labels:
app: {{ template "kubeapps.apprepository.fullname" . }}
chart: {{ template "kubeapps.chart" . }}
Expand Down