diff --git a/pkg/apis/etcd/v1beta2/cluster.go b/pkg/apis/etcd/v1beta2/cluster.go index a7bfc9c9b..db49e94f2 100644 --- a/pkg/apis/etcd/v1beta2/cluster.go +++ b/pkg/apis/etcd/v1beta2/cluster.go @@ -141,6 +141,8 @@ type PodPolicy struct { // PersistentVolumeClaimSpec is the spec to describe PVC for the etcd container // This field is optional. If no PVC spec, etcd container will use emptyDir as volume + // Note. This feature is in alpha stage. It is currently only used as non-stable storage, + // not the stable storage. Future work need to make it used as stable storage. PersistentVolumeClaimSpec *v1.PersistentVolumeClaimSpec `json:"persistentVolumeClaimSpec,omitempty"` } diff --git a/pkg/cluster/reconcile.go b/pkg/cluster/reconcile.go index f54eed5c8..f6568072a 100644 --- a/pkg/cluster/reconcile.go +++ b/pkg/cluster/reconcile.go @@ -218,7 +218,7 @@ func (c *Cluster) removeMember(toRemove *etcdutil.Member) (err error) { return err } if c.isPodPVEnabled() { - err = c.removePVC(k8sutil.PVCNameFromMemberName(toRemove.Name)) + err = c.removePVC(k8sutil.PVCNameFromMember(toRemove.Name)) if err != nil { return err } diff --git a/pkg/util/k8sutil/k8sutil.go b/pkg/util/k8sutil/k8sutil.go index 6cbf57f58..4fc1583af 100644 --- a/pkg/util/k8sutil/k8sutil.go +++ b/pkg/util/k8sutil/k8sutil.go @@ -78,8 +78,8 @@ func GetPodNames(pods []*v1.Pod) []string { return res } -// PVCNameFromMemberName the way we get PVC name from the member name -func PVCNameFromMemberName(memberName string) string { +// PVCNameFromMember the way we get PVC name from the member name +func PVCNameFromMember(memberName string) string { return memberName } @@ -255,7 +255,7 @@ func NewSeedMemberPod(clusterName string, ms etcdutil.MemberSet, m *etcdutil.Mem func NewEtcdPodPVC(m *etcdutil.Member, pvcSpec v1.PersistentVolumeClaimSpec, clusterName, namespace string, owner metav1.OwnerReference) *v1.PersistentVolumeClaim { pvc := &v1.PersistentVolumeClaim{ ObjectMeta: metav1.ObjectMeta{ - Name: PVCNameFromMemberName(m.Name), + Name: PVCNameFromMember(m.Name), Namespace: namespace, Labels: LabelsForCluster(clusterName), },