1
0
mirror of synced 2026-04-01 14:19:30 +00:00

Create logger interface

This commit is contained in:
Hidde Beydals
2020-06-25 17:31:58 +02:00
parent 5499d15402
commit 329e21fd78
21 changed files with 155 additions and 121 deletions

View File

@@ -59,7 +59,7 @@ func syncSourceGitCmdRun(cmd *cobra.Command, args []string) error {
Name: name,
}
logAction("annotating source %s in %s namespace", name, namespace)
logger.Actionf("annotating source %s in %s namespace", name, namespace)
var gitRepository sourcev1.GitRepository
err = kubeClient.Get(ctx, namespacedName, &gitRepository)
if err != nil {
@@ -76,15 +76,15 @@ func syncSourceGitCmdRun(cmd *cobra.Command, args []string) error {
if err := kubeClient.Update(ctx, &gitRepository); err != nil {
return err
}
logSuccess("source annotated")
logger.Successf("source annotated")
logWaiting("waiting for git sync")
logger.Waitingf("waiting for git sync")
if err := wait.PollImmediate(pollInterval, timeout,
isGitRepositoryReady(ctx, kubeClient, name, namespace)); err != nil {
return err
}
logSuccess("git sync completed")
logger.Successf("git sync completed")
err = kubeClient.Get(ctx, namespacedName, &gitRepository)
if err != nil {
@@ -92,7 +92,7 @@ func syncSourceGitCmdRun(cmd *cobra.Command, args []string) error {
}
if gitRepository.Status.Artifact != nil {
logSuccess("fetched revision: %s", gitRepository.Status.Artifact.Revision)
logger.Successf("fetched revision %s", gitRepository.Status.Artifact.Revision)
} else {
return fmt.Errorf("git sync failed, artifact not found")
}