Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielZhangQD committed Apr 21, 2020
1 parent 7879114 commit b4253a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/manager/member/orphan_pods_cleaner.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,22 +92,22 @@ func (opc *orphanPodsCleaner) Clean(tc *v1alpha1.TidbCluster) (map[string]string
continue
}

var pvcName []string
var pvcNames []string
for _, vol := range pod.Spec.Volumes {
if vol.PersistentVolumeClaim != nil {
if vol.PersistentVolumeClaim.ClaimName != "" {
pvcName = append(pvcName, vol.PersistentVolumeClaim.ClaimName)
pvcNames = append(pvcNames, vol.PersistentVolumeClaim.ClaimName)
}
}
}
if len(pvcName) < 1 {
if len(pvcNames) < 1 {
skipReason[podName] = skipReasonOrphanPodsCleanerPVCNameIsEmpty
continue
}

var err error
var pvcNotFound bool
for _, p := range pvcName {
for _, p := range pvcNames {
// check informer cache
_, err = opc.pvcLister.PersistentVolumeClaims(ns).Get(p)
if err == nil {
Expand Down
2 changes: 2 additions & 0 deletions pkg/manager/member/pd_member_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,8 @@ func getPDConfigMap(tc *v1alpha1.TidbCluster) (*corev1.ConfigMap, error) {
config.Dashboard.TiDBCertPath = path.Join(tidbClientCertPath, corev1.TLSCertKey)
config.Dashboard.TiDBKeyPath = path.Join(tidbClientCertPath, corev1.TLSPrivateKeyKey)
}
// TiFlash requires PD to enable the `replication.enable-placement-rules`
// Check detail in https://pingcap.com/docs/stable/reference/tiflash/deploy/
if tc.Spec.TiFlash != nil {
if config.Replication == nil {
config.Replication = &v1alpha1.PDReplicationConfig{}
Expand Down

0 comments on commit b4253a1

Please sign in to comment.