Skip to content

Commit

Permalink
add PVName as volume
Browse files Browse the repository at this point in the history
This relates to issue kubernetes-sigs#149 and allows to use the PVName in the path pattern.
  • Loading branch information
robkooper committed Nov 12, 2021
1 parent 2fb90f7 commit 498f518
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,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.<metadata>}`. Example: If folder should be named like `<pvc-namespace>-<pvc-name>`, use `${.PVC.namespace}-${.PVC.name}` as pathPattern. | 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. To use the default name use `${.PVC.namespace}-${.PVC.name}-${.PVC.volume}` as pathPattern. | n/a |

This is `deploy/class.yaml` which defines the NFS subdir external provisioner's Kubernetes Storage Class:

Expand Down
1 change: 1 addition & 0 deletions cmd/nfs-subdir-external-provisioner/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ func (p *nfsProvisioner) Provision(ctx context.Context, options controller.Provi
data: map[string]string{
"name": pvcName,
"namespace": pvcNamespace,
"volume": options.PVName,
},
labels: options.PVC.Labels,
annotations: options.PVC.Annotations,
Expand Down

0 comments on commit 498f518

Please sign in to comment.