func (status *Status) filterOutCondition(condType ConditionType) []Condition {
	var newConditions []Condition
	for _, c := range status.Conditions {
		if c.Type == condType {
			continue
		}
		newConditions = append(newConditions, c)
	}
	return newConditions
}
filterOutCondition returns a new slice of conditions without conditions with the provided type.
package v1alpha1
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
type ConditionType string
const (
	ConditionReady ConditionType = "Ready"
)
type ConditionStatus string
const (
	ConditionTrue ConditionStatus = "True"
	ConditionFalse ConditionStatus = "False"
	ConditionUnknown ConditionStatus = "Unknown"
)
type Condition struct {
	Type ConditionType `json:"type"`
	Status ConditionStatus `json:"status"`
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
	Reason string `json:"reason,omitempty"`
	Message string `json:"message,omitempty"`
}
func NewCondition(condType ConditionType, status ConditionStatus, reason, msg string) Condition {
	return Condition{
		Type:               condType,
		Status:             status,
		LastTransitionTime: metav1.Now(),
		Reason:             reason,
		Message:            msg,
	}
}
type Status struct {
	Conditions []Condition `json:"conditions,omitempty"`
}
func (status *Status) GetCondition(condType ConditionType) *Condition {
	for _, c := range status.Conditions {
		if c.Type == condType {
			return &c
		}
	}
	return nil
}
func (status *Status) SetCondition(condition *Condition) {
	currentCond := status.GetCondition(condition.Type)
	if currentCond != nil && currentCond.Status == condition.Status && currentCond.Reason == condition.Reason {
		return
	}
	status.Conditions = append(status.filterOutCondition(condition.Type), *condition)
}
func (status *Status) RemoveCondition(condType ConditionType) {
	status.Conditions = status.filterOutCondition(condType)
}