Skip to content

Commit

Permalink
remove harmful defaults set calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Taimoor Ahmad committed Jan 5, 2024
1 parent 7fa351a commit 68631c5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .changes/unreleased/Bugfix-20240105-154208.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Bugfix
body: Fix bug in Infra where unexpected data would be included in requests
time: 2024-01-05T15:42:08.827698-05:00
4 changes: 0 additions & 4 deletions src/cmd/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (

"github.com/opslevel/opslevel-go/v2023"

"github.com/creasty/defaults"
"github.com/opslevel/cli/common"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -466,8 +465,5 @@ func readCheckInput() (*CheckInputType, error) {
// Unmarshall
evt := &CheckInputType{}
viper.Unmarshal(&evt)
if err := defaults.Set(evt); err != nil {
return nil, err
}
return evt, nil
}
7 changes: 0 additions & 7 deletions src/cmd/infra.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"os"
"strings"

"github.com/creasty/defaults"
"github.com/opslevel/cli/common"
"github.com/opslevel/opslevel-go/v2023"
"github.com/rs/zerolog/log"
Expand Down Expand Up @@ -249,11 +248,5 @@ func readInfraInput() (*opslevel.InfraInput, error) {
cobra.CheckErr(err)
evt := &opslevel.InfraInput{}
cobra.CheckErr(yaml.Unmarshal(file, &evt))
log.Info().Msgf("before %s %s %+v +%v\n", evt.Schema, *evt.Owner, evt.Provider, evt.Data)
if err := defaults.Set(evt); err != nil {
return nil, err
}
log.Info().Msgf("after %s %s %+v +%v\n", evt.Schema, *evt.Owner, evt.Provider, evt.Data)
panic("bye")
return evt, nil
}

0 comments on commit 68631c5

Please sign in to comment.