func (m *Meta) SetCondition(ctype ConditionType, reason, message string) {
	m.setConditionValue(ctype, corev1.ConditionTrue, reason, message)
}
SetCondition updates or creates a new condition
package status
import (
	corev1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func (m *Meta) addCondition(ctype ConditionType, status corev1.ConditionStatus, reason, message string) {
	now := metav1.Now()
	c := &Condition{
		Type:               ctype,
		LastUpdateTime:     now,
		LastTransitionTime: now,
		Status:             status,
		Reason:             reason,
		Message:            message,
	}
	m.Conditions = append(m.Conditions, *c)
}
func (m *Meta) setConditionValue(ctype ConditionType, status corev1.ConditionStatus, reason, message string) {
	var c *Condition
	for i := range m.Conditions {
		if m.Conditions[i].Type == ctype {
			c = &m.Conditions[i]
		}
	}
	if c == nil {
		m.addCondition(ctype, status, reason, message)
	} else {
		if c.Status == status && c.Reason == reason && c.Message == message {
			return
		}
		now := metav1.Now()
		c.LastUpdateTime = now
		if c.Status != status {
			c.LastTransitionTime = now
		}
		c.Status = status
		c.Reason = reason
		c.Message = message
	}
}
func (m *Meta) RemoveCondition(ctype ConditionType) {
	for i, c := range m.Conditions {
		if c.Type == ctype {
			m.Conditions[i] = m.Conditions[len(m.Conditions)-1]
			m.Conditions = m.Conditions[:len(m.Conditions)-1]
			break
		}
	}
}
func (m *Meta) GetCondition(ctype ConditionType) *Condition {
	for i := range m.Conditions {
		if m.Conditions[i].Type == ctype {
			return &m.Conditions[i]
		}
	}
	return nil
}
func (m *Meta) IsConditionTrue(ctype ConditionType) bool {
	if c := m.GetCondition(ctype); c != nil {
		return c.Status == corev1.ConditionTrue
	}
	return false
}
func (m *Meta) IsReady() bool { return m.IsConditionTrue(Ready) }
func (m *Meta) IsNotReady() bool { return !m.IsConditionTrue(Ready) }
func (m *Meta) ConditionReason(ctype ConditionType) string {
	if c := m.GetCondition(ctype); c != nil {
		return c.Reason
	}
	return ""
}
func (m *Meta) Ready(reason, message string) {
	m.SetCondition(Ready, reason, message)
}
func (m *Meta) NotReady(reason, message string) {
	m.ClearCondition(Ready, reason, message)
}
func (m *Meta) SetError(reason, message string) {
	m.SetCondition(Error, reason, message)
}
func (m *Meta) ClearError() {
	m.ClearCondition(Error, "NoError", "No error seen")
}
func (m *Meta) Settled(reason, message string) {
	m.SetCondition(Settled, reason, message)
}
func (m *Meta) NotSettled(reason, message string) {
	m.ClearCondition(Settled, reason, message)
}
func (m *Meta) EnsureCondition(ctype ConditionType) {
	if c := m.GetCondition(ctype); c != nil {
		return
	}
	m.addCondition(ctype, corev1.ConditionUnknown, ReasonInit, "Not Observed")
}
func (m *Meta) EnsureStandardConditions() {
	m.EnsureCondition(Ready)
	m.EnsureCondition(Settled)
	m.EnsureCondition(Error)
}
func (m *Meta) ClearCondition(ctype ConditionType, reason, message string) {
	m.setConditionValue(ctype, corev1.ConditionFalse, reason, message)
}