Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
weekface committed Aug 8, 2019
1 parent 6e185f5 commit 8d68744
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/tidb-cluster/templates/pump-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
{{- end }}
{{- if .Values.binlog.pump.tolerations }}
tolerations:
{{ toYaml .Values.binlog.pump.tolerations | indent 8 }}
{{ toYaml .Values.binlog.pump.tolerations | indent 8 }}
{{- end }}
containers:
- name: pump
Expand Down
24 changes: 20 additions & 4 deletions tests/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -2352,11 +2352,19 @@ func (oa *operatorActions) CheckIncrementalBackup(info *TidbClusterConfig, withD
glog.Errorf("some pods is not health %s", pumpStatefulSetName)
// return false, nil
}
glog.V(4).Info(pod.Spec.Affinity)
glog.Info(pod.Spec.Affinity)
if len(pod.Spec.Affinity.PodAntiAffinity.PreferredDuringSchedulingIgnoredDuringExecution) != 1 {
return true, fmt.Errorf("pump pod %s/%s should have affinity set", pod.Namespace, pod.Name)
}
if len(pod.Spec.Tolerations) != 1 {
glog.Info(pod.Spec.Tolerations)
foundKey := false
for _, tor := range pod.Spec.Tolerations {
if tor.Key == "node-role" {
foundKey = true
break
}
}
if !foundKey {
return true, fmt.Errorf("pump pod %s/%s should have tolerations set", pod.Namespace, pod.Name)
}
}
Expand Down Expand Up @@ -2395,11 +2403,19 @@ func (oa *operatorActions) CheckIncrementalBackup(info *TidbClusterConfig, withD
glog.Errorf("some pods is not health %s", drainerStatefulSetName)
// return false, nil
}
glog.V(4).Info(pod.Spec.Affinity)
glog.Info(pod.Spec.Affinity)
if len(pod.Spec.Affinity.PodAntiAffinity.PreferredDuringSchedulingIgnoredDuringExecution) != 1 {
return true, fmt.Errorf("drainer pod %s/%s should have spec.affinity set", pod.Namespace, pod.Name)
}
if len(pod.Spec.Tolerations) != 1 {
glog.Info(pod.Spec.Tolerations)
foundKey := false
for _, tor := range pod.Spec.Tolerations {
if tor.Key == "node-role" {
foundKey = true
break
}
}
if !foundKey {
return true, fmt.Errorf("drainer pod %s/%s should have tolerations set", pod.Namespace, pod.Name)
}
}
Expand Down

0 comments on commit 8d68744

Please sign in to comment.