Skip to content

Commit

Permalink
fix: use k8s yaml parser to unmarshal (#931)
Browse files Browse the repository at this point in the history
The keepalive deployment was not being parsed since it was using the
wrong yaml parser. This changes the import to use the k8s parser.
  • Loading branch information
sdowell authored Oct 10, 2023
1 parent d497c50 commit 35037bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions e2e/nomostest/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"testing"
"time"

"gopkg.in/yaml.v2"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/types"
"k8s.io/utils/pointer"
Expand All @@ -41,6 +40,7 @@ import (
"kpt.dev/configsync/pkg/testing/fake"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/kind/pkg/errors"
"sigs.k8s.io/yaml"
)

// fileMode is the file mode to use for all operations.
Expand Down Expand Up @@ -392,7 +392,6 @@ func applyAutoPilotKeepAlive(nt *NT) error {
if err := yaml.Unmarshal(yamlBytes, uObj); err != nil {
return errors.Wrapf(err, "failed to decode %q as yaml", yamlPath)
}
uObj.SetGroupVersionKind(kinds.Deployment())
// Apply with nt.KubeClient.Client directly, not nt.KubeClient.Apply
// to avoid adding the test label, to avoid deletion during cleanup
nt.Logger.Infof("applying %s", yamlPath)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ require (
golang.org/x/oauth2 v0.6.0
google.golang.org/api v0.108.0
google.golang.org/genproto v0.0.0-20230124163310-31e0e69b6fc2
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.26.7
k8s.io/apiextensions-apiserver v0.26.7
Expand Down Expand Up @@ -142,6 +141,7 @@ require (
google.golang.org/grpc v1.51.0 // indirect
google.golang.org/protobuf v1.29.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/apiserver v0.26.7 // indirect
k8s.io/component-base v0.26.7 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
Expand Down

0 comments on commit 35037bc

Please sign in to comment.