Skip to content

Commit

Permalink
fix: remove betterstack
Browse files Browse the repository at this point in the history
  • Loading branch information
nravic committed Mar 14, 2024
1 parent 19b0262 commit b898e69
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
10 changes: 8 additions & 2 deletions cmd/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ var bootstrapCmd = &cobra.Command{
return fmt.Errorf("no auth token detected, please login first with cedana-cli login")
}

if r.cfg.MarketServiceUrl == "" {
return fmt.Errorf("market service URL not set in config")
}

if r.cfg.EnabledProviders == nil || len(r.cfg.EnabledProviders) == 0 {
return fmt.Errorf("no providers specified in config, add provider-specific config and enabled providers, regions and try again.")
}
Expand Down Expand Up @@ -305,7 +309,7 @@ func (r *Runner) setCredentialsAWS() error {

defer resp.Body.Close()

body, err := io.ReadAll(resp.Body)
_, err = io.ReadAll(resp.Body)
if err != nil {
return err
}
Expand All @@ -314,7 +318,9 @@ func (r *Runner) setCredentialsAWS() error {
return fmt.Errorf("request failed with status code: %d", resp.StatusCode)
}

r.logger.Info().Msgf("AWS credentials set with response %s", string(body))
r.logger.Info().Msgf("aws credentials set")

r.logger.Info().Msg("setting ssh key")

return nil
}
Expand Down
8 changes: 4 additions & 4 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
cedana "github.com/cedana/cedana-cli/types"
)

var jobFile string
var id string

type Runner struct {
ctx context.Context
Expand Down Expand Up @@ -57,11 +57,11 @@ var setupTaskCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
r := BuildRunner()

if jobFile == "" {
if id == "" {
r.logger.Fatal().Msg("job file not specified")
}

file, err := os.Open(jobFile)
file, err := os.Open(args[0])
if err != nil {
r.logger.Fatal().Err(err).Msg("could not open job file")
}
Expand Down Expand Up @@ -245,5 +245,5 @@ func init() {
RootCmd.AddCommand(listTasksCmd)
RootCmd.AddCommand(runTaskCmd)

setupTaskCmd.Flags().StringVarP(&jobFile, "job", "j", "", "job file")
setupTaskCmd.Flags().StringVarP(&id, "id", "i", "", "id for task")
}

0 comments on commit b898e69

Please sign in to comment.