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
1339e4cf
Commit
1339e4cf
authored
Sep 25, 2017
by
Henrik Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use custom error for "unimplemented"
parent
ac33bfd5
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
18 additions
and
22 deletions
+18
-22
cloud.go
pkg/cloudprovider/cloud.go
+1
-0
aws.go
pkg/cloudprovider/providers/aws/aws.go
+2
-2
azure_instances.go
pkg/cloudprovider/providers/azure/azure_instances.go
+1
-2
fake.go
pkg/cloudprovider/providers/fake/fake.go
+1
-2
gce_instances.go
pkg/cloudprovider/providers/gce/gce_instances.go
+1
-2
openstack_instances.go
pkg/cloudprovider/providers/openstack/openstack_instances.go
+2
-3
ovirt.go
pkg/cloudprovider/providers/ovirt/ovirt.go
+4
-5
photon.go
pkg/cloudprovider/providers/photon/photon.go
+4
-4
vsphere.go
pkg/cloudprovider/providers/vsphere/vsphere.go
+2
-2
No files found.
pkg/cloudprovider/cloud.go
View file @
1339e4cf
...
...
@@ -176,6 +176,7 @@ type Routes interface {
var
(
InstanceNotFound
=
errors
.
New
(
"instance not found"
)
DiskNotFound
=
errors
.
New
(
"disk is not found"
)
NotImplemented
=
errors
.
New
(
"unimplemented"
)
)
// Zone represents the location of a particular machine.
...
...
pkg/cloudprovider/providers/aws/aws.go
View file @
1339e4cf
...
...
@@ -618,7 +618,7 @@ func newEc2Filter(name string, values ...string) *ec2.Filter {
// AddSSHKeyToAllInstances is currently not implemented.
func
(
c
*
Cloud
)
AddSSHKeyToAllInstances
(
user
string
,
keyData
[]
byte
)
error
{
return
errors
.
New
(
"unimplemented"
)
return
cloudprovider
.
NotImplemented
}
// CurrentNodeName returns the name of the current node
...
...
@@ -1152,7 +1152,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.
// If false is returned with no error, the instance will be immediately deleted by the cloud controller manager.
func
(
c
*
Cloud
)
InstanceExistsByProviderID
(
providerID
string
)
(
bool
,
error
)
{
return
false
,
errors
.
New
(
"unimplemented"
)
return
false
,
cloudprovider
.
NotImplemented
}
// InstanceID returns the cloud provider ID of the node with the specified nodeName.
...
...
pkg/cloudprovider/providers/azure/azure_instances.go
View file @
1339e4cf
...
...
@@ -17,7 +17,6 @@ limitations under the License.
package
azure
import
(
"errors"
"fmt"
"k8s.io/api/core/v1"
...
...
@@ -90,7 +89,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.
// If false is returned with no error, the instance will be immediately deleted by the cloud controller manager.
func
(
az
*
Cloud
)
InstanceExistsByProviderID
(
providerID
string
)
(
bool
,
error
)
{
return
false
,
errors
.
New
(
"unimplemented"
)
return
false
,
cloudprovider
.
NotImplemented
}
func
(
az
*
Cloud
)
isCurrentInstance
(
name
types
.
NodeName
)
(
bool
,
error
)
{
...
...
pkg/cloudprovider/providers/fake/fake.go
View file @
1339e4cf
...
...
@@ -17,7 +17,6 @@ limitations under the License.
package
fake
import
(
"errors"
"fmt"
"net"
"regexp"
...
...
@@ -191,7 +190,7 @@ func (f *FakeCloud) EnsureLoadBalancerDeleted(clusterName string, service *v1.Se
}
func
(
f
*
FakeCloud
)
AddSSHKeyToAllInstances
(
user
string
,
keyData
[]
byte
)
error
{
return
errors
.
New
(
"unimplemented"
)
return
cloudprovider
.
NotImplemented
}
// Implementation of Instances.CurrentNodeName
...
...
pkg/cloudprovider/providers/gce/gce_instances.go
View file @
1339e4cf
...
...
@@ -17,7 +17,6 @@ limitations under the License.
package
gce
import
(
"errors"
"fmt"
"net"
"net/http"
...
...
@@ -157,7 +156,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.
// If false is returned with no error, the instance will be immediately deleted by the cloud controller manager.
func
(
gce
*
GCECloud
)
InstanceExistsByProviderID
(
providerID
string
)
(
bool
,
error
)
{
return
false
,
errors
.
New
(
"unimplemented"
)
return
false
,
cloudprovider
.
NotImplemented
}
// InstanceID returns the cloud provider ID of the node with the specified NodeName.
...
...
pkg/cloudprovider/providers/openstack/openstack_instances.go
View file @
1339e4cf
...
...
@@ -17,7 +17,6 @@ limitations under the License.
package
openstack
import
(
"errors"
"fmt"
"regexp"
...
...
@@ -59,7 +58,7 @@ func (i *Instances) CurrentNodeName(hostname string) (types.NodeName, error) {
}
func
(
i
*
Instances
)
AddSSHKeyToAllInstances
(
user
string
,
keyData
[]
byte
)
error
{
return
errors
.
New
(
"unimplemented"
)
return
cloudprovider
.
NotImplemented
}
func
(
i
*
Instances
)
NodeAddresses
(
name
types
.
NodeName
)
([]
v1
.
NodeAddress
,
error
)
{
...
...
@@ -113,7 +112,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.
// If false is returned with no error, the instance will be immediately deleted by the cloud controller manager.
func
(
i
*
Instances
)
InstanceExistsByProviderID
(
providerID
string
)
(
bool
,
error
)
{
return
false
,
errors
.
New
(
"unimplemented"
)
return
false
,
cloudprovider
.
NotImplemented
}
// InstanceID returns the kubelet's cloud provider ID.
...
...
pkg/cloudprovider/providers/ovirt/ovirt.go
View file @
1339e4cf
...
...
@@ -18,7 +18,6 @@ package ovirt
import
(
"encoding/xml"
"errors"
"fmt"
"io"
"io/ioutil"
...
...
@@ -192,7 +191,7 @@ func (v *OVirtCloud) NodeAddresses(nodeName types.NodeName) ([]v1.NodeAddress, e
// This method will not be called from the node that is requesting this ID. i.e. metadata service
// and other local methods cannot be used here
func
(
v
*
OVirtCloud
)
NodeAddressesByProviderID
(
providerID
string
)
([]
v1
.
NodeAddress
,
error
)
{
return
[]
v1
.
NodeAddress
{},
errors
.
New
(
"unimplemented"
)
return
[]
v1
.
NodeAddress
{},
cloudprovider
.
NotImplemented
}
// mapNodeNameToInstanceName maps from a k8s NodeName to an ovirt instance name (the hostname)
...
...
@@ -214,7 +213,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.
// If false is returned with no error, the instance will be immediately deleted by the cloud controller manager.
func
(
v
*
OVirtCloud
)
InstanceExistsByProviderID
(
providerID
string
)
(
bool
,
error
)
{
return
false
,
errors
.
New
(
"unimplemented"
)
return
false
,
cloudprovider
.
NotImplemented
}
// InstanceID returns the cloud provider ID of the node with the specified NodeName.
...
...
@@ -233,7 +232,7 @@ func (v *OVirtCloud) InstanceID(nodeName types.NodeName) (string, error) {
// This method will not be called from the node that is requesting this ID. i.e. metadata service
// and other local methods cannot be used here
func
(
v
*
OVirtCloud
)
InstanceTypeByProviderID
(
providerID
string
)
(
string
,
error
)
{
return
""
,
errors
.
New
(
"unimplemented"
)
return
""
,
cloudprovider
.
NotImplemented
}
// InstanceType returns the type of the specified instance.
...
...
@@ -321,5 +320,5 @@ func (v *OVirtCloud) CurrentNodeName(hostname string) (types.NodeName, error) {
}
func
(
v
*
OVirtCloud
)
AddSSHKeyToAllInstances
(
user
string
,
keyData
[]
byte
)
error
{
return
errors
.
New
(
"unimplemented"
)
return
cloudprovider
.
NotImplemented
}
pkg/cloudprovider/providers/photon/photon.go
View file @
1339e4cf
...
...
@@ -421,11 +421,11 @@ func (pc *PCCloud) NodeAddresses(nodeName k8stypes.NodeName) ([]v1.NodeAddress,
// This method will not be called from the node that is requesting this ID. i.e. metadata service
// and other local methods cannot be used here
func
(
pc
*
PCCloud
)
NodeAddressesByProviderID
(
providerID
string
)
([]
v1
.
NodeAddress
,
error
)
{
return
[]
v1
.
NodeAddress
{},
errors
.
New
(
"unimplemented"
)
return
[]
v1
.
NodeAddress
{},
cloudprovider
.
NotImplemented
}
func
(
pc
*
PCCloud
)
AddSSHKeyToAllInstances
(
user
string
,
keyData
[]
byte
)
error
{
return
errors
.
New
(
"unimplemented"
)
return
cloudprovider
.
NotImplemented
}
func
(
pc
*
PCCloud
)
CurrentNodeName
(
hostname
string
)
(
k8stypes
.
NodeName
,
error
)
{
...
...
@@ -473,7 +473,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.
// If false is returned with no error, the instance will be immediately deleted by the cloud controller manager.
func
(
pc
*
PCCloud
)
InstanceExistsByProviderID
(
providerID
string
)
(
bool
,
error
)
{
return
false
,
errors
.
New
(
"unimplemented"
)
return
false
,
cloudprovider
.
NotImplemented
}
// InstanceID returns the cloud provider ID of the specified instance.
...
...
@@ -497,7 +497,7 @@ func (pc *PCCloud) InstanceID(nodeName k8stypes.NodeName) (string, error) {
// This method will not be called from the node that is requesting this ID. i.e. metadata service
// and other local methods cannot be used here
func
(
pc
*
PCCloud
)
InstanceTypeByProviderID
(
providerID
string
)
(
string
,
error
)
{
return
""
,
errors
.
New
(
"unimplemented"
)
return
""
,
cloudprovider
.
NotImplemented
}
func
(
pc
*
PCCloud
)
InstanceType
(
nodeName
k8stypes
.
NodeName
)
(
string
,
error
)
{
...
...
pkg/cloudprovider/providers/vsphere/vsphere.go
View file @
1339e4cf
...
...
@@ -354,7 +354,7 @@ func (vs *VSphere) NodeAddressesByProviderID(providerID string) ([]v1.NodeAddres
// AddSSHKeyToAllInstances add SSH key to all instances
func
(
vs
*
VSphere
)
AddSSHKeyToAllInstances
(
user
string
,
keyData
[]
byte
)
error
{
return
errors
.
New
(
"unimplemented"
)
return
cloudprovider
.
NotImplemented
}
// CurrentNodeName gives the current node name
...
...
@@ -380,7 +380,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.
// If false is returned with no error, the instance will be immediately deleted by the cloud controller manager.
func
(
vs
*
VSphere
)
InstanceExistsByProviderID
(
providerID
string
)
(
bool
,
error
)
{
return
false
,
errors
.
New
(
"unimplemented"
)
return
false
,
cloudprovider
.
NotImplemented
}
// InstanceID returns the cloud provider ID of the node with the specified Name.
...
...
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