Skip to content

Commit e3434e5

Browse files
authored
Merge pull request kubernetes#3415 from tghartland/fix-gophercloud-copy
Fix module path in local gophercloud copy
2 parents b13e8de + 0260879 commit e3434e5

File tree

7 files changed

+65
-18
lines changed

7 files changed

+65
-18
lines changed

cluster-autoscaler/cloudprovider/magnum/gophercloud/.zuul.yaml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,26 +76,13 @@
7676
global_env:
7777
OS_BRANCH: stable/newton
7878

79-
- job:
80-
name: gophercloud-acceptance-test-mitaka
81-
parent: gophercloud-acceptance-test
82-
description: |
83-
Run gophercloud acceptance test on mitaka branch
84-
vars:
85-
global_env:
86-
OS_BRANCH: stable/mitaka
87-
nodeset: ubuntu-trusty
88-
8979
- project:
9080
name: gophercloud/gophercloud
9181
check:
9282
jobs:
9383
- gophercloud-unittest
9484
- gophercloud-acceptance-test
9585
- gophercloud-acceptance-test-ironic
96-
recheck-mitaka:
97-
jobs:
98-
- gophercloud-acceptance-test-mitaka
9986
recheck-newton:
10087
jobs:
10188
- gophercloud-acceptance-test-newton

