Skip to content

Commit

Permalink
fix: crds getting removed on helm upgrades (#289)
Browse files Browse the repository at this point in the history
* fix: crds getting removed on helm upgrades

Signed-off-by: Abhinandan Purkait <[email protected]>

* fix: crds getting removed on helm upgrades

Signed-off-by: Abhinandan Purkait <[email protected]>

* chore: add condition for the crds subchart

Signed-off-by: Abhinandan Purkait <[email protected]>

* feat(chart): remove quotes from version

Signed-off-by: Abhinandan Purkait <[email protected]>

* feat(chart): update README

Signed-off-by: Abhinandan Purkait <[email protected]>

---------

Signed-off-by: Abhinandan Purkait <[email protected]>
  • Loading branch information
Abhinandan-Purkait committed May 8, 2024
1 parent 731233a commit 3e770f5
Show file tree
Hide file tree
Showing 17 changed files with 58 additions and 100 deletions.
50 changes: 6 additions & 44 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,8 @@
# Contributor Covenant Code of Conduct
# Code of Conduct
<BR>

## Our Pledge
## Umbrella Project
OpenEBS is an "umbrella project". Every project, repository and file in the OpenEBS organization adopts and follows the policies found in the Community repo umbrella project files.
<BR>

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
This project follows the [OpenEBS Code of Conduct](https://github.com/openebs/community/CODE_OF_CONDUCT.md)
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# Contributing Guidelines
<BR>

## Umbrella Project
OpenEBS is an "umbrella project". Every project, repository and file in the OpenEBS organization adopts and follows the policies found in the Community repo umbrella project files.
<BR>

This project follows the [OpenEBS Contributor Guidelines](https://github.com/openebs/community/CONTRIBUTING.md)

# Contributing to LocalPV-LVM

LVM LocalPV uses the standard GitHub pull requests process to review and accept contributions. There are several areas that could use your help. For starters, you could help in improving the sections in this document by either creating a new issue describing the improvement or submitting a pull request to this repository. The issues are maintained at [lvm-localpv/issues](https://github.com/openebs/lvm-localpv/issues) repository.
Expand Down
10 changes: 8 additions & 2 deletions GOVERNANCE.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
This is a OpenEBS sub project and abides by the
[OpenEBS Project Governance](https://github.com/openebs/openebs/blob/HEAD/GOVERNANCE.md).
# Governance
<BR>

## Umbrella Project
OpenEBS is an "umbrella project". Every project, repository and file in the OpenEBS organization adopts and follows the policies found in the Community repo umbrella project files.
<BR>

This project follows the [OpenEBS Governance](https://github.com/openebs/community/GOVERNANCE.md)
13 changes: 1 addition & 12 deletions MAINTAINERS
Original file line number Diff line number Diff line change
@@ -1,12 +1 @@
# Official list of OpenEBS Maintainers.
#
# Names added to this file should be in the following format:
# Individual's name,@githubhandle, Company Name
#
# Please keep the below list sorted in ascending order.
#
#Maintainers
"Pawan Prakash Sharma",@pawanpraka1,MayaData

#Reviewers
"Kiran Mova",@kmova,MayaData
See [OpenEBS Maintainers](https://github.com/openebs/community/MAINTAINERS.md)
1 change: 1 addition & 0 deletions ct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ target-branch: develop
chart-dirs:
- deploy/helm
helm-extra-args: --timeout=500s
validate-maintainers: false
12 changes: 3 additions & 9 deletions deploy/helm/charts/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: lvm-localpv
description: CSI Driver for dynamic provisioning of LVM Persistent Local Volumes.
version: 1.5.0
version: 1.5.1
appVersion: 1.5.0
icon: https://raw.githubusercontent.com/cncf/artwork/master/projects/openebs/icon/color/openebs-icon-color.png
home: https://openebs.io/
Expand All @@ -16,11 +16,5 @@ sources:
- https://github.com/openebs/lvm-localpv
dependencies:
- name: crds
version: "1.5.0"
maintainers:
- name: prateekpandey14
email: [email protected]
- name: pawanpraka1
email: [email protected]
- name: iyashu
email: [email protected]
version: 1.5.1
condition: crds.enabled
2 changes: 1 addition & 1 deletion deploy/helm/charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ helm install openebs-lvmlocalpv openebs-lvmlocalpv/lvm-localpv --namespace opene
| `lvmPlugin.image.registry` | Registry for openebs-lvm-plugin image | `""` |
| `lvmPlugin.image.repository` | Image repository for openebs-lvm-plugin | `openebs/lvm-driver` |
| `lvmPlugin.image.pullPolicy` | Image pull policy for openebs-lvm-plugin | `IfNotPresent` |
| `lvmPlugin.image.tag` | Image tag for openebs-lvm-plugin | `1.3.0` |
| `lvmPlugin.image.tag` | Image tag for openebs-lvm-plugin | `1.5.0` |
| `lvmPlugin.metricsPort` | The TCP port number used for exposing lvm-metrics | `9500` |
| `lvmPlugin.allowedTopologies` | The comma seperated list of allowed node topologies | `kubernetes.io/hostname,` |
| `lvmNode.driverRegistrar.image.registry` | Registry for csi-node-driver-registrar image | `registry.k8s.io/` |
Expand Down
2 changes: 1 addition & 1 deletion deploy/helm/charts/charts/crds/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v2
name: crds
version: 1.5.0
version: 1.5.1
description: A Helm chart that collects CustomResourceDefinitions (CRDs) from lvm-localpv.
25 changes: 13 additions & 12 deletions deploy/helm/charts/charts/crds/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
{{/* vim: set filetype=mustache: */}}

{{/*
This returns a "1" if the CRD is absent in the cluster
Adds extra annotations to CRDs. This targets two scenarios: preventing CRD recycling in case
the chart is removed; and adding custom annotations.
NOTE: This function assumes the element `metadata.annotations` already exists.
Usage:
{{- if (include "crdIsAbsent" (list <crd-name>)) -}}
# CRD Yaml
{{- end -}}
{{- include "crds.extraAnnotations" .Values.csi.volumeSnapshots | nindent 4 }}
*/}}
{{- define "crdIsAbsent" -}}
{{- $crdName := index . 0 -}}
{{- $crd := lookup "apiextensions.k8s.io/v1" "CustomResourceDefinition" "" $crdName -}}
{{- $output := "1" -}}
{{- if $crd -}}
{{- $output = "" -}}
{{- end -}}

{{- $output -}}
{{- define "crds.extraAnnotations" -}}
{{- if .keep -}}
helm.sh/resource-policy: keep
{{ end }}
{{- with .annotations }}
{{- toYaml . }}
{{- end }}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{{- if .Values.csi.volumeSnapshots.enabled -}}
{{- $crdName := "volumesnapshotclasses.snapshot.storage.k8s.io" -}}
{{- if (include "crdIsAbsent" (list $crdName)) -}}
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
api-approved.kubernetes.io: https://github.com/kubernetes-csi/external-snapshotter/pull/814
controller-gen.kubebuilder.io/version: v0.11.3
{{- include "crds.extraAnnotations" .Values.csi.volumeSnapshots | nindent 4 }}
creationTimestamp: null
name: volumesnapshotclasses.snapshot.storage.k8s.io
spec:
Expand Down Expand Up @@ -148,5 +147,4 @@ status:
plural: ""
conditions: []
storedVersions: []
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{{- if .Values.csi.volumeSnapshots.enabled -}}
{{- $crdName := "volumesnapshotcontents.snapshot.storage.k8s.io" -}}
{{- if (include "crdIsAbsent" (list $crdName)) -}}
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
api-approved.kubernetes.io: https://github.com/kubernetes-csi/external-snapshotter/pull/814
controller-gen.kubebuilder.io/version: v0.11.3
{{- include "crds.extraAnnotations" .Values.csi.volumeSnapshots | nindent 4 }}
creationTimestamp: null
name: volumesnapshotcontents.snapshot.storage.k8s.io
spec:
Expand Down Expand Up @@ -486,5 +485,4 @@ status:
plural: ""
conditions: []
storedVersions: []
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{{- if .Values.csi.volumeSnapshots.enabled -}}
{{- $crdName := "volumesnapshots.snapshot.storage.k8s.io" -}}
{{- if (include "crdIsAbsent" (list $crdName)) -}}
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
api-approved.kubernetes.io: https://github.com/kubernetes-csi/external-snapshotter/pull/814
controller-gen.kubebuilder.io/version: v0.11.3
{{- include "crds.extraAnnotations" .Values.csi.volumeSnapshots | nindent 4 }}
creationTimestamp: null
name: volumesnapshots.snapshot.storage.k8s.io
spec:
Expand Down Expand Up @@ -388,5 +387,4 @@ status:
plural: ""
conditions: []
storedVersions: []
{{- end -}}
{{- end -}}
4 changes: 1 addition & 3 deletions deploy/helm/charts/charts/crds/templates/lvmnode.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{{- if .Values.lvmLocalPv.enabled -}}
{{- $crdName := "lvmnodes.local.openebs.io" -}}
{{- if (include "crdIsAbsent" (list $crdName)) -}}
##############################################
########### ############
########### LVMNode CRD ############
Expand All @@ -17,6 +15,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.0
{{- include "crds.extraAnnotations" .Values.lvmLocalPv | nindent 4 }}
creationTimestamp: null
name: lvmnodes.local.openebs.io
spec:
Expand Down Expand Up @@ -176,5 +175,4 @@ status:
plural: ""
conditions: []
storedVersions: []
{{- end -}}
{{- end -}}
4 changes: 1 addition & 3 deletions deploy/helm/charts/charts/crds/templates/lvmsnapshot.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{{- if .Values.lvmLocalPv.enabled -}}
{{- $crdName := "lvmsnapshots.local.openebs.io" -}}
{{- if (include "crdIsAbsent" (list $crdName)) -}}
##############################################
########### ############
########### LVMSnapshot CRD ############
Expand All @@ -17,6 +15,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.0
{{- include "crds.extraAnnotations" .Values.lvmLocalPv | nindent 4 }}
creationTimestamp: null
name: lvmsnapshots.local.openebs.io
spec:
Expand Down Expand Up @@ -84,5 +83,4 @@ status:
plural: ""
conditions: []
storedVersions: []
{{- end -}}
{{- end -}}
4 changes: 1 addition & 3 deletions deploy/helm/charts/charts/crds/templates/lvmvolume.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{{- if .Values.lvmLocalPv.enabled -}}
{{- $crdName := "lvmvolumes.local.openebs.io" -}}
{{- if (include "crdIsAbsent" (list $crdName)) -}}
##############################################
########### ############
########### LVMVolume CRD ############
Expand All @@ -17,6 +15,7 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.0
{{- include "crds.extraAnnotations" .Values.lvmLocalPv | nindent 4 }}
creationTimestamp: null
name: lvmvolumes.local.openebs.io
spec:
Expand Down Expand Up @@ -152,5 +151,4 @@ status:
plural: ""
conditions: []
storedVersions: []
{{- end -}}
{{- end -}}
4 changes: 4 additions & 0 deletions deploy/helm/charts/charts/crds/values.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
lvmLocalPv:
# Install lvm-localpv CRDs
enabled: true
# Keep CRDs on chart uninstall
keep: true

csi:
volumeSnapshots:
# Install Volume Snapshot CRDs
enabled: true
# Keep CRDs on chart uninstall
keep: true
6 changes: 5 additions & 1 deletion deploy/helm/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
release:
version: "1.5.0"
version: "1.5.1"

imagePullSecrets:
# - name: "image-pull-secret"
Expand Down Expand Up @@ -187,7 +187,11 @@ crds:
lvmLocalPv:
# Install lvm-localpv CRDs
enabled: true
# Keep CRDs on chart uninstall
keep: true
csi:
volumeSnapshots:
# Install Volume Snapshot CRDs
enabled: true
# Keep CRDs on chart uninstall
keep: true

0 comments on commit 3e770f5

Please sign in to comment.