diff --git a/controllers/msbdeployment_controller.go b/controllers/msbdeployment_controller.go index 64d6ed3..3f26f80 100644 --- a/controllers/msbdeployment_controller.go +++ b/controllers/msbdeployment_controller.go @@ -286,7 +286,7 @@ func (r *MsbDeploymentReconciler) SetupWithManager(mgr ctrl.Manager) error { return ctrl.NewControllerManagedBy(mgr). For(&myAppsv1.MsbDeployment{}). Owns(&appsv1.Deployment{}). // 监控 deployment 类型,变更就触发 reconciler - Owns(&corev1.Service{}). // 监控 service 类型,变更就触发 reconciler + Owns(&corev1.Service{}). // 监控 service 类型,变更就触发 reconciler Owns(&networkv1.Ingress{}). // 监控 ingress 类型,变更就触发 reconciler Complete(r) } @@ -475,11 +475,13 @@ func createCondition(conditionType, message, status, reason string) myAppsv1.Con // 只是删除对应的Condition不做更多的操作 func (r *MsbDeploymentReconciler) deleteStatus(md *myAppsv1.MsbDeployment, conditionType string) { // 1. 遍历conditions - for i := range md.Status.Conditions { + var tmp []myAppsv1.Condition + copy(tmp, md.Status.Conditions) + for i := range tmp { // 2. 找到要删除的对象 - if md.Status.Conditions[i].Type == conditionType { + if tmp[i].Type == conditionType { // 3. 执行删除 - md.Status.Conditions = deleteCondition(md.Status.Conditions, i) + md.Status.Conditions = deleteCondition(tmp, i) } } } diff --git a/test/e2e/e2e.xml b/test/e2e/e2e.xml index 8b71da9..bd184bf 100644 --- a/test/e2e/e2e.xml +++ b/test/e2e/e2e.xml @@ -1,67 +1,67 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file