INNER CODE UNIT · Go
isPresentAndTrueDeprecatedV1Beta1
syself/cluster-api-provider-hetzner · controllers/controllers_suite_test.go:424
func isPresentAndTrueDeprecatedV1Beta1(key types.NamespacedName, obj client.Object, condition clusterv1.ConditionType) bool {
if err := testEnv.Get(ctx, key, obj); err != nil {
return false
}
getter, ok := obj.(deprecatedv1beta1conditions.Getter)
if !ok {
return false
}
c := deprecatedv1beta1conditions.Get(getter, condition)
return c != nil && c.Status == corev1.ConditionTrue
}
// isConditionWithStatusAndReason reads a condition from the object's status.conditions.
func isConditionWithStatusAndReason(key types.NamespacedName, getter client.Object, condition string, status metav1.ConditionStatus, reason string) bool {
if err := testEnv.Get(ctx, key, getter); err != nil {
return false
}