@@ -2359,13 +2359,22 @@ func (oa *operatorActions) CheckIncrementalBackup(info *TidbClusterConfig, withD
2359
2359
return false , nil
2360
2360
}
2361
2361
2362
+ // v1.0.0 don't have affinity test case
2363
+ // https://github.com/pingcap/tidb-operator/pull/746
2364
+ isv1 := info .OperatorTag == "v1.0.0"
2365
+
2362
2366
for _ , pod := range pods .Items {
2363
2367
if ! oa .pumpHealth (info , pod .Spec .Hostname ) {
2364
2368
glog .Errorf ("some pods is not health %s" , pumpStatefulSetName )
2365
2369
// return false, nil
2366
2370
}
2371
+
2372
+ if isv1 {
2373
+ continue
2374
+ }
2375
+
2367
2376
glog .Info (pod .Spec .Affinity )
2368
- if len (pod .Spec .Affinity .PodAntiAffinity .PreferredDuringSchedulingIgnoredDuringExecution ) != 1 {
2377
+ if pod . Spec . Affinity == nil || pod . Spec . Affinity . PodAntiAffinity == nil || len (pod .Spec .Affinity .PodAntiAffinity .PreferredDuringSchedulingIgnoredDuringExecution ) != 1 {
2369
2378
return true , fmt .Errorf ("pump pod %s/%s should have affinity set" , pod .Namespace , pod .Name )
2370
2379
}
2371
2380
glog .Info (pod .Spec .Tolerations )
@@ -2415,8 +2424,13 @@ func (oa *operatorActions) CheckIncrementalBackup(info *TidbClusterConfig, withD
2415
2424
glog .Errorf ("some pods is not health %s" , drainerStatefulSetName )
2416
2425
// return false, nil
2417
2426
}
2427
+
2428
+ if isv1 {
2429
+ continue
2430
+ }
2431
+
2418
2432
glog .Info (pod .Spec .Affinity )
2419
- if len (pod .Spec .Affinity .PodAntiAffinity .PreferredDuringSchedulingIgnoredDuringExecution ) != 1 {
2433
+ if pod . Spec . Affinity == nil || pod . Spec . Affinity . PodAntiAffinity == nil || len (pod .Spec .Affinity .PodAntiAffinity .PreferredDuringSchedulingIgnoredDuringExecution ) != 1 {
2420
2434
return true , fmt .Errorf ("drainer pod %s/%s should have spec.affinity set" , pod .Namespace , pod .Name )
2421
2435
}
2422
2436
glog .Info (pod .Spec .Tolerations )
@@ -2705,7 +2719,7 @@ func (oa *operatorActions) CheckManualPauseTiDB(info *TidbClusterConfig) error {
2705
2719
}
2706
2720
2707
2721
// wait for the tidb statefulset is upgrade to the protect one
2708
- if err = wait .Poll (DefaultPollInterval , DefaultPollTimeout , fn ); err != nil {
2722
+ if err = wait .Poll (DefaultPollInterval , 30 * time . Minute , fn ); err != nil {
2709
2723
return fmt .Errorf ("fail to upgrade to annotation TiDB pod : %v" , err )
2710
2724
}
2711
2725
0 commit comments