Skip to content

Commit f1fa408

Browse files
committed
Use sigs.k8s.io/yaml instead of gopkg.in/yaml
Since we have a Kubernetes-specific fork of go-yaml, use that consistently throughout the project. This doesn't eliminate the dependencies on gopkg.in/yaml, which are still used indirectly; but it ensures that the whole project benefits from fixes or changes to sigs.k8s.io/yaml. Signed-off-by: Stephen Kitt <[email protected]>
1 parent aca3214 commit f1fa408

File tree

27 files changed

+33
-34
lines changed

27 files changed

+33
-34
lines changed

cmd/genyaml/gen_kubectl_yaml.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ import (
2525

2626
"github.com/spf13/cobra"
2727
"github.com/spf13/pflag"
28-
"gopkg.in/yaml.v2"
28+
2929
"k8s.io/cli-runtime/pkg/genericiooptions"
3030
"k8s.io/kubectl/pkg/cmd"
3131
"k8s.io/kubernetes/cmd/genutils"
32+
yaml "sigs.k8s.io/yaml/goyaml.v2"
3233
)
3334

3435
type cmdOption struct {

cmd/importverifier/importverifier.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
"path/filepath"
2828
"strings"
2929

30-
"gopkg.in/yaml.v2"
30+
yaml "sigs.k8s.io/yaml/goyaml.v2"
3131
)
3232

3333
// Package is a subset of cmd/go.Package

cmd/kubelet/app/server_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ import (
2424
"time"
2525

2626
"github.com/stretchr/testify/require"
27-
"gopkg.in/yaml.v2"
2827

2928
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3029
"k8s.io/kubernetes/cmd/kubelet/app/options"
3130
kubeletconfiginternal "k8s.io/kubernetes/pkg/kubelet/apis/config"
31+
yaml "sigs.k8s.io/yaml/goyaml.v2"
3232
)
3333

3434
func TestValueOfAllocatableResources(t *testing.T) {

cmd/yamlfmt/yamlfmt.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"io"
2323
"os"
2424

25-
"gopkg.in/yaml.v3"
25+
yaml "sigs.k8s.io/yaml/goyaml.v3"
2626
)
2727

2828
func main() {

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ require (
8686
google.golang.org/protobuf v1.34.2
8787
gopkg.in/evanphx/json-patch.v4 v4.12.0
8888
gopkg.in/square/go-jose.v2 v2.6.0
89-
gopkg.in/yaml.v2 v2.4.0
90-
gopkg.in/yaml.v3 v3.0.1
9189
k8s.io/api v0.0.0
9290
k8s.io/apiextensions-apiserver v0.0.0
9391
k8s.io/apimachinery v0.0.0
@@ -221,6 +219,8 @@ require (
221219
google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect
222220
gopkg.in/inf.v0 v0.9.1 // indirect
223221
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
222+
gopkg.in/yaml.v2 v2.4.0 // indirect
223+
gopkg.in/yaml.v3 v3.0.1 // indirect
224224
k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9 // indirect
225225
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 // indirect
226226
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect

staging/src/k8s.io/apiextensions-apiserver/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ require (
2424
google.golang.org/grpc v1.65.0
2525
google.golang.org/protobuf v1.34.2
2626
gopkg.in/evanphx/json-patch.v4 v4.12.0
27-
gopkg.in/yaml.v2 v2.4.0
2827
k8s.io/api v0.0.0
2928
k8s.io/apimachinery v0.0.0
3029
k8s.io/apiserver v0.0.0
@@ -121,6 +120,7 @@ require (
121120
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
122121
gopkg.in/inf.v0 v0.9.1 // indirect
123122
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
123+
gopkg.in/yaml.v2 v2.4.0 // indirect
124124
gopkg.in/yaml.v3 v3.0.1 // indirect
125125
k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9 // indirect
126126
k8s.io/kms v0.0.0 // indirect

staging/src/k8s.io/apiextensions-apiserver/pkg/controller/openapi/v2/conversion_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ import (
2828
openapi_v2 "github.com/google/gnostic-models/openapiv2"
2929
"github.com/google/go-cmp/cmp"
3030
fuzz "github.com/google/gofuzz"
31-
"gopkg.in/yaml.v2"
3231

3332
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions"
3433
apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
3534
structuralschema "k8s.io/apiextensions-apiserver/pkg/apiserver/schema"
3635
"k8s.io/kube-openapi/pkg/util/proto"
3736
"k8s.io/kube-openapi/pkg/validation/spec"
3837
"k8s.io/utils/pointer"
38+
yaml "sigs.k8s.io/yaml/goyaml.v2"
3939
)
4040

4141
func Test_ConvertJSONSchemaPropsToOpenAPIv2Schema(t *testing.T) {

staging/src/k8s.io/cli-runtime/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ require (
1818
golang.org/x/sync v0.8.0
1919
golang.org/x/text v0.17.0
2020
gopkg.in/evanphx/json-patch.v4 v4.12.0
21-
gopkg.in/yaml.v2 v2.4.0
2221
k8s.io/api v0.0.0
2322
k8s.io/apimachinery v0.0.0
2423
k8s.io/client-go v0.0.0
@@ -68,6 +67,7 @@ require (
6867
golang.org/x/time v0.3.0 // indirect
6968
google.golang.org/protobuf v1.34.2 // indirect
7069
gopkg.in/inf.v0 v0.9.1 // indirect
70+
gopkg.in/yaml.v2 v2.4.0 // indirect
7171
gopkg.in/yaml.v3 v3.0.1 // indirect
7272
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
7373
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect

staging/src/k8s.io/cli-runtime/pkg/resource/query_param_verifier.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ import (
2121
"fmt"
2222

2323
openapi_v2 "github.com/google/gnostic-models/openapiv2"
24-
yaml "gopkg.in/yaml.v2"
2524

2625
"k8s.io/apimachinery/pkg/runtime/schema"
2726
"k8s.io/client-go/discovery"
2827
"k8s.io/client-go/dynamic"
28+
yaml "sigs.k8s.io/yaml/goyaml.v2"
2929
)
3030

3131
func NewQueryParamVerifier(dynamicClient dynamic.Interface, openAPIGetter discovery.OpenAPISchemaInterface, queryParam VerifiableQueryParam) *QueryParamVerifier {

staging/src/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/internal.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ package generators
1919
import (
2020
"io"
2121

22-
"gopkg.in/yaml.v2"
23-
24-
"k8s.io/kube-openapi/pkg/schemaconv"
25-
2622
"k8s.io/gengo/v2/generator"
2723
"k8s.io/gengo/v2/namer"
2824
"k8s.io/gengo/v2/types"
25+
"k8s.io/kube-openapi/pkg/schemaconv"
26+
yaml "sigs.k8s.io/yaml/goyaml.v2"
2927
)
3028

3129
// utilGenerator generates the ForKind() utility function.

0 commit comments

Comments
 (0)