Skip to content

Commit

Permalink
Fixing Yaml unmarshll (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdesouza authored Aug 26, 2024
1 parent 3e74239 commit 035268b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/teams/teams.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/imroc/req"
"github.com/sirupsen/logrus"
"gopkg.in/yaml.v2"
"sigs.k8s.io/yaml"

cliversion "github.com/fairwindsops/insights-cli/pkg/version"
)
Expand Down Expand Up @@ -75,7 +75,11 @@ func PushTeams(pushDir, org, insightsToken, host string, deleteNonProvidedTeams,
}
defer teamsFile.Close()
teams := []TeamInput{}
err = yaml.NewDecoder(teamsFile).Decode(&teams)
b, err := os.ReadFile(teamsFileName)
if err != nil {
return err
}
err = yaml.Unmarshal(b, &teams)
if err != nil {
return err
}
Expand Down

0 comments on commit 035268b

Please sign in to comment.