Make use of GetCondition from pkg/apis/meta
This commit is contained in:
@@ -275,13 +275,12 @@ func isHelmChartReady(ctx context.Context, kubeClient client.Client, name, names
|
||||
return false, err
|
||||
}
|
||||
|
||||
for _, condition := range helmChart.Status.Conditions {
|
||||
if condition.Type == meta.ReadyCondition {
|
||||
if condition.Status == corev1.ConditionTrue {
|
||||
return true, nil
|
||||
} else if condition.Status == corev1.ConditionFalse {
|
||||
return false, fmt.Errorf(condition.Message)
|
||||
}
|
||||
if c := meta.GetCondition(helmChart.Status.Conditions, meta.ReadyCondition); c != nil {
|
||||
switch c.Status {
|
||||
case corev1.ConditionTrue:
|
||||
return true, nil
|
||||
case corev1.ConditionFalse:
|
||||
return false, fmt.Errorf(c.Message)
|
||||
}
|
||||
}
|
||||
return false, nil
|
||||
|
||||
Reference in New Issue
Block a user