mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-11-29 18:27:58 +08:00
fix: storage type created by sts is incorrect (#1737)
This commit is contained in:
parent
d98f2eea1d
commit
1a73ac996e
@ -65,18 +65,18 @@ func (v *OtherVolume) CreateVolume(define *Define) error {
|
|||||||
return "linux"
|
return "linux"
|
||||||
}(),
|
}(),
|
||||||
}
|
}
|
||||||
v.as.SetClaim(claim) // store claim to appService
|
v.as.SetClaim(claim) // store claim to appService
|
||||||
|
statefulset := v.as.GetStatefulSet() //有状态组件
|
||||||
vo := corev1.Volume{Name: volumeMountName}
|
vo := corev1.Volume{Name: volumeMountName}
|
||||||
vo.PersistentVolumeClaim = &corev1.PersistentVolumeClaimVolumeSource{ClaimName: claim.GetName(), ReadOnly: volumeReadOnly}
|
vo.PersistentVolumeClaim = &corev1.PersistentVolumeClaimVolumeSource{ClaimName: claim.GetName(), ReadOnly: volumeReadOnly}
|
||||||
define.volumes = append(define.volumes, vo)
|
if statefulset != nil {
|
||||||
if shareFile {
|
statefulset.Spec.VolumeClaimTemplates = append(statefulset.Spec.VolumeClaimTemplates, *claim)
|
||||||
v.as.SetClaimManually(claim)
|
logrus.Debugf("stateset.Spec.VolumeClaimTemplates: %+v", statefulset.Spec.VolumeClaimTemplates)
|
||||||
} else {
|
} else {
|
||||||
statefulset := v.as.GetStatefulSet() //有状态组件
|
if shareFile {
|
||||||
if statefulset != nil {
|
v.as.SetClaimManually(claim)
|
||||||
statefulset.Spec.VolumeClaimTemplates = append(statefulset.Spec.VolumeClaimTemplates, *claim)
|
|
||||||
logrus.Debugf("stateset.Spec.VolumeClaimTemplates: %+v", statefulset.Spec.VolumeClaimTemplates)
|
|
||||||
}
|
}
|
||||||
|
define.volumes = append(define.volumes, vo)
|
||||||
}
|
}
|
||||||
|
|
||||||
vm := corev1.VolumeMount{
|
vm := corev1.VolumeMount{
|
||||||
|
Loading…
Reference in New Issue
Block a user