Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Jingtao Ren committed Jan 20, 2018
1 parent 296b27c commit a5a0cb2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions pkg/apis/etcd/v1beta2/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/util/k8sutil/k8sutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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),
},
Expand Down

0 comments on commit a5a0cb2

Please sign in to comment.