Skip to content
This repository was archived by the owner on Mar 22, 2018. It is now read-only.

Commit ba83c3f

Browse files
author
Kubernetes Submit Queue
authored
Merge pull request #52983 from kubermatic/use-notimplemented-error
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>. Use custom error for "unimplemented" **What this PR does / why we need it**: This introduces a new error type `NotImplemented` which is used in cloud-providers to tell that this functionality is not implemented. Needed for kubernetes/kubernetes#52645 to avoid doing a string comparison.
2 parents 228f842 + 6177102 commit ba83c3f

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

pkg/cloudprovider/providers/openstack/openstack_instances.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717
package openstack
1818

1919
import (
20-
"errors"
2120
"fmt"
2221
"regexp"
2322

@@ -63,7 +62,7 @@ func (i *Instances) CurrentNodeName(hostname string) (types.NodeName, error) {
6362
}
6463

6564
func (i *Instances) AddSSHKeyToAllInstances(user string, keyData []byte) error {
66-
return errors.New("unimplemented")
65+
return cloudprovider.NotImplemented
6766
}
6867

6968
func (i *Instances) NodeAddresses(name types.NodeName) ([]v1.NodeAddress, error) {
@@ -117,7 +116,7 @@ func (i *Instances) ExternalID(name types.NodeName) (string, error) {
117116
// InstanceExistsByProviderID returns true if the instance with the given provider id still exists and is running.
118117
// If false is returned with no error, the instance will be immediately deleted by the cloud controller manager.
119118
func (i *Instances) InstanceExistsByProviderID(providerID string) (bool, error) {
120-
return false, errors.New("unimplemented")
119+
return false, cloudprovider.NotImplemented
121120
}
122121

123122
// InstanceID returns the kubelet's cloud provider ID.

0 commit comments

Comments
 (0)