// UpdateClusterFailoverCond updates the cluster FailoverInProgress condition on the given cluster
UpdateClusterFailoverCond updates the cluster FailoverInProgress condition on the given cluster
// UpdateClusterFailoverCond updates the cluster FailoverInProgress condition on the given cluster
func UpdateClusterFailoverCond(c client.Client, clusterName, reason, msg string, status bool) error {
	key, err := orcNameToKey(clusterName)
	if err != nil {
		return err
	}
	cluster := mysqlcluster.New(&api.MysqlCluster{})
	if err := c.Get(context.TODO(), key, cluster.Unwrap()); err != nil {
		return err
	}
	s := corev1.ConditionFalse
	if status {
		s = corev1.ConditionTrue
	}
	cluster.UpdateStatusCondition(api.ClusterConditionFailoverInProgress, s, reason, msg)
	if err := c.Status().Update(context.TODO(), cluster.Unwrap()); err != nil {
		return err
	}
	return nil
}
func UpdateClusterFailoverCond ( c client . Client , clusterName , reason , msg string , status bool ) error { key , err := orcNameToKey ( clusterName ) if err != nil { return err } cluster := mysqlcluster . New ( & api . MysqlCluster { } ) if err := c . Get ( context . TODO ( ) , key , cluster . Unwrap ( ) ) ; err != nil { return err } s := corev1 . ConditionFalse if status { s = corev1 . ConditionTrue } cluster . UpdateStatusCondition ( api . ClusterConditionFailoverInProgress , s , reason , msg ) if err := c . Status ( ) . Update ( context . TODO ( ) , cluster . Unwrap ( ) ) ; err != nil { return err } return nil }
UpdateClusterFailoverCond updates the cluster FailoverInProgress condition on the given cluster
UpdateClusterFailoverCond updates the cluster FailoverInProgress condition on the given cluster
// get cluster from k8s // update cluster failover in progress condition // update cluster status