Skip to content

Commit

Permalink
support subpath in crd (#212)
Browse files Browse the repository at this point in the history
Signed-off-by: yandongxiao <yandongxiao@starrocks.com>
  • Loading branch information
yandongxiao committed Aug 10, 2023
1 parent 026dfd7 commit e4ad3cc
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions config/crd/bases/starrocks.com_starrocksclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1271,6 +1271,10 @@ spec:
Gi, GiB, Ti, Ti, Pi, Ei, Ex: `512Mi`.'
pattern: (^0|([0-9]*l[.])?[0-9]+((M|G|T|E|P)i))$
type: string
subPath:
description: SubPath within the volume from which the container's
volume should be mounted.
type: string
required:
- name
- storageSize
Expand Down Expand Up @@ -3215,6 +3219,10 @@ spec:
Gi, GiB, Ti, Ti, Pi, Ei, Ex: `512Mi`.'
pattern: (^0|([0-9]*l[.])?[0-9]+((M|G|T|E|P)i))$
type: string
subPath:
description: SubPath within the volume from which the container's
volume should be mounted.
type: string
required:
- name
- storageSize
Expand Down Expand Up @@ -4485,6 +4493,10 @@ spec:
Gi, GiB, Ti, Ti, Pi, Ei, Ex: `512Mi`.'
pattern: (^0|([0-9]*l[.])?[0-9]+((M|G|T|E|P)i))$
type: string
subPath:
description: SubPath within the volume from which the container's
volume should be mounted.
type: string
required:
- name
- storageSize
Expand Down
6 changes: 6 additions & 0 deletions deploy/starrocks.com_starrocksclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,8 @@ spec:
storageSize:
pattern: (^0|([0-9]*l[.])?[0-9]+((M|G|T|E|P)i))$
type: string
subPath:
type: string
required:
- name
- storageSize
Expand Down Expand Up @@ -1524,6 +1526,8 @@ spec:
storageSize:
pattern: (^0|([0-9]*l[.])?[0-9]+((M|G|T|E|P)i))$
type: string
subPath:
type: string
required:
- name
- storageSize
Expand Down Expand Up @@ -2114,6 +2118,8 @@ spec:
storageSize:
pattern: (^0|([0-9]*l[.])?[0-9]+((M|G|T|E|P)i))$
type: string
subPath:
type: string
required:
- name
- storageSize
Expand Down
3 changes: 3 additions & 0 deletions pkg/apis/starrocks/v1/starrockscluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ type StorageVolume struct {

// MountPath specify the path of volume mount.
MountPath string `json:"mountPath,omitempty"`

// SubPath within the volume from which the container's volume should be mounted.
SubPath string `json:"subPath,omitempty"`
}

// StarRocksClusterList contains a list of StarRocksCluster
Expand Down
1 change: 1 addition & 0 deletions pkg/k8sutils/templates/pod/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ func MountStorageVolumes(spec v1.SpecInterface) ([]corev1.Volume, []corev1.Volum
volumeMounts = append(volumeMounts, corev1.VolumeMount{
Name: sv.Name,
MountPath: sv.MountPath,
SubPath: sv.SubPath,
})

volumes = append(volumes, corev1.Volume{
Expand Down

0 comments on commit e4ad3cc

Please sign in to comment.