Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(server): adding more logs for provisioning #3058

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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