mirror of https://github.com/kubernetes/kops.git
Merge pull request #13483 from olemarkus/remove-yamlv2
Remove explicit dependency on yamlv2
This commit is contained in:
commit
24437366e6
2
go.mod
2
go.mod
|
|
@ -83,7 +83,6 @@ require (
|
||||||
gopkg.in/gcfg.v1 v1.2.3
|
gopkg.in/gcfg.v1 v1.2.3
|
||||||
gopkg.in/inf.v0 v0.9.1
|
gopkg.in/inf.v0 v0.9.1
|
||||||
gopkg.in/square/go-jose.v2 v2.5.1
|
gopkg.in/square/go-jose.v2 v2.5.1
|
||||||
gopkg.in/yaml.v2 v2.4.0
|
|
||||||
helm.sh/helm/v3 v3.8.1
|
helm.sh/helm/v3 v3.8.1
|
||||||
k8s.io/api v0.23.5
|
k8s.io/api v0.23.5
|
||||||
k8s.io/apimachinery v0.23.5
|
k8s.io/apimachinery v0.23.5
|
||||||
|
|
@ -231,6 +230,7 @@ require (
|
||||||
google.golang.org/protobuf v1.27.1 // indirect
|
google.golang.org/protobuf v1.27.1 // indirect
|
||||||
gopkg.in/ini.v1 v1.66.3 // indirect
|
gopkg.in/ini.v1 v1.66.3 // indirect
|
||||||
gopkg.in/warnings.v0 v0.1.2 // indirect
|
gopkg.in/warnings.v0 v0.1.2 // indirect
|
||||||
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
|
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
|
||||||
k8s.io/apiextensions-apiserver v0.23.5 // indirect
|
k8s.io/apiextensions-apiserver v0.23.5 // indirect
|
||||||
k8s.io/cloud-provider v0.23.5 // indirect
|
k8s.io/cloud-provider v0.23.5 // indirect
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ go_library(
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
"//util/pkg/text:go_default_library",
|
"//util/pkg/text:go_default_library",
|
||||||
"//vendor/gopkg.in/yaml.v2:go_default_library",
|
|
||||||
"//vendor/k8s.io/api/core/v1:go_default_library",
|
"//vendor/k8s.io/api/core/v1:go_default_library",
|
||||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured:go_default_library",
|
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured:go_default_library",
|
||||||
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,9 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
yamlv2 "gopkg.in/yaml.v2"
|
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
"k8s.io/klog/v2"
|
"k8s.io/klog/v2"
|
||||||
|
"sigs.k8s.io/yaml"
|
||||||
)
|
)
|
||||||
|
|
||||||
// KubeObjectToApplyYAML returns the kubernetes object converted to YAML, with "noisy" fields removed.
|
// KubeObjectToApplyYAML returns the kubernetes object converted to YAML, with "noisy" fields removed.
|
||||||
|
|
@ -41,7 +41,7 @@ func KubeObjectToApplyYAML(data runtime.Object) (string, error) {
|
||||||
|
|
||||||
// Convert the JSON to a map.
|
// Convert the JSON to a map.
|
||||||
jsonObj := make(map[string]interface{})
|
jsonObj := make(map[string]interface{})
|
||||||
if err := yamlv2.Unmarshal(j, &jsonObj); err != nil {
|
if err := yaml.Unmarshal(j, &jsonObj); err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -61,7 +61,7 @@ func KubeObjectToApplyYAML(data runtime.Object) (string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Marshal the cleaned-up map into YAML.
|
// Marshal the cleaned-up map into YAML.
|
||||||
y, err := yamlv2.Marshal(jsonObj)
|
y, err := yaml.Marshal(jsonObj)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ require (
|
||||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
|
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
|
||||||
github.com/octago/sflags v0.2.0
|
github.com/octago/sflags v0.2.0
|
||||||
github.com/spf13/pflag v1.0.5
|
github.com/spf13/pflag v1.0.5
|
||||||
gopkg.in/yaml.v2 v2.4.0
|
|
||||||
k8s.io/api v0.23.5
|
k8s.io/api v0.23.5
|
||||||
k8s.io/apimachinery v0.23.5
|
k8s.io/apimachinery v0.23.5
|
||||||
k8s.io/client-go v9.0.0+incompatible
|
k8s.io/client-go v9.0.0+incompatible
|
||||||
|
|
@ -140,6 +139,7 @@ require (
|
||||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||||
gopkg.in/square/go-jose.v2 v2.5.1 // indirect
|
gopkg.in/square/go-jose.v2 v2.5.1 // indirect
|
||||||
gopkg.in/warnings.v0 v0.1.2 // indirect
|
gopkg.in/warnings.v0 v0.1.2 // indirect
|
||||||
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
|
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
|
||||||
k8s.io/klog v1.0.0 // indirect
|
k8s.io/klog v1.0.0 // indirect
|
||||||
k8s.io/release v0.7.1-0.20210204090829-09fb5e3883b8 // indirect
|
k8s.io/release v0.7.1-0.20210204090829-09fb5e3883b8 // indirect
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,9 @@ import (
|
||||||
"path"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"gopkg.in/yaml.v2"
|
|
||||||
"k8s.io/klog/v2"
|
"k8s.io/klog/v2"
|
||||||
"sigs.k8s.io/kubetest2/pkg/exec"
|
"sigs.k8s.io/kubetest2/pkg/exec"
|
||||||
|
"sigs.k8s.io/yaml"
|
||||||
)
|
)
|
||||||
|
|
||||||
// renderTemplate will render the manifest template with the provided values,
|
// renderTemplate will render the manifest template with the provided values,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue