diff --git a/go.mod b/go.mod index 27fafbbf06c..6a83aaa7299 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,6 @@ require ( github.com/coreos/ignition/v2 v2.14.0 github.com/davecgh/go-spew v1.1.1 github.com/form3tech-oss/jwt-go v3.2.5+incompatible - github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 github.com/go-bindata/go-bindata v3.1.2+incompatible github.com/go-chi/chi/v5 v5.0.8 github.com/go-logr/logr v1.4.2 @@ -95,6 +94,7 @@ require ( k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 sigs.k8s.io/controller-runtime v0.13.1 sigs.k8s.io/controller-tools v0.9.0 + sigs.k8s.io/yaml v1.4.0 ) require ( @@ -146,6 +146,7 @@ require ( github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect github.com/fatih/color v1.15.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 // indirect github.com/go-errors/errors v1.4.2 // indirect github.com/go-jose/go-jose/v3 v3.0.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect @@ -282,7 +283,6 @@ require ( sigs.k8s.io/kustomize/api v0.12.1 // indirect sigs.k8s.io/kustomize/kyaml v0.13.9 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect - sigs.k8s.io/yaml v1.4.0 // indirect tags.cncf.io/container-device-interface v0.6.2 // indirect ) diff --git a/hack/gendevconfig/gendevconfig.go b/hack/gendevconfig/gendevconfig.go index 322f92df6f5..67a955c0372 100644 --- a/hack/gendevconfig/gendevconfig.go +++ b/hack/gendevconfig/gendevconfig.go @@ -7,8 +7,8 @@ import ( "context" "os" - "github.com/ghodss/yaml" "github.com/sirupsen/logrus" + "sigs.k8s.io/yaml" "github.com/Azure/ARO-RP/pkg/deploy" "github.com/Azure/ARO-RP/pkg/env" diff --git a/hack/genhiveconfig/genhiveconfig.go b/hack/genhiveconfig/genhiveconfig.go index 4986b710af5..f9cd4973d12 100644 --- a/hack/genhiveconfig/genhiveconfig.go +++ b/hack/genhiveconfig/genhiveconfig.go @@ -7,9 +7,9 @@ import ( "context" "os" - "github.com/ghodss/yaml" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/yaml" failure "github.com/Azure/ARO-RP/pkg/hive/failure" utillog "github.com/Azure/ARO-RP/pkg/util/log" diff --git a/hack/validate-imports/validate-imports.go b/hack/validate-imports/validate-imports.go index a0ee19a0e02..e7841d33ddd 100644 --- a/hack/validate-imports/validate-imports.go +++ b/hack/validate-imports/validate-imports.go @@ -73,8 +73,8 @@ func validateImport(imp *ast.ImportSpec) error { } switch packageName { - case "sigs.k8s.io/yaml", "gopkg.in/yaml.v2": - return fmt.Errorf("%s is imported; use github.com/ghodss/yaml", packageName) + case "github.com/ghodss/yaml", "gopkg.in/yaml.v2": + return fmt.Errorf("%s is imported; use sigs.k8s.io/yaml", packageName) case "github.com/google/uuid", "github.com/satori/go.uuid": return fmt.Errorf("%s is imported; use github.com/gofrs/uuid", packageName) } diff --git a/pkg/cluster/clusterserviceprincipal.go b/pkg/cluster/clusterserviceprincipal.go index bd26991567b..a29701a3fb8 100644 --- a/pkg/cluster/clusterserviceprincipal.go +++ b/pkg/cluster/clusterserviceprincipal.go @@ -10,12 +10,12 @@ import ( "time" mgmtauthorization "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2018-09-01-preview/authorization" - "github.com/ghodss/yaml" corev1 "k8s.io/api/core/v1" kerrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" applyv1 "k8s.io/client-go/applyconfigurations/core/v1" "k8s.io/client-go/util/retry" + "sigs.k8s.io/yaml" "github.com/Azure/ARO-RP/pkg/util/arm" "github.com/Azure/ARO-RP/pkg/util/clusterauthorizer" diff --git a/pkg/cluster/clusterserviceprincipal_test.go b/pkg/cluster/clusterserviceprincipal_test.go index 0f85431fd56..d17273094e1 100644 --- a/pkg/cluster/clusterserviceprincipal_test.go +++ b/pkg/cluster/clusterserviceprincipal_test.go @@ -13,7 +13,6 @@ import ( mgmtauthorization "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2018-09-01-preview/authorization" mgmtfeatures "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-07-01/features" "github.com/Azure/go-autorest/autorest/to" - "github.com/ghodss/yaml" "github.com/golang/mock/gomock" operatorv1 "github.com/openshift/api/operator/v1" operatorfake "github.com/openshift/client-go/operator/clientset/versioned/fake" @@ -24,6 +23,7 @@ import ( "k8s.io/client-go/kubernetes/fake" fakecorev1 "k8s.io/client-go/kubernetes/typed/core/v1/fake" ktesting "k8s.io/client-go/testing" + "sigs.k8s.io/yaml" "github.com/Azure/ARO-RP/pkg/api" "github.com/Azure/ARO-RP/pkg/util/arm" diff --git a/pkg/cluster/kubeconfig.go b/pkg/cluster/kubeconfig.go index 964c7950824..0006b6362ce 100644 --- a/pkg/cluster/kubeconfig.go +++ b/pkg/cluster/kubeconfig.go @@ -10,8 +10,8 @@ import ( "strings" "time" - "github.com/ghodss/yaml" clientcmdv1 "k8s.io/client-go/tools/clientcmd/api/v1" + "sigs.k8s.io/yaml" "github.com/Azure/ARO-RP/pkg/api" "github.com/Azure/ARO-RP/pkg/cluster/graph" diff --git a/pkg/cluster/kubeconfig_test.go b/pkg/cluster/kubeconfig_test.go index e7402eaef73..dcaca16667b 100644 --- a/pkg/cluster/kubeconfig_test.go +++ b/pkg/cluster/kubeconfig_test.go @@ -10,8 +10,8 @@ import ( "testing" "time" - "github.com/ghodss/yaml" clientcmdv1 "k8s.io/client-go/tools/clientcmd/api/v1" + "sigs.k8s.io/yaml" "github.com/Azure/ARO-RP/pkg/api" "github.com/Azure/ARO-RP/pkg/cluster/graph" diff --git a/pkg/deploy/config.go b/pkg/deploy/config.go index 2478eae2972..36589506594 100644 --- a/pkg/deploy/config.go +++ b/pkg/deploy/config.go @@ -12,8 +12,8 @@ import ( "strings" "github.com/Azure/go-autorest/autorest/to" - "github.com/ghodss/yaml" "golang.org/x/crypto/ssh" + "sigs.k8s.io/yaml" ) // NOTICE: when modifying the config definition here, don't forget to update diff --git a/pkg/operator/controllers/alertwebhook/alertwebhook_controller.go b/pkg/operator/controllers/alertwebhook/alertwebhook_controller.go index 248e84d8374..0b1f5296a65 100644 --- a/pkg/operator/controllers/alertwebhook/alertwebhook_controller.go +++ b/pkg/operator/controllers/alertwebhook/alertwebhook_controller.go @@ -7,7 +7,6 @@ import ( "context" "reflect" - "github.com/ghodss/yaml" "github.com/sirupsen/logrus" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" @@ -16,6 +15,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/reconcile" + "sigs.k8s.io/yaml" "github.com/Azure/ARO-RP/pkg/operator" arov1alpha1 "github.com/Azure/ARO-RP/pkg/operator/apis/aro.openshift.io/v1alpha1" diff --git a/pkg/operator/controllers/monitoring/monitoring_controller.go b/pkg/operator/controllers/monitoring/monitoring_controller.go index db993c4f963..1cc31dd5675 100644 --- a/pkg/operator/controllers/monitoring/monitoring_controller.go +++ b/pkg/operator/controllers/monitoring/monitoring_controller.go @@ -7,7 +7,6 @@ import ( "context" "encoding/json" - "github.com/ghodss/yaml" "github.com/sirupsen/logrus" "github.com/ugorji/go/codec" corev1 "k8s.io/api/core/v1" @@ -22,6 +21,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/source" + "sigs.k8s.io/yaml" "github.com/Azure/ARO-RP/pkg/api" "github.com/Azure/ARO-RP/pkg/operator" diff --git a/pkg/operator/controllers/muo/template_test.go b/pkg/operator/controllers/muo/template_test.go index c2ba5d42323..94ba2b4fe36 100644 --- a/pkg/operator/controllers/muo/template_test.go +++ b/pkg/operator/controllers/muo/template_test.go @@ -8,7 +8,6 @@ import ( _ "embed" "testing" - "github.com/ghodss/yaml" "github.com/go-test/deep" "github.com/golang/mock/gomock" appsv1 "k8s.io/api/apps/v1" @@ -17,6 +16,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" kruntime "k8s.io/apimachinery/pkg/runtime" ctrlfake "sigs.k8s.io/controller-runtime/pkg/client/fake" + "sigs.k8s.io/yaml" arov1alpha1 "github.com/Azure/ARO-RP/pkg/operator/apis/aro.openshift.io/v1alpha1" "github.com/Azure/ARO-RP/pkg/operator/controllers/muo/config" diff --git a/pkg/portal/kubeconfig/proxy.go b/pkg/portal/kubeconfig/proxy.go index e7eb386c20f..2b80de7a847 100644 --- a/pkg/portal/kubeconfig/proxy.go +++ b/pkg/portal/kubeconfig/proxy.go @@ -13,8 +13,8 @@ import ( "strings" "time" - "github.com/ghodss/yaml" clientcmdv1 "k8s.io/client-go/tools/clientcmd/api/v1" + "sigs.k8s.io/yaml" "github.com/Azure/ARO-RP/pkg/api" "github.com/Azure/ARO-RP/pkg/api/validate" diff --git a/pkg/util/dynamichelper/unstructuredobj.go b/pkg/util/dynamichelper/unstructuredobj.go index d39ebcc005c..eff13252a2b 100644 --- a/pkg/util/dynamichelper/unstructuredobj.go +++ b/pkg/util/dynamichelper/unstructuredobj.go @@ -6,9 +6,9 @@ package dynamichelper import ( "strings" - "github.com/ghodss/yaml" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" kruntime "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/yaml" ) // this is specifically for the Guardrails diff --git a/test/e2e/operator.go b/test/e2e/operator.go index b245476dd0a..810c7adafac 100644 --- a/test/e2e/operator.go +++ b/test/e2e/operator.go @@ -17,7 +17,6 @@ import ( mgmtnetwork "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-08-01/network" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/to" - "github.com/ghodss/yaml" configv1 "github.com/openshift/api/config/v1" machinev1beta1 "github.com/openshift/api/machine/v1beta1" cov1Helpers "github.com/openshift/library-go/pkg/config/clusteroperator/v1helpers" @@ -27,6 +26,7 @@ import ( kerrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/util/retry" + "sigs.k8s.io/yaml" apisubnet "github.com/Azure/ARO-RP/pkg/api/util/subnet" "github.com/Azure/ARO-RP/pkg/operator"