fix a typo about events

Signed-off-by: Poor12 <shentiecheng@huawei.com>
This commit is contained in:
Poor12 2022-10-20 20:32:10 +08:00
parent 2a53cf8a4f
commit 047b2fb7ae
2 changed files with 4 additions and 4 deletions

View File

@ -6,8 +6,8 @@ const (
EventReasonCreateExecutionSpaceFailed = "CreateExecutionSpaceFailed"
// EventReasonRemoveExecutionSpaceFailed indicates that remove execution space failed.
EventReasonRemoveExecutionSpaceFailed = "RemoveExecutionSpaceFailed"
// EventReasonTaintClusterByConditionFailed indicates that taint cluster by condition
EventReasonTaintClusterByConditionFailed = "TaintClusterByCondition"
// EventReasonTaintClusterByConditionFailed indicates that taint cluster by condition failed.
EventReasonTaintClusterByConditionFailed = "TaintClusterByConditionFailed"
// EventReasonRemoveTargetClusterFailed indicates that failed to remove target cluster from binding.
EventReasonRemoveTargetClusterFailed = "RemoveTargetClusterFailed"
)

View File

@ -215,14 +215,14 @@ func (c *Controller) syncCluster(ctx context.Context, cluster *clusterv1alpha1.C
// create execution space
err := c.createExecutionSpace(cluster)
if err != nil {
c.EventRecorder.Event(cluster, corev1.EventTypeWarning, fmt.Sprintf("Failed %s", clusterv1alpha1.EventReasonCreateExecutionSpaceFailed), err.Error())
c.EventRecorder.Event(cluster, corev1.EventTypeWarning, clusterv1alpha1.EventReasonCreateExecutionSpaceFailed, err.Error())
return controllerruntime.Result{Requeue: true}, err
}
// taint cluster by condition
err = c.taintClusterByCondition(ctx, cluster)
if err != nil {
c.EventRecorder.Event(cluster, corev1.EventTypeWarning, fmt.Sprintf("Failed %s", clusterv1alpha1.EventReasonTaintClusterByConditionFailed), err.Error())
c.EventRecorder.Event(cluster, corev1.EventTypeWarning, clusterv1alpha1.EventReasonTaintClusterByConditionFailed, err.Error())
return controllerruntime.Result{Requeue: true}, err
}