Skip to content

Commit b7b83ea

Browse files
author
houkunpeng
committed
feat:support custom folder expression and annotation setting folder
1 parent 5decf72 commit b7b83ea

File tree

6 files changed

+35
-62
lines changed

6 files changed

+35
-62
lines changed

examples/custom_path/deployment.yaml

Lines changed: 0 additions & 40 deletions
This file was deleted.

examples/custom_path/pvc.yaml

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- pvc.yaml
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: v1
2+
kind: PersistentVolumeClaim
3+
metadata:
4+
name: custom-folder-pvc
5+
annotations:
6+
"rancher.io/customFolderName": "demo1"
7+
spec:
8+
accessModes:
9+
- ReadWriteOnce
10+
storageClassName: local-path
11+
resources:
12+
requests:
13+
storage: 128Mi

test/pod_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build e2e
12
// +build e2e
23

34
package test
@@ -6,9 +7,9 @@ import (
67
"fmt"
78
"github.com/kelseyhightower/envconfig"
89
"github.com/stretchr/testify/suite"
10+
"strings"
911
"testing"
1012
"time"
11-
"strings"
1213
)
1314

1415
const (
@@ -131,6 +132,12 @@ func (p *PodTestSuite) TestPodWithSubpath() {
131132
runTest(p, []string{p.config.IMAGE}, "ready", hostPathVolumeType)
132133
}
133134

135+
func (p *PodTestSuite) TestPodWithCustomFolder() {
136+
p.kustomizeDir = "pod-with-custom-folder"
137+
138+
runTest(p, []string{p.config.IMAGE}, "ready", hostPathVolumeType)
139+
}
140+
134141
func runTest(p *PodTestSuite, images []string, waitCondition, volumeType string) {
135142
kustomizeDir := testdataFile(p.kustomizeDir)
136143

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- ../../../deploy
5+
- ../../../examples/pvc-with-custom-folder
6+
commonLabels:
7+
app: custom-folder-provisioner
8+
images:
9+
- name: rancher/local-path-provisioner
10+
newTag: dev

0 commit comments

Comments
 (0)