From dff53c69d3464fc5709b6630277ed054fd66a173 Mon Sep 17 00:00:00 2001 From: Mikel Olasagasti Uranga Date: Wed, 10 Apr 2024 11:23:22 +0200 Subject: [PATCH] Update dependency to gopkg.in/yaml.v3 The changes in the test are required because since commit https://github.com/go-yaml/yaml/commit/ae27a744346343ea814bd6f3bdd41d8669b172d0 that was released in 3.0.0 causes extra whitespaces in the output. Signed-off-by: Mikel Olasagasti Uranga --- go.mod | 2 +- go.sum | 4 +-- openstack/clientconfig/requests.go | 2 +- .../clientconfig/testing/requests_test.go | 2 +- .../clientconfig/testing/results_test.go | 36 +++++++++---------- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/go.mod b/go.mod index eb67428..b7ed9cc 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/mitchellh/go-homedir v1.1.0 golang.org/x/sys v0.19.0 golang.org/x/text v0.14.0 - gopkg.in/yaml.v2 v2.4.0 + gopkg.in/yaml.v3 v3.0.1 ) go 1.21.6 diff --git a/go.sum b/go.sum index 8380572..886e1a7 100644 --- a/go.sum +++ b/go.sum @@ -10,5 +10,5 @@ golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/openstack/clientconfig/requests.go b/openstack/clientconfig/requests.go index 133fe0f..c8f1808 100644 --- a/openstack/clientconfig/requests.go +++ b/openstack/clientconfig/requests.go @@ -16,7 +16,7 @@ import ( "github.com/gophercloud/utils/v2/internal" "github.com/hashicorp/go-uuid" - yaml "gopkg.in/yaml.v2" + yaml "gopkg.in/yaml.v3" ) // AuthType respresents a valid method of authentication. diff --git a/openstack/clientconfig/testing/requests_test.go b/openstack/clientconfig/testing/requests_test.go index 29ac5d4..a42dba8 100644 --- a/openstack/clientconfig/testing/requests_test.go +++ b/openstack/clientconfig/testing/requests_test.go @@ -10,7 +10,7 @@ import ( "github.com/gophercloud/utils/v2/openstack/clientconfig" th "github.com/gophercloud/gophercloud/v2/testhelper" - yaml "gopkg.in/yaml.v2" + yaml "gopkg.in/yaml.v3" ) func TestGetCloudFromYAML(t *testing.T) { diff --git a/openstack/clientconfig/testing/results_test.go b/openstack/clientconfig/testing/results_test.go index 61103d3..0149190 100644 --- a/openstack/clientconfig/testing/results_test.go +++ b/openstack/clientconfig/testing/results_test.go @@ -6,30 +6,30 @@ import ( "github.com/gophercloud/utils/v2/openstack/clientconfig" th "github.com/gophercloud/gophercloud/v2/testhelper" - yaml "gopkg.in/yaml.v2" + yaml "gopkg.in/yaml.v3" ) var VirginiaExpected = `clouds: - virginia: - auth: - auth_url: https://va.example.com:5000/v3 - application_credential_id: app-cred-id - application_credential_secret: secret - auth_type: v3applicationcredential - region_name: VA - verify: true + virginia: + auth: + auth_url: https://va.example.com:5000/v3 + application_credential_id: app-cred-id + application_credential_secret: secret + auth_type: v3applicationcredential + region_name: VA + verify: true ` var HawaiiExpected = `clouds: - hawaii: - auth: - auth_url: https://hi.example.com:5000/v3 - username: jdoe - password: password - project_name: Some Project - domain_name: default - region_name: HNL - verify: true + hawaii: + auth: + auth_url: https://hi.example.com:5000/v3 + username: jdoe + password: password + project_name: Some Project + domain_name: default + region_name: HNL + verify: true ` func TestMarshallCloudToYaml(t *testing.T) {