cluster-autoscaler/cloudprovider/magnum/gophercloud/CHANGELOG.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
## 0.8.0 (Unreleased)
1+
## 0.9.0 (Unreleased)
2+
3+
## 0.8.0 (February 8, 2020)
4+
5+
UPGRADE NOTES
6+
7+
* The behavior of `keymanager/v1/acls.SetOpts` has changed. Instead of a struct, it is now `[]SetOpt`. See [GH-1816](https://github.com/gophercloud/gophercloud/pull/1816) for implementation details.
28

39
IMPROVEMENTS
410

@@ -8,6 +14,32 @@ IMPROVEMENTS
814
* Added `compute/v2/extensions/shelveunshelve.Unshelve` [GH-1799](https://github.com/gophercloud/gophercloud/pull/1799)
915
* Added `containerinfra/v1/nodegroups.Get` [GH-1774](https://github.com/gophercloud/gophercloud/pull/1774)
1016
* Added `containerinfra/v1/nodegroups.List` [GH-1774](https://github.com/gophercloud/gophercloud/pull/1774)
17+
* Added `orchestration/v1/resourcetypes.List` [GH-1806](https://github.com/gophercloud/gophercloud/pull/1806)
18+
* Added `orchestration/v1/resourcetypes.GetSchema` [GH-1806](https://github.com/gophercloud/gophercloud/pull/1806)
19+
* Added `orchestration/v1/resourcetypes.GenerateTemplate` [GH-1806](https://github.com/gophercloud/gophercloud/pull/1806)
20+
* Added `keymanager/v1/acls.SetOpt` and changed `keymanager/v1/acls.SetOpts` to `[]SetOpt` [GH-1816](https://github.com/gophercloud/gophercloud/pull/1816)
21+
* Added `blockstorage/apiversions.List` [GH-458](https://github.com/gophercloud/gophercloud/pull/458)
22+
* Added `blockstorage/apiversions.Get` [GH-458](https://github.com/gophercloud/gophercloud/pull/458)
23+
* Added `StatusCodeError` interface and `GetStatusCode` convenience method [GH-1820](https://github.com/gophercloud/gophercloud/pull/1820)
24+
* Added pagination support to `compute/v2/extensions/usage.SingleTenant` [GH-1819](https://github.com/gophercloud/gophercloud/pull/1819)
25+
* Added pagination support to `compute/v2/extensions/usage.AllTenants` [GH-1819](https://github.com/gophercloud/gophercloud/pull/1819)
26+
* Added `placement/v1/resourceproviders.List` [GH-1815](https://github.com/gophercloud/gophercloud/pull/1815)
27+
* Allow `CreateMemberOptsBuilder` to be passed in `loadbalancer/v2/pools.Create` [GH-1822](https://github.com/gophercloud/gophercloud/pull/1822)
28+
* Added `Backup` to `loadbalancer/v2/pools.CreateMemberOpts` [GH-1824](https://github.com/gophercloud/gophercloud/pull/1824)
29+
* Added `MonitorAddress` to `loadbalancer/v2/pools.CreateMemberOpts` [GH-1824](https://github.com/gophercloud/gophercloud/pull/1824)
30+
* Added `MonitorPort` to `loadbalancer/v2/pools.CreateMemberOpts` [GH-1824](https://github.com/gophercloud/gophercloud/pull/1824)
31+
* Changed `Impersonation` to a non-required field in `identity/v3/extensions/trusts.CreateOpts` [GH-1818](https://github.com/gophercloud/gophercloud/pull/1818)
32+
* Added `InsertHeaders` to `loadbalancer/v2/listeners.UpdateOpts` [GH-1835]
33+
* Added `NUMATopology` to `baremetalintrospection/v1/introspection.Data` [GH-1842](https://github.com/gophercloud/gophercloud/pull/1842)
34+
* Added `placement/v1/resourceproviders.Create` [GH-1841](https://github.com/gophercloud/gophercloud/pull/1841)
35+
36+
BUG FIXES
37+
38+
* Changed `sort_key` to `sort_keys` in ` workflow/v2/crontriggers.ListOpts` [GH-1809](https://github.com/gophercloud/gophercloud/pull/1809)
39+
* Allow `blockstorage/extensions/schedulerstats.Capabilities.MaxOverSubscriptionRatio` to accept both string and int/float responses [GH-1817](https://github.com/gophercloud/gophercloud/pull/1817)
40+
* Fixed bug in `NewLoadBalancerV2` for situations when the LBaaS service was advertised without a `/v2.0` endpoint [GH-1829](https://github.com/gophercloud/gophercloud/pull/1829)
41+
* Fixed JSON tags in `baremetal/v1/ports.UpdateOperation` [GH-1840](https://github.com/gophercloud/gophercloud/pull/1840)
42+
* Fixed JSON tags in `networking/v2/extensions/lbaas/vips.commonResult.Extract()` [GH-1840](https://github.com/gophercloud/gophercloud/pull/1840)
1143

1244
## 0.7.0 (December 3, 2019)
1345

cluster-autoscaler/cloudprovider/magnum/gophercloud/errors.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,23 @@ func (e ErrUnexpectedResponseCode) Error() string {
9292
return e.choseErrString()
9393
}
9494

95+
// GetStatusCode returns the actual status code of the error.
96+
func (e ErrUnexpectedResponseCode) GetStatusCode() int {
97+
return e.Actual
98+
}
99+
100+
// StatusCodeError is a convenience interface to easily allow access to the
101+
// status code field of the various ErrDefault* types.
102+
//
103+
// By using this interface, you only have to make a single type cast of
104+
// the returned error to err.(StatusCodeError) and then call GetStatusCode()
105+
// instead of having a large switch statement checking for each of the
106+
// ErrDefault* types.
107+
type StatusCodeError interface {
108+
Error() string
109+
GetStatusCode() int
110+
}
111+
95112
// ErrDefault400 is the default error type returned on a 400 HTTP response code.
96113
type ErrDefault400 struct {
97114
ErrUnexpectedResponseCode

cluster-autoscaler/cloudprovider/magnum/gophercloud/go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/gophercloud/gophercloud
1+
module k8s.io/autoscaler/cluster-autoscaler/cloudprovider/magnum/gophercloud
22

33
require (
44
golang.org/x/crypto v0.0.0-20191202143827-86a70503ff7e
@@ -11,3 +11,4 @@ require (
1111
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
1212
gopkg.in/yaml.v2 v2.2.7
1313
)
14+

cluster-autoscaler/cloudprovider/magnum/gophercloud/openstack/client.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package openstack
33
import (
44
"fmt"
55
"reflect"
6+
"strings"
67

78
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/magnum/gophercloud"
89
tokens2 "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/magnum/gophercloud/openstack/identity/v2/tokens"
@@ -432,7 +433,11 @@ func NewImageServiceV2(client *gophercloud.ProviderClient, eo gophercloud.Endpoi
432433
// load balancer service.
433434
func NewLoadBalancerV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) {
434435
sc, err := initClientOpts(client, eo, "load-balancer")
435-
sc.ResourceBase = sc.Endpoint + "v2.0/"
436+
437+
// Fixes edge case having an OpenStack lb endpoint with trailing version number.
438+
endpoint := strings.Replace(sc.Endpoint, "v2.0/", "", -1)
439+
440+
sc.ResourceBase = endpoint + "v2.0/"
436441
return sc, err
437442
}
438443

@@ -473,3 +478,8 @@ func NewContainerInfraV1(client *gophercloud.ProviderClient, eo gophercloud.Endp
473478
func NewWorkflowV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) {
474479
return initClientOpts(client, eo, "workflowv2")
475480
}
481+
482+
// NewPlacementV1 creates a ServiceClient that may be used with the placement package.
483+
func NewPlacementV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) {
484+
return initClientOpts(client, eo, "placement")
485+
}

cluster-autoscaler/cloudprovider/magnum/gophercloud/openstack/identity/v3/extensions/trusts/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Example to Create a Trust
3838
},
3939
TrusteeUserID: "ecb37e88cc86431c99d0332208cb6fbf",
4040
TrustorUserID: "959ed913a32c4ec88c041c98e61cbbc3",
41-
}
41+
}
4242
4343
trust, err := trusts.Create(identityClient, createOpts).Extract()
4444
if err != nil {

cluster-autoscaler/cloudprovider/magnum/gophercloud/openstack/identity/v3/extensions/trusts/requests.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ type CreateOptsBuilder interface {
5252
// CreateOpts provides options used to create a new trust.
5353
type CreateOpts struct {
5454
// Impersonation allows the trustee to impersonate the trustor.
55-
Impersonation bool `json:"impersonation" required:"true"`
55+
Impersonation bool `json:"impersonation"`
5656

5757
// TrusteeUserID is a user who is capable of consuming the trust.
5858
TrusteeUserID string `json:"trustee_user_id" required:"true"`

0 commit comments

Comments
 (0)