Merge pull request #64452 from wgliang/master.remove-cloudprovider

cleanup some dead cloudprovider code
This commit is contained in:
k8s-ci-robot 2018-09-30 23:24:31 -07:00 committed by GitHub
commit 042139d8c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 38 deletions

View File

@ -1016,10 +1016,6 @@ func updateConfigZone(cfg *CloudConfig, metadata EC2Metadata) error {
return nil
}
func getInstanceType(metadata EC2Metadata) (string, error) {
return metadata.GetMetadata("instance-type")
}
func getAvailabilityZone(metadata EC2Metadata) (string, error) {
return metadata.GetMetadata("placement/availability-zone")
}
@ -1970,23 +1966,6 @@ func (c *Cloud) buildSelfAWSInstance() (*awsInstance, error) {
return newAWSInstance(c.ec2, instance), nil
}
// Gets the awsInstance with for the node with the specified nodeName, or the 'self' instance if nodeName == ""
func (c *Cloud) getAwsInstance(nodeName types.NodeName) (*awsInstance, error) {
var awsInstance *awsInstance
if nodeName == "" {
awsInstance = c.selfAWSInstance
} else {
instance, err := c.getInstanceByNodeName(nodeName)
if err != nil {
return nil, err
}
awsInstance = newAWSInstance(c.ec2, instance)
}
return awsInstance, nil
}
// wrapAttachError wraps the error returned by an AttachVolume request with
// additional information, if needed and possible.
func wrapAttachError(err error, disk *awsDisk, instance string) error {

View File

@ -176,11 +176,6 @@ func mapNodeNameToInstanceName(nodeName types.NodeName) string {
return string(nodeName)
}
// mapInstanceToNodeName maps a GCE Instance to a k8s NodeName
func mapInstanceToNodeName(instance *compute.Instance) types.NodeName {
return types.NodeName(instance.Name)
}
// GetGCERegion returns region of the gce zone. Zone names
// are of the form: ${region-name}-${ix}.
// For example, "us-central1-b" has a region of "us-central1".

View File

@ -80,18 +80,6 @@ func getVSphereConfig() (*VSphereConfig, error) {
return &cfg, nil
}
func getVSphereConn(cfg *VSphereConfig) *vclib.VSphereConnection {
vSphereConn := &vclib.VSphereConnection{
Username: cfg.Global.User,
Password: cfg.Global.Password,
Hostname: cfg.Global.VCenterIP,
Insecure: cfg.Global.InsecureFlag,
RoundTripperCount: cfg.Global.RoundTripperCount,
Port: cfg.Global.VCenterPort,
}
return vSphereConn
}
// Returns the accessible datastores for the given node VM.
func getAccessibleDatastores(ctx context.Context, nodeVmDetail *NodeDetails, nodeManager *NodeManager) ([]*vclib.DatastoreInfo, error) {
accessibleDatastores, err := nodeVmDetail.vm.GetAllAccessibleDatastores(ctx)