From 6d8498bfc0b3680a9f4695c318b7a266cea6fee8 Mon Sep 17 00:00:00 2001 From: Eng Zer Jun Date: Sun, 26 Mar 2023 23:40:06 +0800 Subject: [PATCH] chore(deps): replace `github.com/ghodss/yaml` with `sigs.k8s.io/yaml` At the time of making this commit, the package `github.com/ghodss/yaml` is no longer actively maintained. `sigs.k8s.io/yaml` is a permanent fork of `ghodss/yaml` and is actively maintained by Kubernetes SIG. Signed-off-by: Eng Zer Jun --- controller/metrics/analysis_test.go | 2 +- controller/metrics/experiment_test.go | 2 +- controller/metrics/rollout_test.go | 2 +- go.mod | 22 ++++++++----------- hack/gen-crd-spec/main.go | 2 +- .../cmd/create/create.go | 4 ++-- pkg/kubectl-argo-rollouts/cmd/lint/lint.go | 2 +- .../info/testdata/testdata.go | 2 +- rollout/controller_test.go | 2 +- test/fixtures/common.go | 2 +- test/fixtures/given.go | 2 +- test/fixtures/when.go | 2 +- test/util/util.go | 2 +- utils/config/config.go | 2 +- utils/replicaset/replicaset_test.go | 2 +- utils/unstructured/unstructured.go | 2 +- 16 files changed, 25 insertions(+), 29 deletions(-) diff --git a/controller/metrics/analysis_test.go b/controller/metrics/analysis_test.go index 942c165209..fb033e776d 100644 --- a/controller/metrics/analysis_test.go +++ b/controller/metrics/analysis_test.go @@ -7,10 +7,10 @@ import ( "github.com/stretchr/testify/assert" - "github.com/ghodss/yaml" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/yaml" "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1" ) diff --git a/controller/metrics/experiment_test.go b/controller/metrics/experiment_test.go index 4335af6fe0..5694fc9830 100644 --- a/controller/metrics/experiment_test.go +++ b/controller/metrics/experiment_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/ghodss/yaml" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/yaml" "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1" "github.com/prometheus/client_golang/prometheus" diff --git a/controller/metrics/rollout_test.go b/controller/metrics/rollout_test.go index dd48969e52..17f86b011f 100644 --- a/controller/metrics/rollout_test.go +++ b/controller/metrics/rollout_test.go @@ -5,10 +5,10 @@ import ( "testing" "time" - "github.com/ghodss/yaml" "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/yaml" "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1" "github.com/argoproj/argo-rollouts/utils/conditions" diff --git a/go.mod b/go.mod index 3f1d99f46c..31023ef028 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,6 @@ require ( github.com/blang/semver v3.5.1+incompatible github.com/bombsimon/logrusr/v4 v4.0.0 github.com/evanphx/json-patch/v5 v5.6.0 - github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 github.com/gogo/protobuf v1.3.2 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.3 @@ -21,6 +20,7 @@ require ( github.com/hashicorp/go-plugin v1.4.9 github.com/influxdata/influxdb-client-go/v2 v2.12.3 github.com/juju/ansiterm v1.0.0 + github.com/machinebox/graphql v0.2.2 github.com/mitchellh/mapstructure v1.5.0 github.com/newrelic/newrelic-client-go v1.1.0 github.com/pkg/errors v0.9.1 @@ -53,16 +53,7 @@ require ( k8s.io/kubectl v0.24.2 k8s.io/kubernetes v1.24.2 k8s.io/utils v0.0.0-20220706174534-f6158b442e7c - -) - -require ( - github.com/PagerDuty/go-pagerduty v1.6.0 // indirect - github.com/bradleyfalzon/ghinstallation/v2 v2.1.0 // indirect - github.com/go-telegram-bot-api/telegram-bot-api/v5 v5.5.1 // indirect - github.com/google/go-github/v41 v41.0.0 // indirect - github.com/google/go-github/v45 v45.2.0 // indirect - github.com/matryer/is v1.4.0 // indirect + sigs.k8s.io/yaml v1.3.0 ) require ( @@ -79,6 +70,7 @@ require ( github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/semver v1.5.0 // indirect github.com/Masterminds/sprig v2.22.0+incompatible // indirect + github.com/PagerDuty/go-pagerduty v1.6.0 // indirect github.com/RocketChat/Rocket.Chat.Go.SDK v0.0.0-20220708192748-b73dcb041214 // indirect github.com/aws/aws-sdk-go v1.44.39 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.13.20 // indirect @@ -93,6 +85,7 @@ require ( github.com/aws/smithy-go v1.13.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect + github.com/bradleyfalzon/ghinstallation/v2 v2.1.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5 // indirect github.com/davecgh/go-spew v1.1.1 // indirect @@ -103,17 +96,21 @@ require ( github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect github.com/fatih/color v1.7.0 // indirect github.com/felixge/httpsnoop v1.0.3 // indirect + github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 // indirect github.com/go-errors/errors v1.4.2 // indirect github.com/go-logr/logr v1.2.4 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/jsonreference v0.20.0 // indirect github.com/go-openapi/swag v0.21.1 // indirect + github.com/go-telegram-bot-api/telegram-bot-api/v5 v5.5.1 // indirect github.com/golang-jwt/jwt/v4 v4.4.3 // indirect github.com/golang/glog v1.0.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/google/btree v1.1.2 // indirect github.com/google/gnostic v0.6.9 // indirect github.com/google/go-cmp v0.5.9 // indirect + github.com/google/go-github/v41 v41.0.0 // indirect + github.com/google/go-github/v45 v45.2.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect @@ -135,8 +132,8 @@ require ( github.com/json-iterator/go v1.1.12 // indirect github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect github.com/lunixbochs/vtclean v1.0.0 // indirect - github.com/machinebox/graphql v0.2.2 github.com/mailru/easyjson v0.7.7 // indirect + github.com/matryer/is v1.4.0 // indirect github.com/mattn/go-colorable v0.1.12 // indirect github.com/mattn/go-isatty v0.0.14 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect @@ -191,7 +188,6 @@ require ( sigs.k8s.io/kustomize/api v0.11.5 // indirect sigs.k8s.io/kustomize/kyaml v0.13.7 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect ) replace ( diff --git a/hack/gen-crd-spec/main.go b/hack/gen-crd-spec/main.go index 89f8cb59a9..aa615687d9 100644 --- a/hack/gen-crd-spec/main.go +++ b/hack/gen-crd-spec/main.go @@ -13,11 +13,11 @@ import ( unstructuredutil "github.com/argoproj/argo-rollouts/utils/unstructured" "github.com/blang/semver" - "github.com/ghodss/yaml" extensionsobj "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" kubeopenapiutil "k8s.io/kube-openapi/pkg/util" spec "k8s.io/kube-openapi/pkg/validation/spec" + "sigs.k8s.io/yaml" ) const metadataValidation = `properties: diff --git a/pkg/kubectl-argo-rollouts/cmd/create/create.go b/pkg/kubectl-argo-rollouts/cmd/create/create.go index f00f4ebd86..f5dccb4932 100644 --- a/pkg/kubectl-argo-rollouts/cmd/create/create.go +++ b/pkg/kubectl-argo-rollouts/cmd/create/create.go @@ -10,12 +10,12 @@ import ( "strings" "unicode" - "github.com/ghodss/yaml" "github.com/spf13/cobra" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/pointer" + "sigs.k8s.io/yaml" "github.com/argoproj/argo-rollouts/pkg/apis/rollouts" "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1" @@ -54,7 +54,7 @@ const ( createAnalysisRunExample = ` # Create an AnalysisRun from a local AnalysisTemplate file %[1]s create analysisrun --from-file my-analysis-template.yaml - + # Create an AnalysisRun from a AnalysisTemplate in the cluster %[1]s create analysisrun --from my-analysis-template diff --git a/pkg/kubectl-argo-rollouts/cmd/lint/lint.go b/pkg/kubectl-argo-rollouts/cmd/lint/lint.go index d31c5d3547..cf1b3cdb36 100644 --- a/pkg/kubectl-argo-rollouts/cmd/lint/lint.go +++ b/pkg/kubectl-argo-rollouts/cmd/lint/lint.go @@ -11,7 +11,6 @@ import ( "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/validation" "github.com/argoproj/argo-rollouts/pkg/kubectl-argo-rollouts/options" ingressutil "github.com/argoproj/argo-rollouts/utils/ingress" - "github.com/ghodss/yaml" "github.com/spf13/cobra" goyaml "gopkg.in/yaml.v2" v1 "k8s.io/api/core/v1" @@ -19,6 +18,7 @@ import ( networkingv1 "k8s.io/api/networking/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/util/validation/field" + "sigs.k8s.io/yaml" ) type LintOptions struct { diff --git a/pkg/kubectl-argo-rollouts/info/testdata/testdata.go b/pkg/kubectl-argo-rollouts/info/testdata/testdata.go index a0f5911998..c455392f61 100644 --- a/pkg/kubectl-argo-rollouts/info/testdata/testdata.go +++ b/pkg/kubectl-argo-rollouts/info/testdata/testdata.go @@ -6,11 +6,11 @@ import ( "runtime" "time" - "github.com/ghodss/yaml" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" k8sruntime "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/yaml" "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1" ) diff --git a/rollout/controller_test.go b/rollout/controller_test.go index a0177abccc..00f811617c 100644 --- a/rollout/controller_test.go +++ b/rollout/controller_test.go @@ -11,7 +11,6 @@ import ( "testing" "time" - "github.com/ghodss/yaml" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" appsv1 "k8s.io/api/apps/v1" @@ -36,6 +35,7 @@ import ( "k8s.io/client-go/util/workqueue" corev1defaults "k8s.io/kubernetes/pkg/apis/core/v1" "k8s.io/utils/pointer" + "sigs.k8s.io/yaml" "github.com/argoproj/argo-rollouts/controller/metrics" "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1" diff --git a/test/fixtures/common.go b/test/fixtures/common.go index 6ca0619d59..c16df649e3 100644 --- a/test/fixtures/common.go +++ b/test/fixtures/common.go @@ -14,7 +14,6 @@ import ( a6util "github.com/argoproj/argo-rollouts/utils/apisix" - "github.com/ghodss/yaml" smiv1alpha1 "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/split/v1alpha1" smiclientset "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/split/clientset/versioned" "github.com/sirupsen/logrus" @@ -31,6 +30,7 @@ import ( "k8s.io/cli-runtime/pkg/genericclioptions" "k8s.io/client-go/dynamic" "k8s.io/client-go/kubernetes" + "sigs.k8s.io/yaml" "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1" rov1 "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1" diff --git a/test/fixtures/given.go b/test/fixtures/given.go index 5ecdcee3d3..19e7552f60 100644 --- a/test/fixtures/given.go +++ b/test/fixtures/given.go @@ -4,9 +4,9 @@ import ( "context" "strings" - "github.com/ghodss/yaml" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/yaml" rov1 "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1" ) diff --git a/test/fixtures/when.go b/test/fixtures/when.go index 40998dc73f..dbb90fc49e 100644 --- a/test/fixtures/when.go +++ b/test/fixtures/when.go @@ -9,7 +9,6 @@ import ( "strconv" "time" - "github.com/ghodss/yaml" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -23,6 +22,7 @@ import ( "k8s.io/client-go/tools/cache" watchutil "k8s.io/client-go/tools/watch" retryutil "k8s.io/client-go/util/retry" + "sigs.k8s.io/yaml" "github.com/argoproj/argo-rollouts/pkg/apiclient/rollout" rov1 "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1" diff --git a/test/util/util.go b/test/util/util.go index 9868da6bff..071aca3f7b 100644 --- a/test/util/util.go +++ b/test/util/util.go @@ -3,11 +3,11 @@ package util import ( "os" - "github.com/ghodss/yaml" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" dynamicfake "k8s.io/client-go/dynamic/fake" + "sigs.k8s.io/yaml" "github.com/argoproj/argo-rollouts/pkg/apis/rollouts" "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1" diff --git a/utils/config/config.go b/utils/config/config.go index a7338cf2ab..7989374e8e 100644 --- a/utils/config/config.go +++ b/utils/config/config.go @@ -11,9 +11,9 @@ import ( "github.com/argoproj/argo-rollouts/utils/defaults" "github.com/argoproj/argo-rollouts/utils/plugin/types" - "github.com/ghodss/yaml" v1 "k8s.io/api/core/v1" k8errors "k8s.io/apimachinery/pkg/api/errors" + "sigs.k8s.io/yaml" ) // Config is the in memory representation of the configmap with some additional fields/functions for ease of use. diff --git a/utils/replicaset/replicaset_test.go b/utils/replicaset/replicaset_test.go index 5a7c7ff8c1..40c7d1ae2c 100644 --- a/utils/replicaset/replicaset_test.go +++ b/utils/replicaset/replicaset_test.go @@ -8,7 +8,6 @@ import ( "testing" "time" - "github.com/ghodss/yaml" "github.com/stretchr/testify/assert" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" @@ -19,6 +18,7 @@ import ( k8sfake "k8s.io/client-go/kubernetes/fake" "k8s.io/kubernetes/pkg/controller" "k8s.io/utils/pointer" + "sigs.k8s.io/yaml" "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1" "github.com/argoproj/argo-rollouts/utils/annotations" diff --git a/utils/unstructured/unstructured.go b/utils/unstructured/unstructured.go index 12e1034755..7c73812da3 100644 --- a/utils/unstructured/unstructured.go +++ b/utils/unstructured/unstructured.go @@ -3,10 +3,10 @@ package unstructured import ( "regexp" - "github.com/ghodss/yaml" log "github.com/sirupsen/logrus" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/yaml" "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1" logutil "github.com/argoproj/argo-rollouts/utils/log"