Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/stackvista/stackstate-cli/internal/di"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

func createTempYamlFile(t *testing.T, content string) string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/stackvista/stackstate-cli/internal/di"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

func deepNormalizeOtelComponentMapping(m *stackstate_api.OtelComponentMapping) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/otelrelationmapping/otelrelationmapping_apply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/stackvista/stackstate-cli/internal/di"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

func createTempYamlFile(t *testing.T, content string) string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/stackvista/stackstate-cli/internal/di"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

func TestOtelRelationMappingDescribe_YAMLOutput(t *testing.T) {
Expand Down
9 changes: 4 additions & 5 deletions cmd/otelrelationmapping/otelrelationmapping_edit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (
"io"
"testing"

"gopkg.in/yaml.v2"

"github.com/stackvista/stackstate-cli/cmd/otelrelationmapping"
"github.com/stackvista/stackstate-cli/generated/stackstate_api"
"github.com/stackvista/stackstate-cli/internal/di"
Expand All @@ -22,6 +20,9 @@ func (m *mockEditorStub) Edit(prefix, suffix string, contents io.Reader) ([]byte
if m.err != nil {
return nil, m.err
}
if m.content == nil {
return io.ReadAll(contents)
}
return m.content, nil
}

Expand Down Expand Up @@ -68,9 +69,7 @@ func TestOtelRelationMappingEdit_NoChange(t *testing.T) {
mockIdentifier := "urn:otel:relation:edit-unchanged"
orig := stackstate_api.OtelRelationMapping{Identifier: mockIdentifier, Name: "test-unchanged"}
cli.MockClient.ApiMocks.OtelMappingApi.GetOtelRelationMappingResponse.Result = orig
// Echo original as-is, using canonical YAML
origYAML, _ := yaml.Marshal(orig)
cli.Editor = &mockEditorStub{content: origYAML}
cli.Editor = &mockEditorStub{}

_, err := di.ExecuteCommandWithContext(&cli.Deps, cmd, "--identifier", mockIdentifier)

Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ require (
github.com/mcuadros/go-defaults v1.2.0
github.com/spf13/pflag v1.1.0
golang.org/x/text v0.44.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/kubectl v0.37.2
)

Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,6 @@ gopkg.in/evanphx/json-patch.v4 v4.13.0 h1:czT3CmqEaQ1aanPc5SdlgQrrEIb8w/wwCvWWnf
gopkg.in/evanphx/json-patch.v4 v4.13.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down