mirror of
https://github.com/fluxcd/flux2.git
synced 2025-11-01 18:26:25 +08:00
Log source sync failure message
This commit is contained in:
@ -150,7 +150,7 @@ func createSourceCmdRun(cmd *cobra.Command, args []string) error {
|
|||||||
logAction("waiting for source sync")
|
logAction("waiting for source sync")
|
||||||
if err := wait.PollImmediate(2*time.Second, timeout,
|
if err := wait.PollImmediate(2*time.Second, timeout,
|
||||||
isGitRepositoryReady(ctx, kubeClient, name, namespace)); err != nil {
|
isGitRepositoryReady(ctx, kubeClient, name, namespace)); err != nil {
|
||||||
return fmt.Errorf("source sync failed: %w", err)
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
logSuccess("source %s is ready", name)
|
logSuccess("source %s is ready", name)
|
||||||
@ -240,7 +240,7 @@ func isGitRepositoryReady(ctx context.Context, kubeClient client.Client, name, n
|
|||||||
if condition.Status == corev1.ConditionTrue {
|
if condition.Status == corev1.ConditionTrue {
|
||||||
return true, nil
|
return true, nil
|
||||||
} else if condition.Status == corev1.ConditionFalse {
|
} else if condition.Status == corev1.ConditionFalse {
|
||||||
return false, nil
|
return false, fmt.Errorf(condition.Message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user