Skip to content

Commit

Permalink
chore(server): adding more logs for provisioning (#3058)
Browse files Browse the repository at this point in the history
Adding logs for provisioning
  • Loading branch information
danielbdias authored Aug 14, 2023
1 parent 4c5741d commit 7d508ad
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions server/provisioning/provisioning.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"errors"
"fmt"
"io"
"log"
"os"

"github.com/goccy/go-yaml"
Expand Down Expand Up @@ -85,7 +86,7 @@ func (p Provisioner) do(data []byte) error {
}

if err != nil {
return fmt.Errorf("cannot unmarshal yaml: %w", err)
return fmt.Errorf("cannot unmarshal yaml for provisioning file: %w", err)
}

if rawYaml == nil {
Expand All @@ -99,13 +100,14 @@ func (p Provisioner) do(data []byte) error {
continue
}
if err != nil {
return fmt.Errorf("cannot provision resource from yaml: %w", err)
return fmt.Errorf("cannot provision resource from yaml for provisioner %T: %w", p, err)
}
log.Printf("[provisioning] provisioner %T executed with success", p)
success = true
}

if !success {
return fmt.Errorf("invalid resource type from yaml")
return fmt.Errorf("all resource types from provisioning yaml don't support provisioning")
}
}
return nil
Expand Down

0 comments on commit 7d508ad

Please sign in to comment.