Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
3528ceb2
Commit
3528ceb2
authored
Aug 25, 2017
by
Josh Horwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
address test & doc comments
parent
2f1ea47c
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
14 additions
and
5 deletions
+14
-5
aws.go
pkg/cloudprovider/providers/aws/aws.go
+1
-0
azure_instances.go
pkg/cloudprovider/providers/azure/azure_instances.go
+1
-0
fake.go
pkg/cloudprovider/providers/fake/fake.go
+1
-0
gce_instances.go
pkg/cloudprovider/providers/gce/gce_instances.go
+1
-0
openstack_instances.go
pkg/cloudprovider/providers/openstack/openstack_instances.go
+1
-0
ovirt.go
pkg/cloudprovider/providers/ovirt/ovirt.go
+1
-0
photon.go
pkg/cloudprovider/providers/photon/photon.go
+1
-0
rackspace.go
pkg/cloudprovider/providers/rackspace/rackspace.go
+1
-0
vsphere.go
pkg/cloudprovider/providers/vsphere/vsphere.go
+1
-0
node_controller_test.go
pkg/controller/cloud/node_controller_test.go
+5
-5
No files found.
pkg/cloudprovider/providers/aws/aws.go
View file @
3528ceb2
...
@@ -1102,6 +1102,7 @@ func (c *Cloud) ExternalID(nodeName types.NodeName) (string, error) {
...
@@ -1102,6 +1102,7 @@ func (c *Cloud) ExternalID(nodeName types.NodeName) (string, error) {
}
}
// InstanceExistsByProviderID returns true if the instance with the given provider id still exists and is running.
// InstanceExistsByProviderID returns true if the instance with the given provider id still exists and is running.
// If false is returned with no error, the instance will be immediately deleted.
func
(
c
*
Cloud
)
InstanceExistsByProviderID
(
providerID
string
)
(
bool
,
error
)
{
func
(
c
*
Cloud
)
InstanceExistsByProviderID
(
providerID
string
)
(
bool
,
error
)
{
return
false
,
errors
.
New
(
"unimplemented"
)
return
false
,
errors
.
New
(
"unimplemented"
)
}
}
...
...
pkg/cloudprovider/providers/azure/azure_instances.go
View file @
3528ceb2
...
@@ -88,6 +88,7 @@ func (az *Cloud) ExternalID(name types.NodeName) (string, error) {
...
@@ -88,6 +88,7 @@ func (az *Cloud) ExternalID(name types.NodeName) (string, error) {
}
}
// InstanceExistsByProviderID returns true if the instance with the given provider id still exists and is running.
// InstanceExistsByProviderID returns true if the instance with the given provider id still exists and is running.
// If false is returned with no error, the instance will be immediately deleted.
func
(
az
*
Cloud
)
InstanceExistsByProviderID
(
providerID
string
)
(
bool
,
error
)
{
func
(
az
*
Cloud
)
InstanceExistsByProviderID
(
providerID
string
)
(
bool
,
error
)
{
return
false
,
errors
.
New
(
"unimplemented"
)
return
false
,
errors
.
New
(
"unimplemented"
)
}
}
...
...
pkg/cloudprovider/providers/fake/fake.go
View file @
3528ceb2
...
@@ -239,6 +239,7 @@ func (f *FakeCloud) InstanceTypeByProviderID(providerID string) (string, error)
...
@@ -239,6 +239,7 @@ func (f *FakeCloud) InstanceTypeByProviderID(providerID string) (string, error)
}
}
// InstanceExistsByProviderID returns true if the instance with the given provider id still exists and is running.
// InstanceExistsByProviderID returns true if the instance with the given provider id still exists and is running.
// If false is returned with no error, the instance will be immediately deleted.
func
(
f
*
FakeCloud
)
InstanceExistsByProviderID
(
providerID
string
)
(
bool
,
error
)
{
func
(
f
*
FakeCloud
)
InstanceExistsByProviderID
(
providerID
string
)
(
bool
,
error
)
{
f
.
addCall
(
"instance-exists-by-provider-id"
)
f
.
addCall
(
"instance-exists-by-provider-id"
)
return
f
.
ExistsByProviderID
,
f
.
ErrByProviderID
return
f
.
ExistsByProviderID
,
f
.
ErrByProviderID
...
...
pkg/cloudprovider/providers/gce/gce_instances.go
View file @
3528ceb2
...
@@ -153,6 +153,7 @@ func (gce *GCECloud) ExternalID(nodeName types.NodeName) (string, error) {
...
@@ -153,6 +153,7 @@ func (gce *GCECloud) ExternalID(nodeName types.NodeName) (string, error) {
}
}
// InstanceExistsByProviderID returns true if the instance with the given provider id still exists and is running.
// InstanceExistsByProviderID returns true if the instance with the given provider id still exists and is running.
// If false is returned with no error, the instance will be immediately deleted.
func
(
gce
*
GCECloud
)
InstanceExistsByProviderID
(
providerID
string
)
(
bool
,
error
)
{
func
(
gce
*
GCECloud
)
InstanceExistsByProviderID
(
providerID
string
)
(
bool
,
error
)
{
return
false
,
errors
.
New
(
"unimplemented"
)
return
false
,
errors
.
New
(
"unimplemented"
)
}
}
...
...
pkg/cloudprovider/providers/openstack/openstack_instances.go
View file @
3528ceb2
...
@@ -111,6 +111,7 @@ func (i *Instances) ExternalID(name types.NodeName) (string, error) {
...
@@ -111,6 +111,7 @@ func (i *Instances) ExternalID(name types.NodeName) (string, error) {
}
}
// InstanceExistsByProviderID returns true if the instance with the given provider id still exists and is running.
// InstanceExistsByProviderID returns true if the instance with the given provider id still exists and is running.
// If false is returned with no error, the instance will be immediately deleted.
func
(
i
*
Instances
)
InstanceExistsByProviderID
(
providerID
string
)
(
bool
,
error
)
{
func
(
i
*
Instances
)
InstanceExistsByProviderID
(
providerID
string
)
(
bool
,
error
)
{
return
false
,
errors
.
New
(
"unimplemented"
)
return
false
,
errors
.
New
(
"unimplemented"
)
}
}
...
...
pkg/cloudprovider/providers/ovirt/ovirt.go
View file @
3528ceb2
...
@@ -212,6 +212,7 @@ func (v *OVirtCloud) ExternalID(nodeName types.NodeName) (string, error) {
...
@@ -212,6 +212,7 @@ func (v *OVirtCloud) ExternalID(nodeName types.NodeName) (string, error) {
}
}
// InstanceExistsByProviderID returns true if the instance with the given provider id still exists and is running.
// InstanceExistsByProviderID returns true if the instance with the given provider id still exists and is running.
// If false is returned with no error, the instance will be immediately deleted.
func
(
v
*
OVirtCloud
)
InstanceExistsByProviderID
(
providerID
string
)
(
bool
,
error
)
{
func
(
v
*
OVirtCloud
)
InstanceExistsByProviderID
(
providerID
string
)
(
bool
,
error
)
{
return
false
,
errors
.
New
(
"unimplemented"
)
return
false
,
errors
.
New
(
"unimplemented"
)
}
}
...
...
pkg/cloudprovider/providers/photon/photon.go
View file @
3528ceb2
...
@@ -471,6 +471,7 @@ func (pc *PCCloud) ExternalID(nodeName k8stypes.NodeName) (string, error) {
...
@@ -471,6 +471,7 @@ func (pc *PCCloud) ExternalID(nodeName k8stypes.NodeName) (string, error) {
}
}
// InstanceExistsByProviderID returns true if the instance with the given provider id still exists and is running.
// InstanceExistsByProviderID returns true if the instance with the given provider id still exists and is running.
// If false is returned with no error, the instance will be immediately deleted.
func
(
pc
*
PCCloud
)
InstanceExistsByProviderID
(
providerID
string
)
(
bool
,
error
)
{
func
(
pc
*
PCCloud
)
InstanceExistsByProviderID
(
providerID
string
)
(
bool
,
error
)
{
return
false
,
errors
.
New
(
"unimplemented"
)
return
false
,
errors
.
New
(
"unimplemented"
)
}
}
...
...
pkg/cloudprovider/providers/rackspace/rackspace.go
View file @
3528ceb2
...
@@ -437,6 +437,7 @@ func (i *Instances) ExternalID(nodeName types.NodeName) (string, error) {
...
@@ -437,6 +437,7 @@ func (i *Instances) ExternalID(nodeName types.NodeName) (string, error) {
}
}
// InstanceExistsByProviderID returns true if the instance with the given provider id still exists and is running.
// InstanceExistsByProviderID returns true if the instance with the given provider id still exists and is running.
// If false is returned with no error, the instance will be immediately deleted.
func
(
i
*
Instances
)
InstanceExistsByProviderID
(
providerID
string
)
(
bool
,
error
)
{
func
(
i
*
Instances
)
InstanceExistsByProviderID
(
providerID
string
)
(
bool
,
error
)
{
return
false
,
errors
.
New
(
"unimplemented"
)
return
false
,
errors
.
New
(
"unimplemented"
)
}
}
...
...
pkg/cloudprovider/providers/vsphere/vsphere.go
View file @
3528ceb2
...
@@ -377,6 +377,7 @@ func (vs *VSphere) ExternalID(nodeName k8stypes.NodeName) (string, error) {
...
@@ -377,6 +377,7 @@ func (vs *VSphere) ExternalID(nodeName k8stypes.NodeName) (string, error) {
}
}
// InstanceExistsByProviderID returns true if the instance with the given provider id still exists and is running.
// InstanceExistsByProviderID returns true if the instance with the given provider id still exists and is running.
// If false is returned with no error, the instance will be immediately deleted.
func
(
vs
*
VSphere
)
InstanceExistsByProviderID
(
providerID
string
)
(
bool
,
error
)
{
func
(
vs
*
VSphere
)
InstanceExistsByProviderID
(
providerID
string
)
(
bool
,
error
)
{
return
false
,
errors
.
New
(
"unimplemented"
)
return
false
,
errors
.
New
(
"unimplemented"
)
}
}
...
...
pkg/controller/cloud/node_controller_test.go
View file @
3528ceb2
...
@@ -130,23 +130,23 @@ func TestEnsureNodeExistsByProviderIDOrNodeName(t *testing.T) {
...
@@ -130,23 +130,23 @@ func TestEnsureNodeExistsByProviderIDOrNodeName(t *testing.T) {
instances
,
_
:=
fc
.
Instances
()
instances
,
_
:=
fc
.
Instances
()
exists
,
err
:=
ensureNodeExistsByProviderIDOrName
(
instances
,
tc
.
node
)
exists
,
err
:=
ensureNodeExistsByProviderIDOrName
(
instances
,
tc
.
node
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Error
(
err
)
}
}
if
!
reflect
.
DeepEqual
(
fc
.
Calls
,
tc
.
expectedCalls
)
{
if
!
reflect
.
DeepEqual
(
fc
.
Calls
,
tc
.
expectedCalls
)
{
t
.
Fatal
f
(
"expected cloud provider methods `%v` to be called but `%v` was called "
,
tc
.
expectedCalls
,
fc
.
Calls
)
t
.
Error
f
(
"expected cloud provider methods `%v` to be called but `%v` was called "
,
tc
.
expectedCalls
,
fc
.
Calls
)
}
}
if
tc
.
existsByProviderID
&&
tc
.
existsByProviderID
!=
exists
{
if
tc
.
existsByProviderID
&&
tc
.
existsByProviderID
!=
exists
{
t
.
Fatal
f
(
"expected exist by provider id to be `%t` but got `%t`"
,
tc
.
existsByProviderID
,
exists
)
t
.
Error
f
(
"expected exist by provider id to be `%t` but got `%t`"
,
tc
.
existsByProviderID
,
exists
)
}
}
if
tc
.
existsByNodeName
&&
tc
.
existsByNodeName
!=
exists
{
if
tc
.
existsByNodeName
&&
tc
.
existsByNodeName
!=
exists
{
t
.
Fatal
f
(
"expected exist by node name to be `%t` but got `%t`"
,
tc
.
existsByNodeName
,
exists
)
t
.
Error
f
(
"expected exist by node name to be `%t` but got `%t`"
,
tc
.
existsByNodeName
,
exists
)
}
}
if
!
tc
.
existsByNodeName
&&
!
tc
.
existsByProviderID
&&
exists
{
if
!
tc
.
existsByNodeName
&&
!
tc
.
existsByProviderID
&&
exists
{
t
.
Fatal
(
"node is not supposed to exist"
)
t
.
Error
(
"node is not supposed to exist"
)
}
}
})
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment