Commit Graph

382 Commits (c2b771d5c46ca3b2f58f72595fe07a4e56a63762)

Author SHA1 Message Date
FengyunPan2 0da1660653 IsNotFound should check ErrDefault404 and ErrUnexpectedResponseCode
Related to: #60658 #60976
Refer to:
  https://github.com/gophercloud/gophercloud/pull/103
2018-03-10 10:57:37 +08:00
n-marton 744ff16ced fix for openstack member cleanup for multiple port cases 2018-03-09 15:50:15 +01:00
Jesse Haka b1d1b4f811 remove filtering by instance state 2018-03-01 00:16:47 +02:00
wackxu f737ad62ed update import 2018-02-27 20:23:35 +08:00
Kubernetes Submit Queue 96ec318718
Merge pull request #59842 from ixdy/update-rules_go-02-2018
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

 Update bazelbuild/rules_go, kubernetes/repo-infra, and gazelle dependencies

**What this PR does / why we need it**: updates our bazelbuild/rules_go dependency in order to bump everything to go1.9.4. I'm separating this effort into two separate PRs, since updating rules_go requires a large cleanup, removing an attribute from most build rules.

**Release note**:

```release-note
NONE
```
2018-02-19 22:23:05 -08:00
Jeff Grafton ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
Aleksandra Malinowska 2d54ba3e0f
Revert "add node shutdown taint" 2018-02-16 12:24:27 +01:00
Kubernetes Submit Queue 27daaab224
Merge pull request #59323 from zetaab/nodetaint
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add node shutdown taint

**What this PR does / why we need it**: we need node stopped taint in order to detach volumes immediately without waiting timeout. More info in issue ticket #58635 

**Which issue(s) this PR fixes** 
Fixes #58635

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2018-02-15 09:52:10 -08:00
Kubernetes Submit Queue 0dda5c8a7b
Merge pull request #59749 from zioproto/issues/59421-CheckCIDR
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Detect CIDR IPv4 or IPv6 version to select nexthop

**What this PR does / why we need it**:

The node `InternalIP` is used as nexthop by the Kubernetes master to create routes in the Neutron router for Pods reachability.
If a node has more than one `InternalIP`s, eventually IPv4 and IPv6, a random `InternalIP` from the list is returned.
This can lead to the bug described in https://github.com/kubernetes/kubernetes/issues/59421
We need to check when we build a route that the CIDR and the nexthop belong to the same IP Address Family (both IPv4 or both IPv6)

**Which issue(s) this PR fixes** :
Fixes https://github.com/kubernetes/kubernetes/issues/59421
It is related to https://github.com/kubernetes/kubernetes/issues/55202

**Special notes for your reviewer**:
This is the suggested way to fix the problem after the discussion in https://github.com/kubernetes/kubernetes/pull/59502

**Release note**:
```release-note
NONE
```
2018-02-14 04:10:10 -08:00
Saverio Proto 2eff8bf31f Detect CIDR IPv4 or IPv6 version to select nexthop
https://github.com/kubernetes/kubernetes/issues/59421
https://github.com/kubernetes/kubernetes/issues/55202
2018-02-13 09:50:31 +01:00
Kubernetes Submit Queue 7488d1c921
Merge pull request #59571 from dims/skip-test-routes-when-there-are-no-vms
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Skip TestRoutes when there are no vm(s)

**What this PR does / why we need it**:

TestRoutes assumes that there is at least one vm in the OpenStack it
is connecting to. So let's limit this test to run properly only when
we are running in a VM or one was created already outside of the
test harness


**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:
Please see https://github.com/dims/openstack-cloud-controller-manager/issues/73 for some more context

**Release note**:

```release-note
NONE
```
2018-02-12 10:25:55 -08:00
Kubernetes Submit Queue 317853c90c
Merge pull request #59464 from dixudx/fix_all_typos
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix all the typos across the project

**What this PR does / why we need it**:
There are lots of typos across the project. We should avoid small PRs on fixing those annoying typos, which is time-consuming and low efficient.

This PR does fix all the typos across the project currently. And with #59463, typos could be avoided when a new PR gets merged.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:
/sig testing
/area test-infra
/sig release
/cc @ixdy 
/assign @fejta 

**Release note**:

```release-note
None
```
2018-02-10 22:12:45 -08:00
Davanum Srinivas 7ef4f207c2 New github id - FengyunPan -> FengyunPan2
PanFengyun <pan_feng_yun@163.com>'s previous github id was @FengyunPan

Due to some problem with github, he lost access to @FengyunPan and
is not using @FengyunPan2. So let's switch over to the new id. Github
has promised to release the previous id back in 6 months, so we may
have to switch it back later.
2018-02-10 22:28:51 -05:00
Di Xu 48388fec7e fix all the typos across the project 2018-02-11 11:04:14 +08:00
Jesse Haka 6665fa7144 taint also node controller
fix function

fix gofmt

fix function return value

fix tests

skip notimplemented error

remove factory unused

in openstack we should try to find instanceid from all states instead of ACTIVE, all other cloudproviders do this already

fix tests and lint

fix gofmt

fix nodelifecycletest

fix lint errors
2018-02-10 15:41:24 +02:00
Davanum Srinivas 18f1486e97 Skip TestRoutes when there are no vm(s)
TestRoutes assumes that there is at least one vm in the OpenStack it
is connecting to. So let's limit this test to run properly only when
we are running in a VM or one was created already outside of the
test harness
2018-02-08 08:54:04 -05:00
Jesse Haka 3cf5b172fa add node shutdown taint
shutdowned -> stopped

use shutdown everywhere

use patch in taints api call

use notimplemented in clouds use AddOrUpdateTaintOnNode

correct log text

add fake cloud

try to fix bazel

add shutdown tests

add context
2018-02-08 12:56:06 +02:00
Walter Fender e18e8ec3c0 Add context to all relevant cloud APIs
This adds context to all the relevant cloud provider interface signatures.
Callers of those APIs are currently satisfied using context.TODO().
There will be follow on PRs to push the context through the stack.
For an idea of the full scope of this change please look at PR #58532.
2018-02-06 12:49:17 -08:00
Davanum Srinivas 73b46ff7db Fix golint for openstack and cinder packages 2018-02-04 17:15:32 -05:00
Kubernetes Submit Queue d5ee83bda0
Merge pull request #59039 from jianglingxia/jlx-01301854
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add UT test to openstack and two para in configFromEnv

**What this PR does / why we need it**:
configFromEnv fun miss some para that the type define and add ut to TestToAuthOptions fun
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:
/assign @dims 
**Release note**:

```release-note
NONE
```
2018-02-03 21:55:40 -08:00
Kubernetes Submit Queue ce719592fb
Merge pull request #58560 from FengyunPan/fix-ErrResourceNotFound
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix non-interface type ErrResourceNotFound on left

Related to #58145
The gophercloud.ErrResourceNotFound is not a interface, so should
use reflect to get its type then do a check.

**Release note**:
```release-note
NONE
```
2018-02-03 21:20:36 -08:00
Kubernetes Submit Queue 1e63d5eb78
Merge pull request #59029 from jianglingxia/jlx-0130
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Correct the URL of openstack and make test case more detail

**What this PR does / why we need it**:
correct the url of openstack doc and make the test case more detail,thanks!
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #54044

**Special notes for your reviewer**:
/assign @dims 
**Release note**:

```release-note
NONE
```
2018-02-03 20:45:33 -08:00
Kubernetes Submit Queue a183fae672
Merge pull request #59189 from jianglingxia/jlx-0201
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add UT test TestCheckOpenStackOptsfunc

**What this PR does / why we need it**:
checkOpenStackOpts func has three case that the test case not Covered,so add it,thanks
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-02-02 03:54:22 -08:00
jianglingxia 029317fdaf Add UT test TestCheckOpenStackOptsfunc 2018-02-01 17:29:26 +08:00
jrperritt f8c8ec612b cloudprovider/openstack: fix bug the tries to use octavia client to query flip 2018-01-30 18:05:04 -06:00
jianglingxia a97d166903 Add UT test to openstack and two para in configFromEnv 2018-01-30 19:52:00 +08:00
Kubernetes Submit Queue 4b3d9e71df
Merge pull request #58871 from edisonxiang/supportGetLabelsForVolume
Automatic merge from submit-queue (batch tested with PRs 59012, 58871). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Support GetLabelsForVolume In OpenStack

**What this PR does / why we need it**:

Since PersistentVolumeLabelController will invoke ```GetLabelsForVolume``` interface
in Cloud-Controller-Manager, OpenStack Provider should support it.
https://github.com/kubernetes/kubernetes/blob/master/pkg/cloudprovider/cloud.go#L213

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #58870

**Special notes for your reviewer**:

**Release note**:

```release-note
Support GetLabelsForVolume in OpenStack Provider
```
2018-01-30 00:10:30 -08:00
jianglingxia bf8ebde4d2 Correct the URL of openstack and make test case more detail 2018-01-30 15:54:52 +08:00
edisonxiang 9326e845e4 Support GetLabelsForVolume In OpenStack 2018-01-30 09:45:55 +08:00
jianglingxia 0e1972a82e Add UT test to openstack_test.go 2018-01-25 16:25:35 +08:00
Tomas Smetana 11081acd86 Openstack: Fill size attribute for the V3 API volumes
The getVolume method in OpenStack provider is not
filling the Size for the V3 API type volumes. This
breaks the PV resizing of Cinder volumes.
2018-01-23 13:10:17 +01:00
Kubernetes Submit Queue 998490d4b8
Merge pull request #58502 from dixudx/register_openstack_hostname
Automatic merge from submit-queue (batch tested with PRs 57867, 58490, 58502, 58134). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Openstack: register metadata.hostname as node name

**What this PR does / why we need it**:
Currently Openstack can boot up instances with the name like `xyz/abc`, which is not a valid kubelet node name. While `hostname` retrieved from `meta_data.json` has already been sanitized 
 by Openstack to valid DNS-1123 format string. It's safe to register this `metadata.hostname` as valid kubelet node name.

/kind bug
/sig openstack

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #57765

**Special notes for your reviewer**:
/assign @dims @FengyunPan 

**Release note**:

```release-note
Openstack: register metadata.hostname as node name
```
2018-01-23 00:06:31 -08:00
FengyunPan 2520d4be44 Fix non-interface type ErrResourceNotFound on left
Related to #58145
The gophercloud.ErrResourceNotFound is not a interface, so should
use reflect to get its type then do a check.
2018-01-23 13:24:17 +08:00
Kubernetes Submit Queue f7fa53e691
Merge pull request #58499 from FengyunPan/remove-OldSecurityGroupName
Automatic merge from submit-queue (batch tested with PRs 58547, 57228, 58528, 58499, 58618). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove getOldSecurityGroupName() from OpenStack cloud provider

Related to #53764
The getOldSecurityGroupName() is used to get the old security
group name, we can remove it now.

**What this PR does / why we need it**:
#53764

**Release note**:
```release-note
NONE
```
2018-01-22 20:49:38 -08:00
Kubernetes Submit Queue 35840bf71e
Merge pull request #58300 from dims/specify-auth-info-as-environment-variables
Automatic merge from submit-queue (batch tested with PRs 58300, 58530, 57942, 58543). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Ability to specify OS_* variables for OpenStack configuration

**What this PR does / why we need it**:

When we convert the OpenStack cloud provider to run in an external
process, we should be able to use kubernetes Secrets capability to
inject the OS_* variables. This way we can specify the cloud
configuration as a configmap, specify secrets for the userid/password
information. The configmap can be mounted as a file. the secrets can
be made available as environment variables. the external controller
itself can run as a pod/daemonset.

For backward compat, we preload all the OS_* variables, if anything
is in the config file, then that overrides the environment variables.


**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
Authentication information for OpenStack cloud provider can now be specified as environment variables
```
2018-01-19 20:00:31 -08:00
Di Xu eaac0f5489 Openstack: register metadata.hostname as node name 2018-01-19 15:01:45 +08:00
FengyunPan 5613dec9cf Remove getOldSecurityGroupName() from OpenStack cloud provider
Related to #53764
The getOldSecurityGroupName() is used to get the old security
group name, we can remove it now.
2018-01-19 11:14:25 +08:00
Kubernetes Submit Queue 40b0c5516a
Merge pull request #56258 from databus23/patch-1
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

openstack: remove orphaned routes from terminated instances

**What this PR does / why we need it**:
At the moment the openstack cloudprovider only returns routes where the `NextHop` address points to an existing openstack instance. This is a problem when an instance is terminated before the corresponding node is removed from k8s. The existing route is not returned by the cloudprovider anymore and therefore never considered for deletion by the route controller. When the route's `DestinationCIDR` is reassigned to a new node the router ends up with two routes pointing to a different `NextHop` leading to broken networking.

This PR removes skipping routes pointing to unknown next hops when listing routes. This should cause [this conditional](93dc3763b0/pkg/controller/route/route_controller.go (L208)) in the route controller to succeed and have the route removed if the route controller [feels responsible](93dc3763b0/pkg/controller/route/route_controller.go (L206)).

```release-note
OpenStack cloudprovider: Ensure orphaned routes are removed.
```
2018-01-18 06:53:15 -08:00
Davanum Srinivas f8aef8b911 Ability to specify OS_* variables for OpenStack configuration
When we convert the OpenStack cloud provider to run in an external
process, we should be able to use kubernetes Secrets capability to
inject the OS_* variables. This way we can specify the cloud
configuration as a configmap, specify secrets for the userid/password
information. The configmap can be mounted as a file. the secrets can
be made available as environment variables. the external controller
itself can run as a pod/daemonset.

For backward compat, we preload all the OS_* variables, if anything
is in the config file, then that overrides the environment variables.
2018-01-18 09:52:35 -05:00
Davanum Srinivas aeb7428c89 Log message at a better level
We don't really need to log this meessage at level 1.
2018-01-15 15:06:47 -05:00
FengyunPan 9958389eb9 The lbaas.opts.SubnetId should be set by subnet id.
Fix #58145
The getSubnetIDForLB() should return subnet id rather than net id.
2018-01-12 18:59:53 +08:00
Jesse Haka 4e1b5c6a32 move detach out of os volumes attach
add test

add test

fix bazel

fix tests

change loglevel, remove else statement
2018-01-10 19:09:32 +02:00
Jesse Haka bac270533e use danglingerror
add getNodeNameByID and use volume.AttachedDevice as devicepath

use uppercase functionname

do not delete automatically nodes if node is shutdowned in openstack

do not delete node

fix gofmt

fix cinder detach if instance is not in active state

fix gofmt
2018-01-07 18:50:42 +02:00
Jeff Grafton efee0704c6 Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
Kubernetes Submit Queue 8a5fa5f74f
Merge pull request #56407 from bugosiphionah/cider_volumeresize_test
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add test for Cider ExpandVolume

Add test for Cinder Volume Resize for this [commit](270de26987).
2017-12-18 05:42:44 -08:00
Phionah Bugosi 30ab605d85 Add test for Cider ExpandVolume 2017-12-18 13:59:14 +03:00
Kubernetes Submit Queue 1e6ebd49cb
Merge pull request #56678 from stewart-yu/deleteWhitespaceInLog
Automatic merge from submit-queue (batch tested with PRs 57122, 57142, 57016, 56927, 56678). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

should not ignore return messages from wait function

**What this PR does / why we need it**:
It should not ignore return messages for `wait*` function. When it go wrong, need `return` at once.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-12-16 23:32:46 -08:00
Kubernetes Submit Queue 2ae99cf146
Merge pull request #56955 from feiskyer/scrub-dns
Automatic merge from submit-queue (batch tested with PRs 56997, 57008, 56984, 56975, 56955). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove unused ScrubDNS interface from cloudprovider

**What this PR does / why we need it**:

DNS scrubber from kubelet has been removed in #36785 and cloudprovider's `ScrubDNS()` interface is not used anywhere.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #56953.

**Special notes for your reviewer**:

**Release note**:

```release-note
Remove ScrubDNS interface from cloudprovider.
```
2017-12-16 15:23:54 -08:00
Kubernetes Submit Queue 0026a3ed22
Merge pull request #56675 from stewart-yu/removeUnnecessaryCondition
Automatic merge from submit-queue (batch tested with PRs 56480, 56675, 56624, 56648, 56658). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove unnecessary condition

**What this PR does / why we need it**:
Now that we have judgement `loadbalancer == nil` in `L1286`, the condition is uncessary.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-12-16 03:24:43 -08:00
Kubernetes Submit Queue 01c3f7f85b
Merge pull request #56546 from wenlxie/githubupstream.master.fixdiskareattachedbug
Automatic merge from submit-queue (batch tested with PRs 56337, 56546, 56550, 56633, 56635). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

should check the return value of os.DiskIsAttached

This fix is for  issue: https://github.com/kubernetes/kubernetes/issues/56455
2017-12-16 01:53:46 -08:00
Kubernetes Submit Queue 23ec8f0e36
Merge pull request #56269 from edisonxiang/changewording
Automatic merge from submit-queue (batch tested with PRs 55557, 55504, 56269, 55604, 56202). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Change wording in OpenStack Provider

**What this PR does / why we need it**:

Change working from "dealy" into "delay" in OpenStack Provider.

**Release note**:

```release-note
NONE
```
2017-12-14 13:54:43 -08:00
Pengfei Ni 65efeee64f Remove unused ScrubDNS interface from cloudprovider 2017-12-08 16:03:56 +08:00
Kubernetes Submit Queue 36ea6de4a0
Merge pull request #52013 from FengyunPan/autoprobing-external-network
Automatic merge from submit-queue (batch tested with PRs 52013, 56719). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Support autoprobing floating-network-id for openstack cloud provider

Currently if user doesn't specify floatingnetwork-id and loadbalancer.openstack.org/floating-network-id annotation, openstack cloud provider can't create a external LoadBalancer service.
Actually we can get  floatingnetwork-id automatically. 
If we get multiple  floatingnetwork-ids, then ask user to specify one, or we use the  floatingnetwork-id to create floatingip for external LoadBalancer service.

This is a part of #50726

**Special notes for your reviewer**:
/assign @dims

**Release note**:
```release-note
Support autoprobing floating-network-id for openstack cloud provider
```
2017-12-04 10:55:14 -08:00
stewart-yu af882afd3e should not ignore return messages from wait function 2017-12-01 16:02:06 +08:00
stewart-yu f0d894543b remove unnecessary condition judgement 2017-12-01 15:15:31 +08:00
Fabian Ruff 51a367f806 relax server list option, set Blackhole field 2017-11-29 19:08:14 +01:00
wenlxie e80dcba297 should check the return value of os.DiskIsAttached 2017-11-29 13:02:27 +08:00
Kubernetes Submit Queue 2c9ffc0e88
Merge pull request #53764 from FengyunPan/unique-sg
Automatic merge from submit-queue (batch tested with PRs 56520, 53764). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add service.UID into security group name

Related to: #53714 

**Release note**:
```release-note
NONE
```
2017-11-28 19:13:14 -08:00
Kubernetes Submit Queue 51033c4dec
Merge pull request #56437 from dims/fix-unit-tests-that-need-openstack
Automatic merge from submit-queue (batch tested with PRs 56446, 56437). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix unit tests that need openstack

**What this PR does / why we need it**:
Currently the unit tests that depend that they be on running inside an openstack vm fail as no one seem to have run them for a while.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
ref #56437

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-11-28 13:08:13 -08:00
FengyunPan de7c96ad3c Support autoprobing floating-network-id for openstack cloud provider 2017-11-28 09:37:00 +08:00
Davanum Srinivas 8300dd8901 Find a server name and router id to test TestRoutes 2017-11-27 16:32:10 -05:00
Davanum Srinivas 076f4da28b Allow volume test to run outside an actual OpenStack VM 2017-11-27 14:03:04 -05:00
Davanum Srinivas f5299fe7e1 Skip TestRoutes if extension or router-id is missing 2017-11-27 14:02:23 -05:00
Davanum Srinivas 90a531ceb5 Set bs-version to auto for tests 2017-11-27 13:48:27 -05:00
Davanum Srinivas c31bfe67a4 LBaaS v1 is no longer supported 2017-11-27 13:44:46 -05:00
edisonxiang aab6efd192 Change wording in OpenStack Provider 2017-11-23 10:48:23 +08:00
Fabian Ruff 2e177ef9b2
return routes for unknown next hops 2017-11-22 23:44:07 +01:00
FengyunPan f95ac1c87a Support VolumeV3 for OpenStack cloud Provider 2017-11-22 16:45:38 +08:00
NickrenREN af108fb938 implement cinder resize 2017-11-21 15:55:49 +08:00
FengyunPan 669520f9bb Add EnsureOldSecurityGroupDeleted to delete old security group
Consider the migration from the old security group name to the new
security group name, we need delete the old security group.
At V1.10, we can assume everyone is using the new security group
names and remove this code.
2017-11-21 09:38:43 +08:00
FengyunPan 7215ce30b1 Add service.UID into security group name
Related to: #53714
2017-11-21 09:29:32 +08:00
Kubernetes Submit Queue cb91e2d9b1
Merge pull request #55313 from petrutlucian94/openstack_hv_pv
Automatic merge from submit-queue (batch tested with PRs 55642, 55897, 55835, 55496, 55313). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

OpenStack: fetch volume path from metadata service

**What this PR does / why we need it**:
Updates the OpenStack cloud provider to use the Nova metadata service as a fallback when retrieving mounted PV disk paths. Note that the Nova instance device metadata will contain the disk address and bus, which allows finding its path. 

This is needed as the *standard* mechanism of retrieving disk paths is not available when running k8s under OpenStack Hyper-V hosts.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #55312

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-11-18 10:46:41 -08:00
Jamie Hannaford 29855470e9 Allow use of Octavia endpoint 2017-11-16 10:55:59 +01:00
whateverv5 aafac9fec2 Using lower case of fmt.Errorf 2017-11-14 12:40:16 +08:00
Dr. Stefan Schimanski bec617f3cc Update generated files 2017-11-09 12:14:08 +01:00
Dr. Stefan Schimanski 012b085ac8 pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
Lucian Petrut 559f83a93d openstack: fetch volume path from metadata service
The OpenStack cloud provider retrieves mounted Cinder volume paths
by looking in /dev/disk/by-id, expecting the disk serial IDs (e.g.
SCSI ID) to include the volume ID.

The issue is that not all hypervisors are able to expose this.
For example, Hyper-V will just preserve the original Cinder volume
lun SCSI ID (without setting the volume id). For this reason,
disk path lookups will fail.

In order to be able to leverage Hyper-V based OpenStack providers,
as a fallback, we're querying the metadata service, searching for
disk device metadata. Note that starting with Nova Queens, the Hyper-V
driver always provides disk address information through the instance
metadata.
2017-11-09 12:36:18 +02:00
Kubernetes Submit Queue 55e49ed554 Merge pull request #51409 from FengyunPan/implement-InstanceExistsByProviderID
Automatic merge from submit-queue (batch tested with PRs 51409, 54616). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Implement InstanceExistsByProviderID() for cloud providers

Fix #51406
If cloud providers(like aws, gce etc...) implement ExternalID()
and support getting instance by ProviderID , they also implement
InstanceExistsByProviderID().

/assign wlan0
/assign @luxas

**Release note**:
```release-note
NONE
```
2017-10-27 06:16:20 -07:00
Kubernetes Submit Queue b2b31ada14 Merge pull request #52717 from FengyunPan/remove-LbassV1
Automatic merge from submit-queue (batch tested with PRs 52717, 54568, 54452, 53997, 54237). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

[OpenStack]Remove the LbaasV1 of OpenStack cloud provider

The Neutron LbaasV1 has been declared obsolete, LbaasV2 is a
better choice.
So let's remove the codes of LbaasV1, only support LbaasV2.
xref: #52609
Reference OpenStack doc:
https://docs.openstack.org/mitaka/networking-guide/config-lbaas.html

**Special notes for your reviewer**:
/assign @dims 
/assign @anguslees 

**Release note**:
```release-note
Remove the LbaasV1 of OpenStack cloud provider, currently only support LbaasV2.
```
2017-10-25 23:10:25 -07:00
Kubernetes Submit Queue 1213f9112b Merge pull request #54176 from gonzolino/os-lbaas-provider
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Make OpenStack LBaaS v2 Provider configurable

Add option 'lb-provider' to the Loadbalancer section of the OpenStack
cloudprovider configuration to allow using a different LBaaS v2
provider than the default.



**What this PR does / why we need it**:
This PR allows to use a different OpenStack LBaaS v2 provider than the default of the OpenStack cloud.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
Added option lb-provider to OpenStack cloud provider config
```
2017-10-23 08:08:10 -07:00
Daniel Gonzalez 62b8a62844 Make OpenStack LBaaS v2 Provider configurable
Add option 'lb-provider' to the Loadbalancer section of the OpenStack
cloudprovider configuration to allow using a different LBaaS v2
provider than the default.
2017-10-23 12:27:10 +02:00
FengyunPan bf7f1a0610 Update gophercloud: cleanup lbaas v1 2017-10-23 18:01:03 +08:00
FengyunPan b308e36819 [OpenStack]Remove the LbaasV1 of OpenStack cloud provider
The Neutron LbaasV1 has been declared obsolete, LbaasV2 is a
better choice.
So let's remove the codes of LbaasV1, only support LbaasV2.
Talked at: #52609
Related to: #52821
Reference OpenStack doc:
https://docs.openstack.org/mitaka/networking-guide/config-lbaas.html
2017-10-23 17:59:20 +08:00
NickrenREN 8af03d0fae let the caller log error message 2017-10-23 11:12:04 +08:00
FengyunPan 462087fd74 Implement InstanceExistsByProviderID() for cloud providers
Fix #51406
If cloud providers(like aws, gce etc...) implement ExternalID()
and support getting instance by ProviderID , they also implement
InstanceExistsByProviderID().
2017-10-20 14:59:28 +08:00
Jeff Grafton aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
FengyunPan 30e7a5c118 Volunteer to help with sig/openstack
I would like to do some code review/approve for OpenStack cloud
provider and cinder volume.
2017-10-13 16:49:59 +08:00
Kubernetes Submit Queue f60b92a26a Merge pull request #50836 from FengyunPan/auto-get-NodeSecurityGroupID
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Support autoprobing node-security-group for openstack cloud provider

1. Support autoprobing node-security-group
2. Support multiple Security Groups for cluster's nodes
3. Fix recreating Security Group for cluster's nodes

This is a part of #50726

**Special notes for your reviewer**:
/assign @anguslees 
/assign @dims 

**Release note**:
```release-note
Support autoprobing node-security-group for openstack cloud provider, Support multiple Security Groups for cluster's nodes.
```
2017-10-11 21:40:16 -07:00
FengyunPan 5af6a0b4de The Securty Group name should be unique
Currently the service's name is not unique, and the Securty Group
name is not unique too. openstack cloud provider will delete the
Securty Group of other loadbalancer service when do a deletion.
2017-10-11 19:20:36 +08:00
FengyunPan 04dbfe67d6 Support autoprobing node-security-group for openstack cloud provider
1. Support autoprobing node-security-group
2. Support multiple Security Groups for cluster's nodes
3. Fix recreating Security Group for cluster's nodes

This is a part of #50726
2017-10-10 15:04:32 +08:00
Kubernetes Submit Queue e8ee831abf Merge pull request #53588 from NickrenREN/openstack-deletevolume
Automatic merge from submit-queue (batch tested with PRs 52662, 53547, 53588, 53573, 53599). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Return err when delete volume failed

Return err when delete volume failed

**Release note**:
```release-note
NONE
```

/kind bug
/sig openstack
2017-10-09 12:51:19 -07:00
Kubernetes Submit Queue 1dc1eb7373 Merge pull request #53197 from FengyunPan/node-0
Automatic merge from submit-queue (batch tested with PRs 53567, 53197, 52944, 49593). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

[OpenStack]Add codes to check the count of nodes(members)

After merging this PR(#53146), if there is no available nodes for
the loadbalancer service, UpdateLoadBalancer() will run panic.

**Release note**:
```release-note
NONE
```
2017-10-09 11:18:46 -07:00
Kubernetes Submit Queue 92210a7d76 Merge pull request #53523 from zetaab/ignore_volume_label
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add possibility to ignore volume label in dynamic provisioning

**What this PR does / why we need it**: this is needed if openstack cinder zone name does not match to compute zone names. For instance if there is only one cinder zone and many compute zones.

**Which issue this PR fixes**: fixes #53488

**Special notes for your reviewer**: 

```release-note
NONE
```
2017-10-09 09:17:04 -07:00
NickrenREN dca4732145 Return err when delete volume failed 2017-10-09 21:32:45 +08:00
Jesse Haka e45457b0d8 add possibility to ignore volume label in dynamic provisioning
ignorelabel -> addlabel

FIX tests

small fix to test

fixes according what was asked

fix test

fix test
2017-10-09 09:52:42 +03:00
FengyunPan 370ad205b7 [OpenStack]Add codes to check the count of nodes(members)
After merging this PR(#53146), if there is no available nodes for
the loadbalancer service, UpdateLoadBalancer() will run panic.
2017-10-09 10:01:49 +08:00
Kubernetes Submit Queue 6e7989e652 Merge pull request #53510 from dims/run-tests-with-devstack
Automatic merge from submit-queue (batch tested with PRs 52768, 51898, 53510, 53097, 53058). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Ability to run the openstack tests against DevStack

**What this PR does / why we need it**:

Some of the environment variables have changed as devstack defaults
have changed. So look for the older env variables first and try the
newer ones later.

At a minimum you need the following for v3 authentication which is
the default with latest devstack. If you miss the Tenant information
then the token issued will be a unscoped token (and will not have any
service catalog information).

OS_AUTH_URL=http://192.168.0.42/identity
OS_REGION_NAME=RegionOne
OS_USERNAME=demo
OS_PASSWORD=supersecret
OS_TENANT_NAME=demo
OS_USER_DOMAIN_ID=default


**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-10-06 13:16:42 -07:00
Kubernetes Submit Queue 536f9ac1d8 Merge pull request #53115 from FengyunPan/fix-auto
Automatic merge from submit-queue (batch tested with PRs 53418, 53366, 53115, 53402, 53130). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix the version detection of OpenStack Cinder

**What this PR does / why we need it**:
When running Kubernetes against an installation of DevStack which
deploys the Cinder service at a path rather than a port (ex:
http://foo.bar/volume rather than http://foo.bar:xxx), the version
detection fails. It is better to use the OpenStack service catalog.
OTOH, when initialize cinder client, kubernetes will check the
endpoint from the OpenStack service catalog, so we can do this
version detection by it.

There are two case should be fixed in other PR:
1. revisit the version detection after supporting Cinder V3 API.
2. add codes to support MicroVersion after gophercloud supports MicroVersion.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #50461

**Special notes for your reviewer**:
/assign @dims 
/assign @xsgordon 

**Release note**:
```release-note
Using OpenStack service catalog to do version detection
```
2017-10-05 17:31:21 -07:00
Davanum Srinivas c04f04c229 Ability to run the openstack tests against DevStack
Some of the environment variables have changed as devstack defaults
have changed. So look for the older env variables first and try the
newer ones later.

At a minimum you need the following for v3 authentication which is
the default with latest devstack. If you miss the Tenant information
then the token issued will be a unscoped token (and will not have any
service catalog information).

OS_AUTH_URL=http://192.168.0.42/identity
OS_REGION_NAME=RegionOne
OS_USERNAME=demo
OS_PASSWORD=supersecret
OS_TENANT_NAME=demo
OS_USER_DOMAIN_ID=default
2017-10-05 17:31:20 -04:00
Kubernetes Submit Queue 9e9ebc04fb Merge pull request #53195 from dixudx/add_timeout_for_openstack_cloudprovider
Automatic merge from submit-queue (batch tested with PRs 51750, 53195, 53384, 53410). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add http request timeout for OpenStack cloud provider

**What this PR does / why we need it**:

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #53191

**Special notes for your reviewer**:
/assign @NickrenREN @dims @FengyunPan 

**Release note**:

```release-note
None
```
2017-10-05 06:08:58 -07:00