Compare commits
14 Commits
nfs-subdir
...
v4.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
da1c2a6e3e | ||
|
|
21815a26f4 | ||
|
|
f08caa228c | ||
|
|
f491425b8b | ||
|
|
221db2f021 | ||
|
|
b7b4412004 | ||
|
|
487b9092a6 | ||
|
|
a99f3dafb1 | ||
|
|
571aadd47e | ||
|
|
9b9ac9aa8d | ||
|
|
6b7372c8cd | ||
|
|
5f8f90d71a | ||
|
|
8da26f952b | ||
|
|
f716044142 |
18
.github/workflows/helm-chart-lint.yml
vendored
Normal file
18
.github/workflows/helm-chart-lint.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
name: Lint Helm Charts
|
||||
|
||||
on: pull_request
|
||||
|
||||
jobs:
|
||||
lint-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up chart-testing
|
||||
uses: helm/chart-testing-action@v2.0.1
|
||||
|
||||
- name: Run chart-testing (lint)
|
||||
run: ct lint --validate-maintainers=false
|
||||
2
Makefile
2
Makefile
@@ -17,4 +17,4 @@ all: build
|
||||
|
||||
include release-tools/build.make
|
||||
|
||||
BUILD_PLATFORMS=linux amd64; linux arm64 -arm64; linux ppc64le -ppc64le; linux s390x -s390x
|
||||
BUILD_PLATFORMS=linux amd64; linux arm -arm; linux arm64 -arm64; linux ppc64le -ppc64le; linux s390x -s390x
|
||||
|
||||
@@ -120,7 +120,7 @@ To disable leader election, define an env variable named ENABLE_LEADER_ELECTION
|
||||
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------: |
|
||||
| onDelete | If it exists and has a delete value, delete the directory, if it exists and has a retain value, save the directory. | will be archived with name on the share: `archived-<volume.Name>` |
|
||||
| archiveOnDelete | If it exists and has a false value, delete the directory. if `onDelete` exists, `archiveOnDelete` will be ignored. | will be archived with name on the share: `archived-<volume.Name>` |
|
||||
| pathPattern | Specifies a template for creating a directory path via PVC metadata's such as labels, annotations, name or namespace. To specify metadata use `${.PVC.}`: `${PVC.namespace}` | n/a |
|
||||
| pathPattern | Specifies a template for creating a directory path via PVC metadata's such as labels, annotations, name or namespace. To specify metadata use `${.PVC.<metadata>}`. Example: If folder should be named like `<pvc-namespace>-<pvc-name>`, use `${.PVC.namespace}-${.PVC.name}` as pathPattern. | n/a |
|
||||
|
||||
This is `deploy/class.yaml` which defines the NFS subdir external provisioner's Kubernetes Storage Class:
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ appVersion: 4.0.0
|
||||
description: nfs-subdir-external-provisioner is an automatic provisioner that used your *already configured* NFS server, automatically creating Persistent Volumes.
|
||||
name: nfs-subdir-external-provisioner
|
||||
home: https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner
|
||||
version: 4.0.2
|
||||
version: 4.0.4
|
||||
kubeVersion: ">=1.9.0-0"
|
||||
sources:
|
||||
- https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner
|
||||
|
||||
@@ -61,6 +61,7 @@ The following tables lists the configurable parameters of this chart and their d
|
||||
| `storageClass.reclaimPolicy` | Method used to reclaim an obsoleted volume | `Delete` |
|
||||
| `storageClass.provisionerName` | Name of the provisionerName | null |
|
||||
| `storageClass.archiveOnDelete` | Archive pvc when deleting | `true` |
|
||||
| `storageClass.pathPattern` | Specifies a template for the directory name | null |
|
||||
| `storageClass.accessModes` | Set access mode for PV | `ReadWriteOnce` |
|
||||
| `leaderElection.enabled` | Enables or disables leader election | `true` |
|
||||
| `nfs.server` | Hostname of the NFS server (required) | null (ip or hostname) |
|
||||
|
||||
@@ -17,6 +17,9 @@ allowVolumeExpansion: {{ .Values.storageClass.allowVolumeExpansion }}
|
||||
reclaimPolicy: {{ .Values.storageClass.reclaimPolicy }}
|
||||
parameters:
|
||||
archiveOnDelete: "{{ .Values.storageClass.archiveOnDelete }}"
|
||||
{{- if .Values.storageClass.pathPattern }}
|
||||
pathPattern: "{{ .Values.storageClass.pathPattern }}"
|
||||
{{- end }}
|
||||
{{- if .Values.nfs.mountOptions }}
|
||||
mountOptions:
|
||||
{{- range .Values.nfs.mountOptions }}
|
||||
|
||||
@@ -35,6 +35,10 @@ storageClass:
|
||||
# When set to false your PVs will not be archived by the provisioner upon deletion of the PVC.
|
||||
archiveOnDelete: true
|
||||
|
||||
# Specifies a template for creating a directory path via PVC metadata's such as labels, annotations, name or namespace.
|
||||
# Ignored if value not set.
|
||||
pathPattern:
|
||||
|
||||
# Set access mode - ReadWriteOnce, ReadOnlyMany or ReadWriteMany
|
||||
accessModes: ReadWriteOnce
|
||||
|
||||
|
||||
@@ -139,8 +139,8 @@ func (p *nfsProvisioner) Provision(ctx context.Context, options controller.Provi
|
||||
|
||||
func (p *nfsProvisioner) Delete(ctx context.Context, volume *v1.PersistentVolume) error {
|
||||
path := volume.Spec.PersistentVolumeSource.NFS.Path
|
||||
relativePath := strings.Replace(path, p.path, "", 1)
|
||||
oldPath := filepath.Join(mountPath, relativePath)
|
||||
basePath := filepath.Base(path)
|
||||
oldPath := filepath.Join(mountPath, basePath)
|
||||
|
||||
if _, err := os.Stat(oldPath); os.IsNotExist(err) {
|
||||
glog.Warningf("path %s does not exist, deletion skipped", oldPath)
|
||||
@@ -179,7 +179,7 @@ func (p *nfsProvisioner) Delete(ctx context.Context, volume *v1.PersistentVolume
|
||||
}
|
||||
}
|
||||
|
||||
archivePath := filepath.Join(mountPath, "archived-"+volume.Name)
|
||||
archivePath := filepath.Join(mountPath, "archived-"+basePath)
|
||||
glog.V(4).Infof("archiving path %s to %s", oldPath, archivePath)
|
||||
return os.Rename(oldPath, archivePath)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user