diff --git a/CHANGELOG.md b/CHANGELOG.md index d7bdf05f..d62c3cb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,10 @@ Some examples, more below in the actual changelog (newer entries are more likely * api/mock/mock_api_implementation: panic when trying to fake `ResourceWithTag` (#419, @drpsychick) +### Fixed + +* CloudDNS now consistently uses `zone_name` during requests, fixing integration tests (#429, @drpsychick) + ## [0.7.6] -- 2024-11-04 ### Added diff --git a/pkg/apis/clouddns/v1/mocks_test.go b/pkg/apis/clouddns/v1/mocks_test.go index 4652e3e0..c42debaa 100644 --- a/pkg/apis/clouddns/v1/mocks_test.go +++ b/pkg/apis/clouddns/v1/mocks_test.go @@ -141,7 +141,7 @@ func mock_update_zone(z clouddnsv1.Zone) { expectedData := struct { clouddnsv1.Zone - Name string `json:"zoneName"` + Name string `json:"zone_name"` }{ Zone: z, Name: z.Name, diff --git a/pkg/apis/clouddns/v1/zone_genclient.go b/pkg/apis/clouddns/v1/zone_genclient.go index 52f68ad8..dba34d84 100644 --- a/pkg/apis/clouddns/v1/zone_genclient.go +++ b/pkg/apis/clouddns/v1/zone_genclient.go @@ -36,11 +36,11 @@ func (z *Zone) FilterAPIRequestBody(ctx context.Context) (interface{}, error) { if err != nil { return nil, err } - // The Create and Update endpoints expect the Zone's name to be in the request body under the key "zoneName" + // The Create and Update endpoints expect the Zone's name to be in the request body under the key "zone_name" if op == types.OperationCreate || op == types.OperationUpdate { zWithZoneName := struct { Zone - ZoneName string `json:"zoneName"` + ZoneName string `json:"zone_name"` }{*z, z.Name} // `name` does not exist as a field on the Engine API for these requests, diff --git a/pkg/clouddns/zone/zone.go b/pkg/clouddns/zone/zone.go index 7995f0b5..c7c74146 100644 --- a/pkg/clouddns/zone/zone.go +++ b/pkg/clouddns/zone/zone.go @@ -55,7 +55,7 @@ type Definition struct { // Required - Zone name parameter // Parameter used for create/update/delete etc. - ZoneName string `json:"zoneName"` + ZoneName string `json:"zone_name"` // Required - Is master flag // Flag designating if CloudDNS operates as master or slave. @@ -116,7 +116,7 @@ type ResourceRecord struct { } type Create struct { - Name string `json:"zoneName"` + Name string `json:"zone_name"` Master bool `json:"master"` }