From 43f523d405b012fa8d90dd95b667f520e036f6bc Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Fri, 2 Nov 2018 16:41:57 -0400 Subject: [PATCH] Switch to sigs.k8s.io/yaml from ghodss/yaml Change-Id: Ic72b5131bf441d159012d67a6a3d87088d0e6d31 --- Godeps/Godeps.json | 5 + Godeps/LICENSES | 58 ++ cmd/kubeadm/app/cmd/BUILD | 4 +- cmd/kubeadm/app/cmd/version.go | 2 +- cmd/kubeadm/app/cmd/version_test.go | 2 +- cmd/kubeadm/app/util/BUILD | 2 +- cmd/kubeadm/app/util/marshal.go | 2 +- cmd/kubeadm/test/cmd/BUILD | 2 +- cmd/kubeadm/test/cmd/version_test.go | 2 +- pkg/cloudprovider/providers/azure/BUILD | 2 +- pkg/cloudprovider/providers/azure/azure.go | 2 +- pkg/credentialprovider/azure/BUILD | 2 +- .../azure/azure_credentials.go | 2 +- pkg/kubectl/apply/strategy/BUILD | 2 +- pkg/kubectl/apply/strategy/utils_test.go | 2 +- pkg/kubectl/cmd/apply/BUILD | 2 +- .../cmd/apply/apply_view_last_applied.go | 2 +- pkg/kubectl/cmd/diff/BUILD | 2 +- pkg/kubectl/cmd/diff/diff.go | 2 +- pkg/kubectl/cmd/version/BUILD | 2 +- pkg/kubectl/cmd/version/version.go | 2 +- pkg/printers/internalversion/BUILD | 2 +- pkg/printers/internalversion/printers_test.go | 2 +- .../authorizer/rbac/bootstrappolicy/BUILD | 2 +- .../rbac/bootstrappolicy/policy_test.go | 2 +- staging/src/k8s.io/api/Godeps/Godeps.json | 8 +- .../Godeps/Godeps.json | 4 + .../test/integration/BUILD | 2 +- .../test/integration/yaml_test.go | 2 +- .../k8s.io/apimachinery/Godeps/Godeps.json | 8 +- .../apimachinery/pkg/apis/meta/v1/BUILD | 2 +- .../pkg/apis/meta/v1/duration_test.go | 2 +- .../pkg/apis/meta/v1/micro_time_test.go | 2 +- .../pkg/apis/meta/v1/time_test.go | 2 +- .../apimachinery/pkg/runtime/serializer/BUILD | 2 +- .../pkg/runtime/serializer/codec_test.go | 2 +- .../pkg/runtime/serializer/json/BUILD | 2 +- .../pkg/runtime/serializer/json/json.go | 2 +- .../k8s.io/apimachinery/pkg/util/intstr/BUILD | 2 +- .../pkg/util/intstr/intstr_test.go | 2 +- .../pkg/util/jsonmergepatch/BUILD | 2 +- .../pkg/util/jsonmergepatch/patch_test.go | 2 +- .../apimachinery/pkg/util/mergepatch/BUILD | 2 +- .../apimachinery/pkg/util/mergepatch/util.go | 2 +- .../pkg/util/strategicpatch/BUILD | 2 +- .../pkg/util/strategicpatch/patch_test.go | 2 +- .../k8s.io/apimachinery/pkg/util/yaml/BUILD | 2 +- .../apimachinery/pkg/util/yaml/decoder.go | 2 +- .../src/k8s.io/apiserver/Godeps/Godeps.json | 4 + .../src/k8s.io/apiserver/pkg/admission/BUILD | 2 +- .../k8s.io/apiserver/pkg/admission/config.go | 2 +- .../pkg/server/options/encryptionconfig/BUILD | 2 +- .../server/options/encryptionconfig/config.go | 2 +- .../src/k8s.io/cli-runtime/Godeps/Godeps.json | 8 +- .../pkg/genericclioptions/printers/BUILD | 2 +- .../pkg/genericclioptions/printers/json.go | 2 +- .../pkg/genericclioptions/resource/BUILD | 2 +- .../resource/builder_test.go | 2 +- .../src/k8s.io/client-go/Godeps/Godeps.json | 8 +- .../k8s.io/client-go/tools/clientcmd/BUILD | 2 +- .../client-go/tools/clientcmd/api/BUILD | 2 +- .../tools/clientcmd/api/helpers_test.go | 2 +- .../tools/clientcmd/api/types_test.go | 2 +- .../client-go/tools/clientcmd/loader_test.go | 2 +- .../k8s.io/cloud-provider/Godeps/Godeps.json | 8 +- staging/src/k8s.io/csi-api/Godeps/Godeps.json | 8 +- .../k8s.io/kube-aggregator/Godeps/Godeps.json | 8 +- staging/src/k8s.io/metrics/Godeps/Godeps.json | 8 +- .../sample-apiserver/Godeps/Godeps.json | 8 +- .../sample-cli-plugin/Godeps/Godeps.json | 8 +- .../sample-controller/Godeps/Godeps.json | 8 +- test/e2e/kubectl/BUILD | 2 +- test/e2e/kubectl/kubectl.go | 2 +- test/e2e/storage/BUILD | 2 +- test/e2e/storage/persistent_volumes-local.go | 2 +- test/e2e_node/runner/remote/BUILD | 2 +- test/e2e_node/runner/remote/run_remote.go | 2 +- test/integration/master/BUILD | 4 +- .../master/synthetic_master_test.go | 2 +- .../master/transformation_testcase.go | 2 +- vendor/BUILD | 2 +- .../compute/mgmt/2018-04-01/compute/BUILD | 13 - vendor/sigs.k8s.io/yaml/.gitignore | 20 + vendor/sigs.k8s.io/yaml/.travis.yml | 14 + vendor/sigs.k8s.io/yaml/BUILD | 28 + vendor/sigs.k8s.io/yaml/CONTRIBUTING.md | 31 ++ vendor/sigs.k8s.io/yaml/LICENSE | 50 ++ vendor/sigs.k8s.io/yaml/OWNERS | 25 + vendor/sigs.k8s.io/yaml/README.md | 121 +++++ vendor/sigs.k8s.io/yaml/RELEASE.md | 9 + vendor/sigs.k8s.io/yaml/SECURITY_CONTACTS | 17 + vendor/sigs.k8s.io/yaml/code-of-conduct.md | 3 + vendor/sigs.k8s.io/yaml/fields.go | 502 ++++++++++++++++++ vendor/sigs.k8s.io/yaml/yaml.go | 319 +++++++++++ vendor/sigs.k8s.io/yaml/yaml_go110.go | 14 + 95 files changed, 1336 insertions(+), 125 deletions(-) delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/BUILD create mode 100644 vendor/sigs.k8s.io/yaml/.gitignore create mode 100644 vendor/sigs.k8s.io/yaml/.travis.yml create mode 100644 vendor/sigs.k8s.io/yaml/BUILD create mode 100644 vendor/sigs.k8s.io/yaml/CONTRIBUTING.md create mode 100644 vendor/sigs.k8s.io/yaml/LICENSE create mode 100644 vendor/sigs.k8s.io/yaml/OWNERS create mode 100644 vendor/sigs.k8s.io/yaml/README.md create mode 100644 vendor/sigs.k8s.io/yaml/RELEASE.md create mode 100644 vendor/sigs.k8s.io/yaml/SECURITY_CONTACTS create mode 100644 vendor/sigs.k8s.io/yaml/code-of-conduct.md create mode 100644 vendor/sigs.k8s.io/yaml/fields.go create mode 100644 vendor/sigs.k8s.io/yaml/yaml.go create mode 100644 vendor/sigs.k8s.io/yaml/yaml_go110.go diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 1f9068a839..370232ebd9 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -4008,6 +4008,11 @@ "ImportPath": "k8s.io/utils/pointer", "Rev": "66066c83e385e385ccc3c964b44fd7dcd413d0ed" }, + { + "ImportPath": "sigs.k8s.io/yaml", + "Comment": "v1.1.0", + "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" + }, { "ImportPath": "vbom.ml/util/sortorder", "Rev": "db5cfe13f5cc80a4990d98e2e1b0707a4d1a5394" diff --git a/Godeps/LICENSES b/Godeps/LICENSES index 6325125279..a3ba2e298a 100644 --- a/Godeps/LICENSES +++ b/Godeps/LICENSES @@ -112652,6 +112652,64 @@ Apache License ================================================================================ +================================================================================ += vendor/sigs.k8s.io/yaml licensed under: = + +The MIT License (MIT) + +Copyright (c) 2014 Sam Ghods + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +Copyright (c) 2012 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + += vendor/sigs.k8s.io/yaml/LICENSE 0ceb9ff3b27d3a8cf451ca3785d73c71 +================================================================================ + + ================================================================================ = vendor/vbom.ml/util/sortorder licensed under: = diff --git a/cmd/kubeadm/app/cmd/BUILD b/cmd/kubeadm/app/cmd/BUILD index 7d881c39d4..9f13e3af98 100644 --- a/cmd/kubeadm/app/cmd/BUILD +++ b/cmd/kubeadm/app/cmd/BUILD @@ -69,13 +69,13 @@ go_library( "//staging/src/k8s.io/client-go/util/cert:go_default_library", "//staging/src/k8s.io/cluster-bootstrap/token/api:go_default_library", "//staging/src/k8s.io/cluster-bootstrap/token/util:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/pkg/errors:go_default_library", "//vendor/github.com/renstrom/dedent:go_default_library", "//vendor/github.com/spf13/cobra:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", "//vendor/k8s.io/utils/exec:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) @@ -110,12 +110,12 @@ go_test( "//staging/src/k8s.io/client-go/kubernetes/fake:go_default_library", "//staging/src/k8s.io/client-go/testing:go_default_library", "//staging/src/k8s.io/client-go/tools/clientcmd:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/pkg/errors:go_default_library", "//vendor/github.com/renstrom/dedent:go_default_library", "//vendor/github.com/spf13/cobra:go_default_library", "//vendor/k8s.io/utils/exec:go_default_library", "//vendor/k8s.io/utils/exec/testing:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/cmd/kubeadm/app/cmd/version.go b/cmd/kubeadm/app/cmd/version.go index eb0628c6f1..1adb534af1 100644 --- a/cmd/kubeadm/app/cmd/version.go +++ b/cmd/kubeadm/app/cmd/version.go @@ -21,10 +21,10 @@ import ( "fmt" "io" - "github.com/ghodss/yaml" "github.com/golang/glog" "github.com/pkg/errors" "github.com/spf13/cobra" + "sigs.k8s.io/yaml" apimachineryversion "k8s.io/apimachinery/pkg/version" kubeadmutil "k8s.io/kubernetes/cmd/kubeadm/app/util" diff --git a/cmd/kubeadm/app/cmd/version_test.go b/cmd/kubeadm/app/cmd/version_test.go index e22036b7f8..b72977e580 100644 --- a/cmd/kubeadm/app/cmd/version_test.go +++ b/cmd/kubeadm/app/cmd/version_test.go @@ -19,8 +19,8 @@ package cmd import ( "bytes" "encoding/json" - "github.com/ghodss/yaml" "github.com/pkg/errors" + "sigs.k8s.io/yaml" "testing" ) diff --git a/cmd/kubeadm/app/util/BUILD b/cmd/kubeadm/app/util/BUILD index 80aa1a8081..0e4d79acd7 100644 --- a/cmd/kubeadm/app/util/BUILD +++ b/cmd/kubeadm/app/util/BUILD @@ -34,10 +34,10 @@ go_library( "//staging/src/k8s.io/apimachinery/pkg/util/version:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/yaml:go_default_library", "//staging/src/k8s.io/client-go/kubernetes/scheme:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/pkg/errors:go_default_library", "//vendor/k8s.io/utils/exec:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/cmd/kubeadm/app/util/marshal.go b/cmd/kubeadm/app/util/marshal.go index 950855f945..d38dce75f2 100644 --- a/cmd/kubeadm/app/util/marshal.go +++ b/cmd/kubeadm/app/util/marshal.go @@ -21,8 +21,8 @@ import ( "bytes" "io" - "github.com/ghodss/yaml" pkgerrors "github.com/pkg/errors" + "sigs.k8s.io/yaml" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/cmd/kubeadm/test/cmd/BUILD b/cmd/kubeadm/test/cmd/BUILD index 94771cffe0..1e2a09a8c9 100644 --- a/cmd/kubeadm/test/cmd/BUILD +++ b/cmd/kubeadm/test/cmd/BUILD @@ -33,8 +33,8 @@ go_test( "skip", ], deps = [ - "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/renstrom/dedent:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/cmd/kubeadm/test/cmd/version_test.go b/cmd/kubeadm/test/cmd/version_test.go index 85fb117061..345c0edabf 100644 --- a/cmd/kubeadm/test/cmd/version_test.go +++ b/cmd/kubeadm/test/cmd/version_test.go @@ -21,7 +21,7 @@ import ( "regexp" "testing" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" ) const ( diff --git a/pkg/cloudprovider/providers/azure/BUILD b/pkg/cloudprovider/providers/azure/BUILD index 1ead263abd..d49de26e7f 100644 --- a/pkg/cloudprovider/providers/azure/BUILD +++ b/pkg/cloudprovider/providers/azure/BUILD @@ -66,10 +66,10 @@ go_library( "//vendor/github.com/Azure/go-autorest/autorest/adal:go_default_library", "//vendor/github.com/Azure/go-autorest/autorest/azure:go_default_library", "//vendor/github.com/Azure/go-autorest/autorest/to:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/prometheus/client_golang/prometheus:go_default_library", "//vendor/github.com/rubiojr/go-vhd/vhd:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/pkg/cloudprovider/providers/azure/azure.go b/pkg/cloudprovider/providers/azure/azure.go index 01e0759379..c61117929d 100644 --- a/pkg/cloudprovider/providers/azure/azure.go +++ b/pkg/cloudprovider/providers/azure/azure.go @@ -41,8 +41,8 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" - "github.com/ghodss/yaml" "github.com/golang/glog" + "sigs.k8s.io/yaml" ) const ( diff --git a/pkg/credentialprovider/azure/BUILD b/pkg/credentialprovider/azure/BUILD index 5d1c3800d7..1bd18ed5a2 100644 --- a/pkg/credentialprovider/azure/BUILD +++ b/pkg/credentialprovider/azure/BUILD @@ -21,9 +21,9 @@ go_library( "//vendor/github.com/Azure/go-autorest/autorest/adal:go_default_library", "//vendor/github.com/Azure/go-autorest/autorest/azure:go_default_library", "//vendor/github.com/dgrijalva/jwt-go:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/pkg/credentialprovider/azure/azure_credentials.go b/pkg/credentialprovider/azure/azure_credentials.go index ffeab5ea5a..1a50bea9a5 100644 --- a/pkg/credentialprovider/azure/azure_credentials.go +++ b/pkg/credentialprovider/azure/azure_credentials.go @@ -27,9 +27,9 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/adal" "github.com/Azure/go-autorest/autorest/azure" - "github.com/ghodss/yaml" "github.com/golang/glog" "github.com/spf13/pflag" + "sigs.k8s.io/yaml" "k8s.io/kubernetes/pkg/cloudprovider/providers/azure/auth" "k8s.io/kubernetes/pkg/credentialprovider" diff --git a/pkg/kubectl/apply/strategy/BUILD b/pkg/kubectl/apply/strategy/BUILD index 34bb23eccb..6243b3a20d 100644 --- a/pkg/kubectl/apply/strategy/BUILD +++ b/pkg/kubectl/apply/strategy/BUILD @@ -41,11 +41,11 @@ go_test( "//pkg/kubectl/cmd/util/openapi:go_default_library", "//pkg/kubectl/cmd/util/openapi/testing:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/diff:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/ginkgo/config:go_default_library", "//vendor/github.com/onsi/ginkgo/types:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/pkg/kubectl/apply/strategy/utils_test.go b/pkg/kubectl/apply/strategy/utils_test.go index 9a958b78fd..437da605bd 100644 --- a/pkg/kubectl/apply/strategy/utils_test.go +++ b/pkg/kubectl/apply/strategy/utils_test.go @@ -23,7 +23,7 @@ import ( "path/filepath" "strings" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" "k8s.io/apimachinery/pkg/util/diff" "k8s.io/kubernetes/pkg/kubectl/apply" diff --git a/pkg/kubectl/cmd/apply/BUILD b/pkg/kubectl/cmd/apply/BUILD index 4a6ca665a8..edde8b09e5 100644 --- a/pkg/kubectl/cmd/apply/BUILD +++ b/pkg/kubectl/cmd/apply/BUILD @@ -38,11 +38,11 @@ go_library( "//staging/src/k8s.io/cli-runtime/pkg/genericclioptions/resource:go_default_library", "//staging/src/k8s.io/client-go/discovery:go_default_library", "//staging/src/k8s.io/client-go/dynamic:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/jonboulle/clockwork:go_default_library", "//vendor/github.com/spf13/cobra:go_default_library", "//vendor/k8s.io/kube-openapi/pkg/util/proto:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/pkg/kubectl/cmd/apply/apply_view_last_applied.go b/pkg/kubectl/cmd/apply/apply_view_last_applied.go index ce4a7ff5f2..e35b0c434c 100644 --- a/pkg/kubectl/cmd/apply/apply_view_last_applied.go +++ b/pkg/kubectl/cmd/apply/apply_view_last_applied.go @@ -21,7 +21,6 @@ import ( "encoding/json" "fmt" - "github.com/ghodss/yaml" "github.com/spf13/cobra" "k8s.io/cli-runtime/pkg/genericclioptions" "k8s.io/cli-runtime/pkg/genericclioptions/resource" @@ -29,6 +28,7 @@ import ( cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" "k8s.io/kubernetes/pkg/kubectl/util/i18n" "k8s.io/kubernetes/pkg/kubectl/util/templates" + "sigs.k8s.io/yaml" ) type ViewLastAppliedOptions struct { diff --git a/pkg/kubectl/cmd/diff/BUILD b/pkg/kubectl/cmd/diff/BUILD index a1eaca378c..4a99f16125 100644 --- a/pkg/kubectl/cmd/diff/BUILD +++ b/pkg/kubectl/cmd/diff/BUILD @@ -19,10 +19,10 @@ go_library( "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/cli-runtime/pkg/genericclioptions:go_default_library", "//staging/src/k8s.io/cli-runtime/pkg/genericclioptions/resource:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/jonboulle/clockwork:go_default_library", "//vendor/github.com/spf13/cobra:go_default_library", "//vendor/k8s.io/utils/exec:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/pkg/kubectl/cmd/diff/diff.go b/pkg/kubectl/cmd/diff/diff.go index 076439d264..9c52dbfb6b 100644 --- a/pkg/kubectl/cmd/diff/diff.go +++ b/pkg/kubectl/cmd/diff/diff.go @@ -23,7 +23,6 @@ import ( "os" "path/filepath" - "github.com/ghodss/yaml" "github.com/jonboulle/clockwork" "github.com/spf13/cobra" "k8s.io/apimachinery/pkg/api/errors" @@ -40,6 +39,7 @@ import ( "k8s.io/kubernetes/pkg/kubectl/util/i18n" "k8s.io/kubernetes/pkg/kubectl/util/templates" "k8s.io/utils/exec" + "sigs.k8s.io/yaml" ) var ( diff --git a/pkg/kubectl/cmd/version/BUILD b/pkg/kubectl/cmd/version/BUILD index 4f701db553..514bc70514 100644 --- a/pkg/kubectl/cmd/version/BUILD +++ b/pkg/kubectl/cmd/version/BUILD @@ -14,8 +14,8 @@ go_library( "//staging/src/k8s.io/cli-runtime/pkg/genericclioptions:go_default_library", "//staging/src/k8s.io/client-go/discovery:go_default_library", "//staging/src/k8s.io/client-go/tools/clientcmd:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/spf13/cobra:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/pkg/kubectl/cmd/version/version.go b/pkg/kubectl/cmd/version/version.go index e0e1c42f9e..1d249e213d 100644 --- a/pkg/kubectl/cmd/version/version.go +++ b/pkg/kubectl/cmd/version/version.go @@ -21,8 +21,8 @@ import ( "errors" "fmt" - "github.com/ghodss/yaml" "github.com/spf13/cobra" + "sigs.k8s.io/yaml" apimachineryversion "k8s.io/apimachinery/pkg/version" "k8s.io/cli-runtime/pkg/genericclioptions" diff --git a/pkg/printers/internalversion/BUILD b/pkg/printers/internalversion/BUILD index 8f04a12db0..e25a7d5f22 100644 --- a/pkg/printers/internalversion/BUILD +++ b/pkg/printers/internalversion/BUILD @@ -46,8 +46,8 @@ go_test( "//staging/src/k8s.io/cli-runtime/pkg/genericclioptions:go_default_library", "//staging/src/k8s.io/cli-runtime/pkg/genericclioptions/printers:go_default_library", "//staging/src/k8s.io/client-go/kubernetes/fake:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/k8s.io/utils/pointer:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/pkg/printers/internalversion/printers_test.go b/pkg/printers/internalversion/printers_test.go index 01afac8198..aea33a651a 100644 --- a/pkg/printers/internalversion/printers_test.go +++ b/pkg/printers/internalversion/printers_test.go @@ -28,7 +28,7 @@ import ( "testing" "time" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" diff --git a/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/BUILD b/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/BUILD index 2a83c5c933..55e9cd22af 100644 --- a/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/BUILD +++ b/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/BUILD @@ -48,7 +48,7 @@ go_test( "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/diff:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/policy_test.go b/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/policy_test.go index 20ba3b3c0b..4f1a48b945 100644 --- a/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/policy_test.go +++ b/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/policy_test.go @@ -23,7 +23,7 @@ import ( "reflect" "testing" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" diff --git a/staging/src/k8s.io/api/Godeps/Godeps.json b/staging/src/k8s.io/api/Godeps/Godeps.json index a0dad5a5ee..244eb192f8 100644 --- a/staging/src/k8s.io/api/Godeps/Godeps.json +++ b/staging/src/k8s.io/api/Godeps/Godeps.json @@ -10,10 +10,6 @@ "ImportPath": "github.com/davecgh/go-spew/spew", "Rev": "782f4967f2dc4564575ca782fe2d04090b5faca8" }, - { - "ImportPath": "github.com/ghodss/yaml", - "Rev": "c7ce16629ff4cd059ed96ed06419dd3856fd3577" - }, { "ImportPath": "github.com/gogo/protobuf/proto", "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" @@ -285,6 +281,10 @@ { "ImportPath": "k8s.io/apimachinery/pkg/util/intstr", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "sigs.k8s.io/yaml", + "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" } ] } diff --git a/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json b/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json index a4ff551576..e444edd11c 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json +++ b/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json @@ -2505,6 +2505,10 @@ { "ImportPath": "k8s.io/client-go/util/workqueue", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "sigs.k8s.io/yaml", + "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" } ] } diff --git a/staging/src/k8s.io/apiextensions-apiserver/test/integration/BUILD b/staging/src/k8s.io/apiextensions-apiserver/test/integration/BUILD index 4ac71b28db..ffd8d332c6 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/test/integration/BUILD +++ b/staging/src/k8s.io/apiextensions-apiserver/test/integration/BUILD @@ -44,9 +44,9 @@ go_test( "//staging/src/k8s.io/client-go/rest:go_default_library", "//vendor/github.com/coreos/etcd/clientv3:go_default_library", "//vendor/github.com/coreos/etcd/pkg/transport:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/stretchr/testify/assert:go_default_library", "//vendor/github.com/stretchr/testify/require:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/staging/src/k8s.io/apiextensions-apiserver/test/integration/yaml_test.go b/staging/src/k8s.io/apiextensions-apiserver/test/integration/yaml_test.go index 45e5176b00..e7c2755c96 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/test/integration/yaml_test.go +++ b/staging/src/k8s.io/apiextensions-apiserver/test/integration/yaml_test.go @@ -22,7 +22,7 @@ import ( "net/http" "testing" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" diff --git a/staging/src/k8s.io/apimachinery/Godeps/Godeps.json b/staging/src/k8s.io/apimachinery/Godeps/Godeps.json index bbb5a8a338..4bec1aa800 100644 --- a/staging/src/k8s.io/apimachinery/Godeps/Godeps.json +++ b/staging/src/k8s.io/apimachinery/Godeps/Godeps.json @@ -26,10 +26,6 @@ "ImportPath": "github.com/evanphx/json-patch", "Rev": "36442dbdb585210f8d5a1b45e67aa323c197d5c4" }, - { - "ImportPath": "github.com/ghodss/yaml", - "Rev": "c7ce16629ff4cd059ed96ed06419dd3856fd3577" - }, { "ImportPath": "github.com/gogo/protobuf/proto", "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" @@ -181,6 +177,10 @@ { "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", "Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" + }, + { + "ImportPath": "sigs.k8s.io/yaml", + "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" } ] } diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/BUILD b/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/BUILD index 8b02313678..267bccc4aa 100644 --- a/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/BUILD +++ b/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/BUILD @@ -25,7 +25,7 @@ go_test( "//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/serializer/json:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/duration_test.go b/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/duration_test.go index 7230cb28ab..34ca6b5ded 100644 --- a/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/duration_test.go +++ b/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/duration_test.go @@ -21,7 +21,7 @@ import ( "testing" "time" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" ) type DurationHolder struct { diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time_test.go b/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time_test.go index 985aa70b0d..b08e3f236c 100644 --- a/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time_test.go +++ b/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time_test.go @@ -22,7 +22,7 @@ import ( "testing" "time" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" ) type MicroTimeHolder struct { diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/time_test.go b/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/time_test.go index 0bf6c36051..7ade16f619 100644 --- a/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/time_test.go +++ b/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/time_test.go @@ -22,7 +22,7 @@ import ( "testing" "time" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" ) type TimeHolder struct { diff --git a/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/BUILD b/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/BUILD index 05764c34b7..e323052f4d 100644 --- a/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/BUILD +++ b/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/BUILD @@ -21,9 +21,9 @@ go_test( "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/serializer/testing:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/diff:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/google/gofuzz:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/codec_test.go b/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/codec_test.go index d27da113a9..90a2962bf6 100644 --- a/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/codec_test.go +++ b/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/codec_test.go @@ -32,9 +32,9 @@ import ( serializertesting "k8s.io/apimachinery/pkg/runtime/serializer/testing" "k8s.io/apimachinery/pkg/util/diff" - "github.com/ghodss/yaml" "github.com/google/gofuzz" flag "github.com/spf13/pflag" + "sigs.k8s.io/yaml" ) var fuzzIters = flag.Int("fuzz-iters", 50, "How many fuzzing iterations to do.") diff --git a/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/json/BUILD b/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/json/BUILD index 4857211b34..8ff68498d0 100644 --- a/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/json/BUILD +++ b/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/json/BUILD @@ -34,9 +34,9 @@ go_library( "//staging/src/k8s.io/apimachinery/pkg/runtime/serializer/recognizer:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/framer:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/yaml:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/json-iterator/go:go_default_library", "//vendor/github.com/modern-go/reflect2:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/json/json.go b/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/json/json.go index 382c4858e7..8987e74c68 100644 --- a/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/json/json.go +++ b/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/json/json.go @@ -22,9 +22,9 @@ import ( "strconv" "unsafe" - "github.com/ghodss/yaml" jsoniter "github.com/json-iterator/go" "github.com/modern-go/reflect2" + "sigs.k8s.io/yaml" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/staging/src/k8s.io/apimachinery/pkg/util/intstr/BUILD b/staging/src/k8s.io/apimachinery/pkg/util/intstr/BUILD index 3e4b9eb71e..865691051a 100644 --- a/staging/src/k8s.io/apimachinery/pkg/util/intstr/BUILD +++ b/staging/src/k8s.io/apimachinery/pkg/util/intstr/BUILD @@ -10,7 +10,7 @@ go_test( name = "go_default_test", srcs = ["intstr_test.go"], embed = [":go_default_library"], - deps = ["//vendor/github.com/ghodss/yaml:go_default_library"], + deps = ["//vendor/sigs.k8s.io/yaml:go_default_library"], ) go_library( diff --git a/staging/src/k8s.io/apimachinery/pkg/util/intstr/intstr_test.go b/staging/src/k8s.io/apimachinery/pkg/util/intstr/intstr_test.go index 690fe2d533..f6e082987d 100644 --- a/staging/src/k8s.io/apimachinery/pkg/util/intstr/intstr_test.go +++ b/staging/src/k8s.io/apimachinery/pkg/util/intstr/intstr_test.go @@ -21,7 +21,7 @@ import ( "reflect" "testing" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" ) func TestFromInt(t *testing.T) { diff --git a/staging/src/k8s.io/apimachinery/pkg/util/jsonmergepatch/BUILD b/staging/src/k8s.io/apimachinery/pkg/util/jsonmergepatch/BUILD index 107492bb1d..88b93d2581 100644 --- a/staging/src/k8s.io/apimachinery/pkg/util/jsonmergepatch/BUILD +++ b/staging/src/k8s.io/apimachinery/pkg/util/jsonmergepatch/BUILD @@ -14,7 +14,7 @@ go_test( "//staging/src/k8s.io/apimachinery/pkg/util/json:go_default_library", "//vendor/github.com/davecgh/go-spew/spew:go_default_library", "//vendor/github.com/evanphx/json-patch:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/staging/src/k8s.io/apimachinery/pkg/util/jsonmergepatch/patch_test.go b/staging/src/k8s.io/apimachinery/pkg/util/jsonmergepatch/patch_test.go index 9672deaad6..2543520657 100644 --- a/staging/src/k8s.io/apimachinery/pkg/util/jsonmergepatch/patch_test.go +++ b/staging/src/k8s.io/apimachinery/pkg/util/jsonmergepatch/patch_test.go @@ -23,8 +23,8 @@ import ( "github.com/davecgh/go-spew/spew" "github.com/evanphx/json-patch" - "github.com/ghodss/yaml" "k8s.io/apimachinery/pkg/util/json" + "sigs.k8s.io/yaml" ) type FilterNullTestCases struct { diff --git a/staging/src/k8s.io/apimachinery/pkg/util/mergepatch/BUILD b/staging/src/k8s.io/apimachinery/pkg/util/mergepatch/BUILD index 1ed8649a9e..aa444d4f6c 100644 --- a/staging/src/k8s.io/apimachinery/pkg/util/mergepatch/BUILD +++ b/staging/src/k8s.io/apimachinery/pkg/util/mergepatch/BUILD @@ -22,7 +22,7 @@ go_library( importpath = "k8s.io/apimachinery/pkg/util/mergepatch", deps = [ "//vendor/github.com/davecgh/go-spew/spew:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/staging/src/k8s.io/apimachinery/pkg/util/mergepatch/util.go b/staging/src/k8s.io/apimachinery/pkg/util/mergepatch/util.go index d09a939be3..990fa0d43a 100644 --- a/staging/src/k8s.io/apimachinery/pkg/util/mergepatch/util.go +++ b/staging/src/k8s.io/apimachinery/pkg/util/mergepatch/util.go @@ -21,7 +21,7 @@ import ( "reflect" "github.com/davecgh/go-spew/spew" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" ) // PreconditionFunc asserts that an incompatible change is not present within a patch. diff --git a/staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/BUILD b/staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/BUILD index e0a947ece3..5e3c9b419e 100644 --- a/staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/BUILD +++ b/staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/BUILD @@ -21,7 +21,7 @@ go_test( "//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/testing:go_default_library", "//vendor/github.com/davecgh/go-spew/spew:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch_test.go b/staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch_test.go index 4721803ccd..6a0166e57d 100644 --- a/staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch_test.go +++ b/staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch_test.go @@ -24,7 +24,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/json" diff --git a/staging/src/k8s.io/apimachinery/pkg/util/yaml/BUILD b/staging/src/k8s.io/apimachinery/pkg/util/yaml/BUILD index 64fa65e756..8941af581b 100644 --- a/staging/src/k8s.io/apimachinery/pkg/util/yaml/BUILD +++ b/staging/src/k8s.io/apimachinery/pkg/util/yaml/BUILD @@ -18,8 +18,8 @@ go_library( importmap = "k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/yaml", importpath = "k8s.io/apimachinery/pkg/util/yaml", deps = [ - "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/golang/glog:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/staging/src/k8s.io/apimachinery/pkg/util/yaml/decoder.go b/staging/src/k8s.io/apimachinery/pkg/util/yaml/decoder.go index 3cd85515d4..41ad0431b4 100644 --- a/staging/src/k8s.io/apimachinery/pkg/util/yaml/decoder.go +++ b/staging/src/k8s.io/apimachinery/pkg/util/yaml/decoder.go @@ -26,8 +26,8 @@ import ( "strings" "unicode" - "github.com/ghodss/yaml" "github.com/golang/glog" + "sigs.k8s.io/yaml" ) // ToJSON converts a single YAML document into a JSON document diff --git a/staging/src/k8s.io/apiserver/Godeps/Godeps.json b/staging/src/k8s.io/apiserver/Godeps/Godeps.json index 74c66c6dba..36418e85bd 100644 --- a/staging/src/k8s.io/apiserver/Godeps/Godeps.json +++ b/staging/src/k8s.io/apiserver/Godeps/Godeps.json @@ -2013,6 +2013,10 @@ { "ImportPath": "k8s.io/utils/pointer", "Rev": "66066c83e385e385ccc3c964b44fd7dcd413d0ed" + }, + { + "ImportPath": "sigs.k8s.io/yaml", + "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" } ] } diff --git a/staging/src/k8s.io/apiserver/pkg/admission/BUILD b/staging/src/k8s.io/apiserver/pkg/admission/BUILD index f519566c49..58e3144a7a 100644 --- a/staging/src/k8s.io/apiserver/pkg/admission/BUILD +++ b/staging/src/k8s.io/apiserver/pkg/admission/BUILD @@ -59,8 +59,8 @@ go_library( "//staging/src/k8s.io/apiserver/pkg/apis/audit:go_default_library", "//staging/src/k8s.io/apiserver/pkg/audit:go_default_library", "//staging/src/k8s.io/apiserver/pkg/authentication/user:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/golang/glog:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/staging/src/k8s.io/apiserver/pkg/admission/config.go b/staging/src/k8s.io/apiserver/pkg/admission/config.go index f59d0608bc..a382135975 100644 --- a/staging/src/k8s.io/apiserver/pkg/admission/config.go +++ b/staging/src/k8s.io/apiserver/pkg/admission/config.go @@ -25,8 +25,8 @@ import ( "path" "path/filepath" - "github.com/ghodss/yaml" "github.com/golang/glog" + "sigs.k8s.io/yaml" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer" diff --git a/staging/src/k8s.io/apiserver/pkg/server/options/encryptionconfig/BUILD b/staging/src/k8s.io/apiserver/pkg/server/options/encryptionconfig/BUILD index d409f8cfca..92ed2f9449 100644 --- a/staging/src/k8s.io/apiserver/pkg/server/options/encryptionconfig/BUILD +++ b/staging/src/k8s.io/apiserver/pkg/server/options/encryptionconfig/BUILD @@ -21,7 +21,7 @@ go_library( "//staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope:go_default_library", "//staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/identity:go_default_library", "//staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/secretbox:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/staging/src/k8s.io/apiserver/pkg/server/options/encryptionconfig/config.go b/staging/src/k8s.io/apiserver/pkg/server/options/encryptionconfig/config.go index feece9f029..a8c7d0a822 100644 --- a/staging/src/k8s.io/apiserver/pkg/server/options/encryptionconfig/config.go +++ b/staging/src/k8s.io/apiserver/pkg/server/options/encryptionconfig/config.go @@ -26,7 +26,7 @@ import ( "os" "time" - yaml "github.com/ghodss/yaml" + yaml "sigs.k8s.io/yaml" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apiserver/pkg/storage/value" diff --git a/staging/src/k8s.io/cli-runtime/Godeps/Godeps.json b/staging/src/k8s.io/cli-runtime/Godeps/Godeps.json index 280521d273..b31bc5270f 100644 --- a/staging/src/k8s.io/cli-runtime/Godeps/Godeps.json +++ b/staging/src/k8s.io/cli-runtime/Godeps/Godeps.json @@ -14,10 +14,6 @@ "ImportPath": "github.com/evanphx/json-patch", "Rev": "36442dbdb585210f8d5a1b45e67aa323c197d5c4" }, - { - "ImportPath": "github.com/ghodss/yaml", - "Rev": "c7ce16629ff4cd059ed96ed06419dd3856fd3577" - }, { "ImportPath": "github.com/gogo/protobuf/proto", "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" @@ -617,6 +613,10 @@ { "ImportPath": "k8s.io/client-go/util/testing", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "sigs.k8s.io/yaml", + "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" } ] } diff --git a/staging/src/k8s.io/cli-runtime/pkg/genericclioptions/printers/BUILD b/staging/src/k8s.io/cli-runtime/pkg/genericclioptions/printers/BUILD index 60a43ae33c..2cbb55099d 100644 --- a/staging/src/k8s.io/cli-runtime/pkg/genericclioptions/printers/BUILD +++ b/staging/src/k8s.io/cli-runtime/pkg/genericclioptions/printers/BUILD @@ -21,7 +21,7 @@ go_library( "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//staging/src/k8s.io/client-go/util/jsonpath:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/staging/src/k8s.io/cli-runtime/pkg/genericclioptions/printers/json.go b/staging/src/k8s.io/cli-runtime/pkg/genericclioptions/printers/json.go index 63f5834d41..bb5bec7488 100644 --- a/staging/src/k8s.io/cli-runtime/pkg/genericclioptions/printers/json.go +++ b/staging/src/k8s.io/cli-runtime/pkg/genericclioptions/printers/json.go @@ -25,7 +25,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" ) // JSONPrinter is an implementation of ResourcePrinter which outputs an object as JSON. diff --git a/staging/src/k8s.io/cli-runtime/pkg/genericclioptions/resource/BUILD b/staging/src/k8s.io/cli-runtime/pkg/genericclioptions/resource/BUILD index 89259fa1db..22b34de008 100644 --- a/staging/src/k8s.io/cli-runtime/pkg/genericclioptions/resource/BUILD +++ b/staging/src/k8s.io/cli-runtime/pkg/genericclioptions/resource/BUILD @@ -76,8 +76,8 @@ go_test( "//staging/src/k8s.io/client-go/restmapper:go_default_library", "//staging/src/k8s.io/client-go/util/testing:go_default_library", "//vendor/github.com/davecgh/go-spew/spew:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/stretchr/testify/assert:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/staging/src/k8s.io/cli-runtime/pkg/genericclioptions/resource/builder_test.go b/staging/src/k8s.io/cli-runtime/pkg/genericclioptions/resource/builder_test.go index add8fbde37..7fd526b33c 100644 --- a/staging/src/k8s.io/cli-runtime/pkg/genericclioptions/resource/builder_test.go +++ b/staging/src/k8s.io/cli-runtime/pkg/genericclioptions/resource/builder_test.go @@ -30,7 +30,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" apiequality "k8s.io/apimachinery/pkg/api/equality" "k8s.io/apimachinery/pkg/api/meta" diff --git a/staging/src/k8s.io/client-go/Godeps/Godeps.json b/staging/src/k8s.io/client-go/Godeps/Godeps.json index efd7a0a6f4..3d6f1588d1 100644 --- a/staging/src/k8s.io/client-go/Godeps/Godeps.json +++ b/staging/src/k8s.io/client-go/Godeps/Godeps.json @@ -58,10 +58,6 @@ "ImportPath": "github.com/evanphx/json-patch", "Rev": "36442dbdb585210f8d5a1b45e67aa323c197d5c4" }, - { - "ImportPath": "github.com/ghodss/yaml", - "Rev": "c7ce16629ff4cd059ed96ed06419dd3856fd3577" - }, { "ImportPath": "github.com/gogo/protobuf/proto", "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" @@ -617,6 +613,10 @@ { "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", "Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" + }, + { + "ImportPath": "sigs.k8s.io/yaml", + "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" } ] } diff --git a/staging/src/k8s.io/client-go/tools/clientcmd/BUILD b/staging/src/k8s.io/client-go/tools/clientcmd/BUILD index 59a860ffb5..d92f2003c3 100644 --- a/staging/src/k8s.io/client-go/tools/clientcmd/BUILD +++ b/staging/src/k8s.io/client-go/tools/clientcmd/BUILD @@ -22,9 +22,9 @@ go_test( "//staging/src/k8s.io/client-go/rest:go_default_library", "//staging/src/k8s.io/client-go/tools/clientcmd/api:go_default_library", "//staging/src/k8s.io/client-go/tools/clientcmd/api/latest:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/imdario/mergo:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/staging/src/k8s.io/client-go/tools/clientcmd/api/BUILD b/staging/src/k8s.io/client-go/tools/clientcmd/api/BUILD index 222cec2a54..ce7dac4fb5 100644 --- a/staging/src/k8s.io/client-go/tools/clientcmd/api/BUILD +++ b/staging/src/k8s.io/client-go/tools/clientcmd/api/BUILD @@ -13,7 +13,7 @@ go_test( "types_test.go", ], embed = [":go_default_library"], - deps = ["//vendor/github.com/ghodss/yaml:go_default_library"], + deps = ["//vendor/sigs.k8s.io/yaml:go_default_library"], ) go_library( diff --git a/staging/src/k8s.io/client-go/tools/clientcmd/api/helpers_test.go b/staging/src/k8s.io/client-go/tools/clientcmd/api/helpers_test.go index 7ec30e5da9..48b3cec286 100644 --- a/staging/src/k8s.io/client-go/tools/clientcmd/api/helpers_test.go +++ b/staging/src/k8s.io/client-go/tools/clientcmd/api/helpers_test.go @@ -23,7 +23,7 @@ import ( "reflect" "testing" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" ) func newMergedConfig(certFile, certContent, keyFile, keyContent, caFile, caContent string, t *testing.T) Config { diff --git a/staging/src/k8s.io/client-go/tools/clientcmd/api/types_test.go b/staging/src/k8s.io/client-go/tools/clientcmd/api/types_test.go index bd34834521..f7190d93e1 100644 --- a/staging/src/k8s.io/client-go/tools/clientcmd/api/types_test.go +++ b/staging/src/k8s.io/client-go/tools/clientcmd/api/types_test.go @@ -19,7 +19,7 @@ package api import ( "fmt" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" ) func Example_emptyConfig() { diff --git a/staging/src/k8s.io/client-go/tools/clientcmd/loader_test.go b/staging/src/k8s.io/client-go/tools/clientcmd/loader_test.go index 86eccac45f..461d970bf1 100644 --- a/staging/src/k8s.io/client-go/tools/clientcmd/loader_test.go +++ b/staging/src/k8s.io/client-go/tools/clientcmd/loader_test.go @@ -26,7 +26,7 @@ import ( "strings" "testing" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" "k8s.io/apimachinery/pkg/runtime" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" diff --git a/staging/src/k8s.io/cloud-provider/Godeps/Godeps.json b/staging/src/k8s.io/cloud-provider/Godeps/Godeps.json index f1f23b3531..35178f4450 100644 --- a/staging/src/k8s.io/cloud-provider/Godeps/Godeps.json +++ b/staging/src/k8s.io/cloud-provider/Godeps/Godeps.json @@ -10,10 +10,6 @@ "ImportPath": "github.com/davecgh/go-spew/spew", "Rev": "782f4967f2dc4564575ca782fe2d04090b5faca8" }, - { - "ImportPath": "github.com/ghodss/yaml", - "Rev": "c7ce16629ff4cd059ed96ed06419dd3856fd3577" - }, { "ImportPath": "github.com/gogo/protobuf/proto", "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" @@ -961,6 +957,10 @@ { "ImportPath": "k8s.io/client-go/util/retry", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "sigs.k8s.io/yaml", + "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" } ] } diff --git a/staging/src/k8s.io/csi-api/Godeps/Godeps.json b/staging/src/k8s.io/csi-api/Godeps/Godeps.json index f5aba5bd57..927a6ab3a3 100644 --- a/staging/src/k8s.io/csi-api/Godeps/Godeps.json +++ b/staging/src/k8s.io/csi-api/Godeps/Godeps.json @@ -14,10 +14,6 @@ "ImportPath": "github.com/evanphx/json-patch", "Rev": "36442dbdb585210f8d5a1b45e67aa323c197d5c4" }, - { - "ImportPath": "github.com/ghodss/yaml", - "Rev": "c7ce16629ff4cd059ed96ed06419dd3856fd3577" - }, { "ImportPath": "github.com/gogo/protobuf/proto", "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" @@ -557,6 +553,10 @@ { "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", "Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" + }, + { + "ImportPath": "sigs.k8s.io/yaml", + "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" } ] } diff --git a/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json b/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json index 66c84a8b4d..026cbf12bb 100644 --- a/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json +++ b/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json @@ -110,10 +110,6 @@ "ImportPath": "github.com/evanphx/json-patch", "Rev": "36442dbdb585210f8d5a1b45e67aa323c197d5c4" }, - { - "ImportPath": "github.com/ghodss/yaml", - "Rev": "c7ce16629ff4cd059ed96ed06419dd3856fd3577" - }, { "ImportPath": "github.com/go-openapi/jsonpointer", "Rev": "ef5f0afec364d3b9396b7b77b43dbe26bf1f8004" @@ -1797,6 +1793,10 @@ { "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", "Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" + }, + { + "ImportPath": "sigs.k8s.io/yaml", + "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" } ] } diff --git a/staging/src/k8s.io/metrics/Godeps/Godeps.json b/staging/src/k8s.io/metrics/Godeps/Godeps.json index ebffa53182..eb5bbc6051 100644 --- a/staging/src/k8s.io/metrics/Godeps/Godeps.json +++ b/staging/src/k8s.io/metrics/Godeps/Godeps.json @@ -14,10 +14,6 @@ "ImportPath": "github.com/evanphx/json-patch", "Rev": "36442dbdb585210f8d5a1b45e67aa323c197d5c4" }, - { - "ImportPath": "github.com/ghodss/yaml", - "Rev": "c7ce16629ff4cd059ed96ed06419dd3856fd3577" - }, { "ImportPath": "github.com/gogo/protobuf/proto", "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" @@ -529,6 +525,10 @@ { "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", "Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" + }, + { + "ImportPath": "sigs.k8s.io/yaml", + "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" } ] } diff --git a/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json b/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json index 8f6c2807cb..34de0338c5 100644 --- a/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json +++ b/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json @@ -102,10 +102,6 @@ "ImportPath": "github.com/evanphx/json-patch", "Rev": "36442dbdb585210f8d5a1b45e67aa323c197d5c4" }, - { - "ImportPath": "github.com/ghodss/yaml", - "Rev": "c7ce16629ff4cd059ed96ed06419dd3856fd3577" - }, { "ImportPath": "github.com/go-openapi/jsonpointer", "Rev": "ef5f0afec364d3b9396b7b77b43dbe26bf1f8004" @@ -1749,6 +1745,10 @@ { "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", "Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" + }, + { + "ImportPath": "sigs.k8s.io/yaml", + "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" } ] } diff --git a/staging/src/k8s.io/sample-cli-plugin/Godeps/Godeps.json b/staging/src/k8s.io/sample-cli-plugin/Godeps/Godeps.json index abdb888361..4bc0010f39 100644 --- a/staging/src/k8s.io/sample-cli-plugin/Godeps/Godeps.json +++ b/staging/src/k8s.io/sample-cli-plugin/Godeps/Godeps.json @@ -10,10 +10,6 @@ "ImportPath": "github.com/evanphx/json-patch", "Rev": "36442dbdb585210f8d5a1b45e67aa323c197d5c4" }, - { - "ImportPath": "github.com/ghodss/yaml", - "Rev": "c7ce16629ff4cd059ed96ed06419dd3856fd3577" - }, { "ImportPath": "github.com/gogo/protobuf/proto", "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" @@ -577,6 +573,10 @@ { "ImportPath": "k8s.io/client-go/util/jsonpath", "Rev": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + { + "ImportPath": "sigs.k8s.io/yaml", + "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" } ] } diff --git a/staging/src/k8s.io/sample-controller/Godeps/Godeps.json b/staging/src/k8s.io/sample-controller/Godeps/Godeps.json index a9ea15b519..6332b77e02 100644 --- a/staging/src/k8s.io/sample-controller/Godeps/Godeps.json +++ b/staging/src/k8s.io/sample-controller/Godeps/Godeps.json @@ -14,10 +14,6 @@ "ImportPath": "github.com/evanphx/json-patch", "Rev": "36442dbdb585210f8d5a1b45e67aa323c197d5c4" }, - { - "ImportPath": "github.com/ghodss/yaml", - "Rev": "c7ce16629ff4cd059ed96ed06419dd3856fd3577" - }, { "ImportPath": "github.com/gogo/protobuf/proto", "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" @@ -1161,6 +1157,10 @@ { "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", "Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" + }, + { + "ImportPath": "sigs.k8s.io/yaml", + "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" } ] } diff --git a/test/e2e/kubectl/BUILD b/test/e2e/kubectl/BUILD index ffb819f481..971e90cecf 100644 --- a/test/e2e/kubectl/BUILD +++ b/test/e2e/kubectl/BUILD @@ -35,11 +35,11 @@ go_library( "//test/utils:go_default_library", "//test/utils/image:go_default_library", "//vendor/github.com/elazarl/goproxy:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/golang.org/x/net/websocket:go_default_library", "//vendor/k8s.io/utils/exec:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/test/e2e/kubectl/kubectl.go b/test/e2e/kubectl/kubectl.go index 333e665072..607500de5c 100644 --- a/test/e2e/kubectl/kubectl.go +++ b/test/e2e/kubectl/kubectl.go @@ -41,7 +41,7 @@ import ( "time" "github.com/elazarl/goproxy" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" "k8s.io/api/core/v1" rbacv1beta1 "k8s.io/api/rbac/v1beta1" diff --git a/test/e2e/storage/BUILD b/test/e2e/storage/BUILD index 5e7c6d9a6f..5f58de97aa 100644 --- a/test/e2e/storage/BUILD +++ b/test/e2e/storage/BUILD @@ -78,11 +78,11 @@ go_library( "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library", "//vendor/github.com/aws/aws-sdk-go/aws/session:go_default_library", "//vendor/github.com/aws/aws-sdk-go/service/ec2:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/github.com/prometheus/common/model:go_default_library", "//vendor/google.golang.org/api/googleapi:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/test/e2e/storage/persistent_volumes-local.go b/test/e2e/storage/persistent_volumes-local.go index e65089f614..102660bc57 100644 --- a/test/e2e/storage/persistent_volumes-local.go +++ b/test/e2e/storage/persistent_volumes-local.go @@ -25,9 +25,9 @@ import ( "sync" "time" - "github.com/ghodss/yaml" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "sigs.k8s.io/yaml" appsv1 "k8s.io/api/apps/v1" "k8s.io/api/core/v1" diff --git a/test/e2e_node/runner/remote/BUILD b/test/e2e_node/runner/remote/BUILD index 36ed1b8815..d324fe8a6d 100644 --- a/test/e2e_node/runner/remote/BUILD +++ b/test/e2e_node/runner/remote/BUILD @@ -17,12 +17,12 @@ go_library( importpath = "k8s.io/kubernetes/test/e2e_node/runner/remote", deps = [ "//test/e2e_node/remote:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/pborman/uuid:go_default_library", "//vendor/golang.org/x/oauth2:go_default_library", "//vendor/golang.org/x/oauth2/google:go_default_library", "//vendor/google.golang.org/api/compute/v0.beta:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/test/e2e_node/runner/remote/run_remote.go b/test/e2e_node/runner/remote/run_remote.go index 1dca0808c7..8c60551e32 100644 --- a/test/e2e_node/runner/remote/run_remote.go +++ b/test/e2e_node/runner/remote/run_remote.go @@ -37,12 +37,12 @@ import ( "k8s.io/kubernetes/test/e2e_node/remote" - "github.com/ghodss/yaml" "github.com/golang/glog" "github.com/pborman/uuid" "golang.org/x/oauth2" "golang.org/x/oauth2/google" compute "google.golang.org/api/compute/v0.beta" + "sigs.k8s.io/yaml" ) var testArgs = flag.String("test_args", "", "Space-separated list of arguments to pass to Ginkgo test runner.") diff --git a/test/integration/master/BUILD b/test/integration/master/BUILD index 4575d2667c..0bb76a3fd4 100644 --- a/test/integration/master/BUILD +++ b/test/integration/master/BUILD @@ -66,7 +66,7 @@ go_test( "//test/integration/framework:go_default_library", "//test/utils:go_default_library", "//vendor/github.com/evanphx/json-patch:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ] + select({ "@io_bazel_rules_go//go/platform:android": [ "//staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1:go_default_library", @@ -133,8 +133,8 @@ go_library( "//test/integration:go_default_library", "//test/integration/framework:go_default_library", "//vendor/github.com/coreos/etcd/clientv3:go_default_library", - "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/prometheus/client_golang/prometheus:go_default_library", + "//vendor/sigs.k8s.io/yaml:go_default_library", ] + select({ "@io_bazel_rules_go//go/platform:android": [ "//staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/v1beta1:go_default_library", diff --git a/test/integration/master/synthetic_master_test.go b/test/integration/master/synthetic_master_test.go index a4ef671983..56a194424d 100644 --- a/test/integration/master/synthetic_master_test.go +++ b/test/integration/master/synthetic_master_test.go @@ -30,7 +30,7 @@ import ( "testing" "time" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" appsv1 "k8s.io/api/apps/v1" "k8s.io/api/core/v1" diff --git a/test/integration/master/transformation_testcase.go b/test/integration/master/transformation_testcase.go index 8f8171b7da..a23e7413af 100644 --- a/test/integration/master/transformation_testcase.go +++ b/test/integration/master/transformation_testcase.go @@ -28,8 +28,8 @@ import ( "testing" "github.com/coreos/etcd/clientv3" - "github.com/ghodss/yaml" "github.com/prometheus/client_golang/prometheus" + "sigs.k8s.io/yaml" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/vendor/BUILD b/vendor/BUILD index 5d89686d80..7468eb03fd 100644 --- a/vendor/BUILD +++ b/vendor/BUILD @@ -15,7 +15,6 @@ filegroup( "//vendor/bitbucket.org/ww/goautoneg:all-srcs", "//vendor/cloud.google.com/go/compute/metadata:all-srcs", "//vendor/cloud.google.com/go/internal:all-srcs", - "//vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute:all-srcs", "//vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute:all-srcs", "//vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry:all-srcs", "//vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network:all-srcs", @@ -467,6 +466,7 @@ filegroup( "//vendor/k8s.io/utils/clock:all-srcs", "//vendor/k8s.io/utils/exec:all-srcs", "//vendor/k8s.io/utils/pointer:all-srcs", + "//vendor/sigs.k8s.io/yaml:all-srcs", "//vendor/vbom.ml/util/sortorder:all-srcs", ], tags = ["automanaged"], diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/BUILD b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/BUILD deleted file mode 100644 index 6df04e38cd..0000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/BUILD +++ /dev/null @@ -1,13 +0,0 @@ -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], - visibility = ["//visibility:public"], -) diff --git a/vendor/sigs.k8s.io/yaml/.gitignore b/vendor/sigs.k8s.io/yaml/.gitignore new file mode 100644 index 0000000000..e256a31e00 --- /dev/null +++ b/vendor/sigs.k8s.io/yaml/.gitignore @@ -0,0 +1,20 @@ +# OSX leaves these everywhere on SMB shares +._* + +# Eclipse files +.classpath +.project +.settings/** + +# Emacs save files +*~ + +# Vim-related files +[._]*.s[a-w][a-z] +[._]s[a-w][a-z] +*.un~ +Session.vim +.netrwhist + +# Go test binaries +*.test diff --git a/vendor/sigs.k8s.io/yaml/.travis.yml b/vendor/sigs.k8s.io/yaml/.travis.yml new file mode 100644 index 0000000000..03ddc7318a --- /dev/null +++ b/vendor/sigs.k8s.io/yaml/.travis.yml @@ -0,0 +1,14 @@ +language: go +dist: xenial +go: + - 1.9.x + - 1.10.x + - 1.11.x +script: + - go get -t -v ./... + - diff -u <(echo -n) <(gofmt -d .) + - diff -u <(echo -n) <(golint $(go list -e ./...) | grep -v YAMLToJSON) + - go tool vet . + - go test -v -race ./... +install: + - go get golang.org/x/lint/golint diff --git a/vendor/sigs.k8s.io/yaml/BUILD b/vendor/sigs.k8s.io/yaml/BUILD new file mode 100644 index 0000000000..a030e7f2cd --- /dev/null +++ b/vendor/sigs.k8s.io/yaml/BUILD @@ -0,0 +1,28 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "fields.go", + "yaml.go", + "yaml_go110.go", + ], + importmap = "k8s.io/kubernetes/vendor/sigs.k8s.io/yaml", + importpath = "sigs.k8s.io/yaml", + visibility = ["//visibility:public"], + deps = ["//vendor/gopkg.in/yaml.v2:go_default_library"], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], + visibility = ["//visibility:public"], +) diff --git a/vendor/sigs.k8s.io/yaml/CONTRIBUTING.md b/vendor/sigs.k8s.io/yaml/CONTRIBUTING.md new file mode 100644 index 0000000000..de47115137 --- /dev/null +++ b/vendor/sigs.k8s.io/yaml/CONTRIBUTING.md @@ -0,0 +1,31 @@ +# Contributing Guidelines + +Welcome to Kubernetes. We are excited about the prospect of you joining our [community](https://github.com/kubernetes/community)! The Kubernetes community abides by the CNCF [code of conduct](code-of-conduct.md). Here is an excerpt: + +_As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities._ + +## Getting Started + +We have full documentation on how to get started contributing here: + + + +- [Contributor License Agreement](https://git.k8s.io/community/CLA.md) Kubernetes projects require that you sign a Contributor License Agreement (CLA) before we can accept your pull requests +- [Kubernetes Contributor Guide](http://git.k8s.io/community/contributors/guide) - Main contributor documentation, or you can just jump directly to the [contributing section](http://git.k8s.io/community/contributors/guide#contributing) +- [Contributor Cheat Sheet](https://git.k8s.io/community/contributors/guide/contributor-cheatsheet.md) - Common resources for existing developers + +## Mentorship + +- [Mentoring Initiatives](https://git.k8s.io/community/mentoring) - We have a diverse set of mentorship programs available that are always looking for volunteers! + + diff --git a/vendor/sigs.k8s.io/yaml/LICENSE b/vendor/sigs.k8s.io/yaml/LICENSE new file mode 100644 index 0000000000..7805d36de7 --- /dev/null +++ b/vendor/sigs.k8s.io/yaml/LICENSE @@ -0,0 +1,50 @@ +The MIT License (MIT) + +Copyright (c) 2014 Sam Ghods + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +Copyright (c) 2012 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/sigs.k8s.io/yaml/OWNERS b/vendor/sigs.k8s.io/yaml/OWNERS new file mode 100644 index 0000000000..11ad7ce1a4 --- /dev/null +++ b/vendor/sigs.k8s.io/yaml/OWNERS @@ -0,0 +1,25 @@ +approvers: +- dims +- lavalamp +- smarterclayton +- deads2k +- sttts +- liggitt +- caesarxuchao +reviewers: +- dims +- thockin +- lavalamp +- smarterclayton +- wojtek-t +- deads2k +- derekwaynecarr +- caesarxuchao +- mikedanese +- liggitt +- gmarek +- sttts +- ncdc +- tallclair +labels: +- sig/api-machinery diff --git a/vendor/sigs.k8s.io/yaml/README.md b/vendor/sigs.k8s.io/yaml/README.md new file mode 100644 index 0000000000..0200f75b4d --- /dev/null +++ b/vendor/sigs.k8s.io/yaml/README.md @@ -0,0 +1,121 @@ +# YAML marshaling and unmarshaling support for Go + +[![Build Status](https://travis-ci.org/ghodss/yaml.svg)](https://travis-ci.org/ghodss/yaml) + +## Introduction + +A wrapper around [go-yaml](https://github.com/go-yaml/yaml) designed to enable a better way of handling YAML when marshaling to and from structs. + +In short, this library first converts YAML to JSON using go-yaml and then uses `json.Marshal` and `json.Unmarshal` to convert to or from the struct. This means that it effectively reuses the JSON struct tags as well as the custom JSON methods `MarshalJSON` and `UnmarshalJSON` unlike go-yaml. For a detailed overview of the rationale behind this method, [see this blog post](http://ghodss.com/2014/the-right-way-to-handle-yaml-in-golang/). + +## Compatibility + +This package uses [go-yaml](https://github.com/go-yaml/yaml) and therefore supports [everything go-yaml supports](https://github.com/go-yaml/yaml#compatibility). + +## Caveats + +**Caveat #1:** When using `yaml.Marshal` and `yaml.Unmarshal`, binary data should NOT be preceded with the `!!binary` YAML tag. If you do, go-yaml will convert the binary data from base64 to native binary data, which is not compatible with JSON. You can still use binary in your YAML files though - just store them without the `!!binary` tag and decode the base64 in your code (e.g. in the custom JSON methods `MarshalJSON` and `UnmarshalJSON`). This also has the benefit that your YAML and your JSON binary data will be decoded exactly the same way. As an example: + +``` +BAD: + exampleKey: !!binary gIGC + +GOOD: + exampleKey: gIGC +... and decode the base64 data in your code. +``` + +**Caveat #2:** When using `YAMLToJSON` directly, maps with keys that are maps will result in an error since this is not supported by JSON. This error will occur in `Unmarshal` as well since you can't unmarshal map keys anyways since struct fields can't be keys. + +## Installation and usage + +To install, run: + +``` +$ go get github.com/ghodss/yaml +``` + +And import using: + +``` +import "github.com/ghodss/yaml" +``` + +Usage is very similar to the JSON library: + +```go +package main + +import ( + "fmt" + + "github.com/ghodss/yaml" +) + +type Person struct { + Name string `json:"name"` // Affects YAML field names too. + Age int `json:"age"` +} + +func main() { + // Marshal a Person struct to YAML. + p := Person{"John", 30} + y, err := yaml.Marshal(p) + if err != nil { + fmt.Printf("err: %v\n", err) + return + } + fmt.Println(string(y)) + /* Output: + age: 30 + name: John + */ + + // Unmarshal the YAML back into a Person struct. + var p2 Person + err = yaml.Unmarshal(y, &p2) + if err != nil { + fmt.Printf("err: %v\n", err) + return + } + fmt.Println(p2) + /* Output: + {John 30} + */ +} +``` + +`yaml.YAMLToJSON` and `yaml.JSONToYAML` methods are also available: + +```go +package main + +import ( + "fmt" + + "github.com/ghodss/yaml" +) + +func main() { + j := []byte(`{"name": "John", "age": 30}`) + y, err := yaml.JSONToYAML(j) + if err != nil { + fmt.Printf("err: %v\n", err) + return + } + fmt.Println(string(y)) + /* Output: + name: John + age: 30 + */ + j2, err := yaml.YAMLToJSON(y) + if err != nil { + fmt.Printf("err: %v\n", err) + return + } + fmt.Println(string(j2)) + /* Output: + {"age":30,"name":"John"} + */ +} +``` diff --git a/vendor/sigs.k8s.io/yaml/RELEASE.md b/vendor/sigs.k8s.io/yaml/RELEASE.md new file mode 100644 index 0000000000..6b642464e5 --- /dev/null +++ b/vendor/sigs.k8s.io/yaml/RELEASE.md @@ -0,0 +1,9 @@ +# Release Process + +The `yaml` Project is released on an as-needed basis. The process is as follows: + +1. An issue is proposing a new release with a changelog since the last release +1. All [OWNERS](OWNERS) must LGTM this release +1. An OWNER runs `git tag -s $VERSION` and inserts the changelog and pushes the tag with `git push $VERSION` +1. The release issue is closed +1. An announcement email is sent to `kubernetes-dev@googlegroups.com` with the subject `[ANNOUNCE] kubernetes-template-project $VERSION is released` diff --git a/vendor/sigs.k8s.io/yaml/SECURITY_CONTACTS b/vendor/sigs.k8s.io/yaml/SECURITY_CONTACTS new file mode 100644 index 0000000000..0648a8ebff --- /dev/null +++ b/vendor/sigs.k8s.io/yaml/SECURITY_CONTACTS @@ -0,0 +1,17 @@ +# Defined below are the security contacts for this repo. +# +# They are the contact point for the Product Security Team to reach out +# to for triaging and handling of incoming issues. +# +# The below names agree to abide by the +# [Embargo Policy](https://github.com/kubernetes/sig-release/blob/master/security-release-process-documentation/security-release-process.md#embargo-policy) +# and will be removed and replaced if they violate that agreement. +# +# DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE +# INSTRUCTIONS AT https://kubernetes.io/security/ + +cjcullen +jessfraz +liggitt +philips +tallclair diff --git a/vendor/sigs.k8s.io/yaml/code-of-conduct.md b/vendor/sigs.k8s.io/yaml/code-of-conduct.md new file mode 100644 index 0000000000..0d15c00cf3 --- /dev/null +++ b/vendor/sigs.k8s.io/yaml/code-of-conduct.md @@ -0,0 +1,3 @@ +# Kubernetes Community Code of Conduct + +Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md) diff --git a/vendor/sigs.k8s.io/yaml/fields.go b/vendor/sigs.k8s.io/yaml/fields.go new file mode 100644 index 0000000000..235b7f2cf6 --- /dev/null +++ b/vendor/sigs.k8s.io/yaml/fields.go @@ -0,0 +1,502 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package yaml + +import ( + "bytes" + "encoding" + "encoding/json" + "reflect" + "sort" + "strings" + "sync" + "unicode" + "unicode/utf8" +) + +// indirect walks down v allocating pointers as needed, +// until it gets to a non-pointer. +// if it encounters an Unmarshaler, indirect stops and returns that. +// if decodingNull is true, indirect stops at the last pointer so it can be set to nil. +func indirect(v reflect.Value, decodingNull bool) (json.Unmarshaler, encoding.TextUnmarshaler, reflect.Value) { + // If v is a named type and is addressable, + // start with its address, so that if the type has pointer methods, + // we find them. + if v.Kind() != reflect.Ptr && v.Type().Name() != "" && v.CanAddr() { + v = v.Addr() + } + for { + // Load value from interface, but only if the result will be + // usefully addressable. + if v.Kind() == reflect.Interface && !v.IsNil() { + e := v.Elem() + if e.Kind() == reflect.Ptr && !e.IsNil() && (!decodingNull || e.Elem().Kind() == reflect.Ptr) { + v = e + continue + } + } + + if v.Kind() != reflect.Ptr { + break + } + + if v.Elem().Kind() != reflect.Ptr && decodingNull && v.CanSet() { + break + } + if v.IsNil() { + if v.CanSet() { + v.Set(reflect.New(v.Type().Elem())) + } else { + v = reflect.New(v.Type().Elem()) + } + } + if v.Type().NumMethod() > 0 { + if u, ok := v.Interface().(json.Unmarshaler); ok { + return u, nil, reflect.Value{} + } + if u, ok := v.Interface().(encoding.TextUnmarshaler); ok { + return nil, u, reflect.Value{} + } + } + v = v.Elem() + } + return nil, nil, v +} + +// A field represents a single field found in a struct. +type field struct { + name string + nameBytes []byte // []byte(name) + equalFold func(s, t []byte) bool // bytes.EqualFold or equivalent + + tag bool + index []int + typ reflect.Type + omitEmpty bool + quoted bool +} + +func fillField(f field) field { + f.nameBytes = []byte(f.name) + f.equalFold = foldFunc(f.nameBytes) + return f +} + +// byName sorts field by name, breaking ties with depth, +// then breaking ties with "name came from json tag", then +// breaking ties with index sequence. +type byName []field + +func (x byName) Len() int { return len(x) } + +func (x byName) Swap(i, j int) { x[i], x[j] = x[j], x[i] } + +func (x byName) Less(i, j int) bool { + if x[i].name != x[j].name { + return x[i].name < x[j].name + } + if len(x[i].index) != len(x[j].index) { + return len(x[i].index) < len(x[j].index) + } + if x[i].tag != x[j].tag { + return x[i].tag + } + return byIndex(x).Less(i, j) +} + +// byIndex sorts field by index sequence. +type byIndex []field + +func (x byIndex) Len() int { return len(x) } + +func (x byIndex) Swap(i, j int) { x[i], x[j] = x[j], x[i] } + +func (x byIndex) Less(i, j int) bool { + for k, xik := range x[i].index { + if k >= len(x[j].index) { + return false + } + if xik != x[j].index[k] { + return xik < x[j].index[k] + } + } + return len(x[i].index) < len(x[j].index) +} + +// typeFields returns a list of fields that JSON should recognize for the given type. +// The algorithm is breadth-first search over the set of structs to include - the top struct +// and then any reachable anonymous structs. +func typeFields(t reflect.Type) []field { + // Anonymous fields to explore at the current level and the next. + current := []field{} + next := []field{{typ: t}} + + // Count of queued names for current level and the next. + count := map[reflect.Type]int{} + nextCount := map[reflect.Type]int{} + + // Types already visited at an earlier level. + visited := map[reflect.Type]bool{} + + // Fields found. + var fields []field + + for len(next) > 0 { + current, next = next, current[:0] + count, nextCount = nextCount, map[reflect.Type]int{} + + for _, f := range current { + if visited[f.typ] { + continue + } + visited[f.typ] = true + + // Scan f.typ for fields to include. + for i := 0; i < f.typ.NumField(); i++ { + sf := f.typ.Field(i) + if sf.PkgPath != "" { // unexported + continue + } + tag := sf.Tag.Get("json") + if tag == "-" { + continue + } + name, opts := parseTag(tag) + if !isValidTag(name) { + name = "" + } + index := make([]int, len(f.index)+1) + copy(index, f.index) + index[len(f.index)] = i + + ft := sf.Type + if ft.Name() == "" && ft.Kind() == reflect.Ptr { + // Follow pointer. + ft = ft.Elem() + } + + // Record found field and index sequence. + if name != "" || !sf.Anonymous || ft.Kind() != reflect.Struct { + tagged := name != "" + if name == "" { + name = sf.Name + } + fields = append(fields, fillField(field{ + name: name, + tag: tagged, + index: index, + typ: ft, + omitEmpty: opts.Contains("omitempty"), + quoted: opts.Contains("string"), + })) + if count[f.typ] > 1 { + // If there were multiple instances, add a second, + // so that the annihilation code will see a duplicate. + // It only cares about the distinction between 1 or 2, + // so don't bother generating any more copies. + fields = append(fields, fields[len(fields)-1]) + } + continue + } + + // Record new anonymous struct to explore in next round. + nextCount[ft]++ + if nextCount[ft] == 1 { + next = append(next, fillField(field{name: ft.Name(), index: index, typ: ft})) + } + } + } + } + + sort.Sort(byName(fields)) + + // Delete all fields that are hidden by the Go rules for embedded fields, + // except that fields with JSON tags are promoted. + + // The fields are sorted in primary order of name, secondary order + // of field index length. Loop over names; for each name, delete + // hidden fields by choosing the one dominant field that survives. + out := fields[:0] + for advance, i := 0, 0; i < len(fields); i += advance { + // One iteration per name. + // Find the sequence of fields with the name of this first field. + fi := fields[i] + name := fi.name + for advance = 1; i+advance < len(fields); advance++ { + fj := fields[i+advance] + if fj.name != name { + break + } + } + if advance == 1 { // Only one field with this name + out = append(out, fi) + continue + } + dominant, ok := dominantField(fields[i : i+advance]) + if ok { + out = append(out, dominant) + } + } + + fields = out + sort.Sort(byIndex(fields)) + + return fields +} + +// dominantField looks through the fields, all of which are known to +// have the same name, to find the single field that dominates the +// others using Go's embedding rules, modified by the presence of +// JSON tags. If there are multiple top-level fields, the boolean +// will be false: This condition is an error in Go and we skip all +// the fields. +func dominantField(fields []field) (field, bool) { + // The fields are sorted in increasing index-length order. The winner + // must therefore be one with the shortest index length. Drop all + // longer entries, which is easy: just truncate the slice. + length := len(fields[0].index) + tagged := -1 // Index of first tagged field. + for i, f := range fields { + if len(f.index) > length { + fields = fields[:i] + break + } + if f.tag { + if tagged >= 0 { + // Multiple tagged fields at the same level: conflict. + // Return no field. + return field{}, false + } + tagged = i + } + } + if tagged >= 0 { + return fields[tagged], true + } + // All remaining fields have the same length. If there's more than one, + // we have a conflict (two fields named "X" at the same level) and we + // return no field. + if len(fields) > 1 { + return field{}, false + } + return fields[0], true +} + +var fieldCache struct { + sync.RWMutex + m map[reflect.Type][]field +} + +// cachedTypeFields is like typeFields but uses a cache to avoid repeated work. +func cachedTypeFields(t reflect.Type) []field { + fieldCache.RLock() + f := fieldCache.m[t] + fieldCache.RUnlock() + if f != nil { + return f + } + + // Compute fields without lock. + // Might duplicate effort but won't hold other computations back. + f = typeFields(t) + if f == nil { + f = []field{} + } + + fieldCache.Lock() + if fieldCache.m == nil { + fieldCache.m = map[reflect.Type][]field{} + } + fieldCache.m[t] = f + fieldCache.Unlock() + return f +} + +func isValidTag(s string) bool { + if s == "" { + return false + } + for _, c := range s { + switch { + case strings.ContainsRune("!#$%&()*+-./:<=>?@[]^_{|}~ ", c): + // Backslash and quote chars are reserved, but + // otherwise any punctuation chars are allowed + // in a tag name. + default: + if !unicode.IsLetter(c) && !unicode.IsDigit(c) { + return false + } + } + } + return true +} + +const ( + caseMask = ^byte(0x20) // Mask to ignore case in ASCII. + kelvin = '\u212a' + smallLongEss = '\u017f' +) + +// foldFunc returns one of four different case folding equivalence +// functions, from most general (and slow) to fastest: +// +// 1) bytes.EqualFold, if the key s contains any non-ASCII UTF-8 +// 2) equalFoldRight, if s contains special folding ASCII ('k', 'K', 's', 'S') +// 3) asciiEqualFold, no special, but includes non-letters (including _) +// 4) simpleLetterEqualFold, no specials, no non-letters. +// +// The letters S and K are special because they map to 3 runes, not just 2: +// * S maps to s and to U+017F 'ſ' Latin small letter long s +// * k maps to K and to U+212A 'K' Kelvin sign +// See http://play.golang.org/p/tTxjOc0OGo +// +// The returned function is specialized for matching against s and +// should only be given s. It's not curried for performance reasons. +func foldFunc(s []byte) func(s, t []byte) bool { + nonLetter := false + special := false // special letter + for _, b := range s { + if b >= utf8.RuneSelf { + return bytes.EqualFold + } + upper := b & caseMask + if upper < 'A' || upper > 'Z' { + nonLetter = true + } else if upper == 'K' || upper == 'S' { + // See above for why these letters are special. + special = true + } + } + if special { + return equalFoldRight + } + if nonLetter { + return asciiEqualFold + } + return simpleLetterEqualFold +} + +// equalFoldRight is a specialization of bytes.EqualFold when s is +// known to be all ASCII (including punctuation), but contains an 's', +// 'S', 'k', or 'K', requiring a Unicode fold on the bytes in t. +// See comments on foldFunc. +func equalFoldRight(s, t []byte) bool { + for _, sb := range s { + if len(t) == 0 { + return false + } + tb := t[0] + if tb < utf8.RuneSelf { + if sb != tb { + sbUpper := sb & caseMask + if 'A' <= sbUpper && sbUpper <= 'Z' { + if sbUpper != tb&caseMask { + return false + } + } else { + return false + } + } + t = t[1:] + continue + } + // sb is ASCII and t is not. t must be either kelvin + // sign or long s; sb must be s, S, k, or K. + tr, size := utf8.DecodeRune(t) + switch sb { + case 's', 'S': + if tr != smallLongEss { + return false + } + case 'k', 'K': + if tr != kelvin { + return false + } + default: + return false + } + t = t[size:] + + } + if len(t) > 0 { + return false + } + return true +} + +// asciiEqualFold is a specialization of bytes.EqualFold for use when +// s is all ASCII (but may contain non-letters) and contains no +// special-folding letters. +// See comments on foldFunc. +func asciiEqualFold(s, t []byte) bool { + if len(s) != len(t) { + return false + } + for i, sb := range s { + tb := t[i] + if sb == tb { + continue + } + if ('a' <= sb && sb <= 'z') || ('A' <= sb && sb <= 'Z') { + if sb&caseMask != tb&caseMask { + return false + } + } else { + return false + } + } + return true +} + +// simpleLetterEqualFold is a specialization of bytes.EqualFold for +// use when s is all ASCII letters (no underscores, etc) and also +// doesn't contain 'k', 'K', 's', or 'S'. +// See comments on foldFunc. +func simpleLetterEqualFold(s, t []byte) bool { + if len(s) != len(t) { + return false + } + for i, b := range s { + if b&caseMask != t[i]&caseMask { + return false + } + } + return true +} + +// tagOptions is the string following a comma in a struct field's "json" +// tag, or the empty string. It does not include the leading comma. +type tagOptions string + +// parseTag splits a struct field's json tag into its name and +// comma-separated options. +func parseTag(tag string) (string, tagOptions) { + if idx := strings.Index(tag, ","); idx != -1 { + return tag[:idx], tagOptions(tag[idx+1:]) + } + return tag, tagOptions("") +} + +// Contains reports whether a comma-separated list of options +// contains a particular substr flag. substr must be surrounded by a +// string boundary or commas. +func (o tagOptions) Contains(optionName string) bool { + if len(o) == 0 { + return false + } + s := string(o) + for s != "" { + var next string + i := strings.Index(s, ",") + if i >= 0 { + s, next = s[:i], s[i+1:] + } + if s == optionName { + return true + } + s = next + } + return false +} diff --git a/vendor/sigs.k8s.io/yaml/yaml.go b/vendor/sigs.k8s.io/yaml/yaml.go new file mode 100644 index 0000000000..024596112a --- /dev/null +++ b/vendor/sigs.k8s.io/yaml/yaml.go @@ -0,0 +1,319 @@ +package yaml + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "reflect" + "strconv" + + "gopkg.in/yaml.v2" +) + +// Marshal marshals the object into JSON then converts JSON to YAML and returns the +// YAML. +func Marshal(o interface{}) ([]byte, error) { + j, err := json.Marshal(o) + if err != nil { + return nil, fmt.Errorf("error marshaling into JSON: %v", err) + } + + y, err := JSONToYAML(j) + if err != nil { + return nil, fmt.Errorf("error converting JSON to YAML: %v", err) + } + + return y, nil +} + +// JSONOpt is a decoding option for decoding from JSON format. +type JSONOpt func(*json.Decoder) *json.Decoder + +// Unmarshal converts YAML to JSON then uses JSON to unmarshal into an object, +// optionally configuring the behavior of the JSON unmarshal. +func Unmarshal(y []byte, o interface{}, opts ...JSONOpt) error { + return yamlUnmarshal(y, o, false, opts...) +} + +// UnmarshalStrict strictly converts YAML to JSON then uses JSON to unmarshal +// into an object, optionally configuring the behavior of the JSON unmarshal. +func UnmarshalStrict(y []byte, o interface{}, opts ...JSONOpt) error { + return yamlUnmarshal(y, o, true, append(opts, DisallowUnknownFields)...) +} + +// yamlUnmarshal unmarshals the given YAML byte stream into the given interface, +// optionally performing the unmarshalling strictly +func yamlUnmarshal(y []byte, o interface{}, strict bool, opts ...JSONOpt) error { + vo := reflect.ValueOf(o) + unmarshalFn := yaml.Unmarshal + if strict { + unmarshalFn = yaml.UnmarshalStrict + } + j, err := yamlToJSON(y, &vo, unmarshalFn) + if err != nil { + return fmt.Errorf("error converting YAML to JSON: %v", err) + } + + err = jsonUnmarshal(bytes.NewReader(j), o, opts...) + if err != nil { + return fmt.Errorf("error unmarshaling JSON: %v", err) + } + + return nil +} + +// jsonUnmarshal unmarshals the JSON byte stream from the given reader into the +// object, optionally applying decoder options prior to decoding. We are not +// using json.Unmarshal directly as we want the chance to pass in non-default +// options. +func jsonUnmarshal(r io.Reader, o interface{}, opts ...JSONOpt) error { + d := json.NewDecoder(r) + for _, opt := range opts { + d = opt(d) + } + if err := d.Decode(&o); err != nil { + return fmt.Errorf("while decoding JSON: %v", err) + } + return nil +} + +// JSONToYAML Converts JSON to YAML. +func JSONToYAML(j []byte) ([]byte, error) { + // Convert the JSON to an object. + var jsonObj interface{} + // We are using yaml.Unmarshal here (instead of json.Unmarshal) because the + // Go JSON library doesn't try to pick the right number type (int, float, + // etc.) when unmarshalling to interface{}, it just picks float64 + // universally. go-yaml does go through the effort of picking the right + // number type, so we can preserve number type throughout this process. + err := yaml.Unmarshal(j, &jsonObj) + if err != nil { + return nil, err + } + + // Marshal this object into YAML. + return yaml.Marshal(jsonObj) +} + +// YAMLToJSON converts YAML to JSON. Since JSON is a subset of YAML, +// passing JSON through this method should be a no-op. +// +// Things YAML can do that are not supported by JSON: +// * In YAML you can have binary and null keys in your maps. These are invalid +// in JSON. (int and float keys are converted to strings.) +// * Binary data in YAML with the !!binary tag is not supported. If you want to +// use binary data with this library, encode the data as base64 as usual but do +// not use the !!binary tag in your YAML. This will ensure the original base64 +// encoded data makes it all the way through to the JSON. +// +// For strict decoding of YAML, use YAMLToJSONStrict. +func YAMLToJSON(y []byte) ([]byte, error) { + return yamlToJSON(y, nil, yaml.Unmarshal) +} + +// YAMLToJSONStrict is like YAMLToJSON but enables strict YAML decoding, +// returning an error on any duplicate field names. +func YAMLToJSONStrict(y []byte) ([]byte, error) { + return yamlToJSON(y, nil, yaml.UnmarshalStrict) +} + +func yamlToJSON(y []byte, jsonTarget *reflect.Value, yamlUnmarshal func([]byte, interface{}) error) ([]byte, error) { + // Convert the YAML to an object. + var yamlObj interface{} + err := yamlUnmarshal(y, &yamlObj) + if err != nil { + return nil, err + } + + // YAML objects are not completely compatible with JSON objects (e.g. you + // can have non-string keys in YAML). So, convert the YAML-compatible object + // to a JSON-compatible object, failing with an error if irrecoverable + // incompatibilties happen along the way. + jsonObj, err := convertToJSONableObject(yamlObj, jsonTarget) + if err != nil { + return nil, err + } + + // Convert this object to JSON and return the data. + return json.Marshal(jsonObj) +} + +func convertToJSONableObject(yamlObj interface{}, jsonTarget *reflect.Value) (interface{}, error) { + var err error + + // Resolve jsonTarget to a concrete value (i.e. not a pointer or an + // interface). We pass decodingNull as false because we're not actually + // decoding into the value, we're just checking if the ultimate target is a + // string. + if jsonTarget != nil { + ju, tu, pv := indirect(*jsonTarget, false) + // We have a JSON or Text Umarshaler at this level, so we can't be trying + // to decode into a string. + if ju != nil || tu != nil { + jsonTarget = nil + } else { + jsonTarget = &pv + } + } + + // If yamlObj is a number or a boolean, check if jsonTarget is a string - + // if so, coerce. Else return normal. + // If yamlObj is a map or array, find the field that each key is + // unmarshaling to, and when you recurse pass the reflect.Value for that + // field back into this function. + switch typedYAMLObj := yamlObj.(type) { + case map[interface{}]interface{}: + // JSON does not support arbitrary keys in a map, so we must convert + // these keys to strings. + // + // From my reading of go-yaml v2 (specifically the resolve function), + // keys can only have the types string, int, int64, float64, binary + // (unsupported), or null (unsupported). + strMap := make(map[string]interface{}) + for k, v := range typedYAMLObj { + // Resolve the key to a string first. + var keyString string + switch typedKey := k.(type) { + case string: + keyString = typedKey + case int: + keyString = strconv.Itoa(typedKey) + case int64: + // go-yaml will only return an int64 as a key if the system + // architecture is 32-bit and the key's value is between 32-bit + // and 64-bit. Otherwise the key type will simply be int. + keyString = strconv.FormatInt(typedKey, 10) + case float64: + // Stolen from go-yaml to use the same conversion to string as + // the go-yaml library uses to convert float to string when + // Marshaling. + s := strconv.FormatFloat(typedKey, 'g', -1, 32) + switch s { + case "+Inf": + s = ".inf" + case "-Inf": + s = "-.inf" + case "NaN": + s = ".nan" + } + keyString = s + case bool: + if typedKey { + keyString = "true" + } else { + keyString = "false" + } + default: + return nil, fmt.Errorf("Unsupported map key of type: %s, key: %+#v, value: %+#v", + reflect.TypeOf(k), k, v) + } + + // jsonTarget should be a struct or a map. If it's a struct, find + // the field it's going to map to and pass its reflect.Value. If + // it's a map, find the element type of the map and pass the + // reflect.Value created from that type. If it's neither, just pass + // nil - JSON conversion will error for us if it's a real issue. + if jsonTarget != nil { + t := *jsonTarget + if t.Kind() == reflect.Struct { + keyBytes := []byte(keyString) + // Find the field that the JSON library would use. + var f *field + fields := cachedTypeFields(t.Type()) + for i := range fields { + ff := &fields[i] + if bytes.Equal(ff.nameBytes, keyBytes) { + f = ff + break + } + // Do case-insensitive comparison. + if f == nil && ff.equalFold(ff.nameBytes, keyBytes) { + f = ff + } + } + if f != nil { + // Find the reflect.Value of the most preferential + // struct field. + jtf := t.Field(f.index[0]) + strMap[keyString], err = convertToJSONableObject(v, &jtf) + if err != nil { + return nil, err + } + continue + } + } else if t.Kind() == reflect.Map { + // Create a zero value of the map's element type to use as + // the JSON target. + jtv := reflect.Zero(t.Type().Elem()) + strMap[keyString], err = convertToJSONableObject(v, &jtv) + if err != nil { + return nil, err + } + continue + } + } + strMap[keyString], err = convertToJSONableObject(v, nil) + if err != nil { + return nil, err + } + } + return strMap, nil + case []interface{}: + // We need to recurse into arrays in case there are any + // map[interface{}]interface{}'s inside and to convert any + // numbers to strings. + + // If jsonTarget is a slice (which it really should be), find the + // thing it's going to map to. If it's not a slice, just pass nil + // - JSON conversion will error for us if it's a real issue. + var jsonSliceElemValue *reflect.Value + if jsonTarget != nil { + t := *jsonTarget + if t.Kind() == reflect.Slice { + // By default slices point to nil, but we need a reflect.Value + // pointing to a value of the slice type, so we create one here. + ev := reflect.Indirect(reflect.New(t.Type().Elem())) + jsonSliceElemValue = &ev + } + } + + // Make and use a new array. + arr := make([]interface{}, len(typedYAMLObj)) + for i, v := range typedYAMLObj { + arr[i], err = convertToJSONableObject(v, jsonSliceElemValue) + if err != nil { + return nil, err + } + } + return arr, nil + default: + // If the target type is a string and the YAML type is a number, + // convert the YAML type to a string. + if jsonTarget != nil && (*jsonTarget).Kind() == reflect.String { + // Based on my reading of go-yaml, it may return int, int64, + // float64, or uint64. + var s string + switch typedVal := typedYAMLObj.(type) { + case int: + s = strconv.FormatInt(int64(typedVal), 10) + case int64: + s = strconv.FormatInt(typedVal, 10) + case float64: + s = strconv.FormatFloat(typedVal, 'g', -1, 32) + case uint64: + s = strconv.FormatUint(typedVal, 10) + case bool: + if typedVal { + s = "true" + } else { + s = "false" + } + } + if len(s) > 0 { + yamlObj = interface{}(s) + } + } + return yamlObj, nil + } +} diff --git a/vendor/sigs.k8s.io/yaml/yaml_go110.go b/vendor/sigs.k8s.io/yaml/yaml_go110.go new file mode 100644 index 0000000000..ab3e06a222 --- /dev/null +++ b/vendor/sigs.k8s.io/yaml/yaml_go110.go @@ -0,0 +1,14 @@ +// This file contains changes that are only compatible with go 1.10 and onwards. + +// +build go1.10 + +package yaml + +import "encoding/json" + +// DisallowUnknownFields configures the JSON decoder to error out if unknown +// fields come along, instead of dropping them by default. +func DisallowUnknownFields(d *json.Decoder) *json.Decoder { + d.DisallowUnknownFields() + return d +}