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
2ab0e321
Commit
2ab0e321
authored
Dec 17, 2017
by
stewart-yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unuse code in cloudprovider
parent
cab439b2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
38 deletions
+0
-38
plugins.go
pkg/cloudprovider/plugins.go
+0
-12
gce.go
pkg/cloudprovider/providers/gce/gce.go
+0
-14
utils.go
pkg/cloudprovider/providers/vsphere/vclib/utils.go
+0
-12
No files found.
pkg/cloudprovider/plugins.go
View file @
2ab0e321
...
...
@@ -60,18 +60,6 @@ func IsCloudProvider(name string) bool {
return
found
}
// CloudProviders returns the name of all registered cloud providers in a
// string slice
func
CloudProviders
()
[]
string
{
names
:=
[]
string
{}
providersMutex
.
Lock
()
defer
providersMutex
.
Unlock
()
for
name
:=
range
providers
{
names
=
append
(
names
,
name
)
}
return
names
}
// GetCloudProvider creates an instance of the named cloud provider, or nil if
// the name is unknown. The error return is only used if the named provider
// was known but failed to initialize. The config parameter specifies the
...
...
pkg/cloudprovider/providers/gce/gce.go
View file @
2ab0e321
...
...
@@ -695,20 +695,6 @@ func gceSubnetworkURL(apiEndpoint, project, region, subnetwork string) string {
return
apiEndpoint
+
strings
.
Join
([]
string
{
"projects"
,
project
,
"regions"
,
region
,
"subnetworks"
,
subnetwork
},
"/"
)
}
// getProjectIDInURL parses full resource URLS and shorter URLS
// https://www.googleapis.com/compute/v1/projects/myproject/global/networks/mycustom
// projects/myproject/global/networks/mycustom
// All return "myproject"
func
getProjectIDInURL
(
urlStr
string
)
(
string
,
error
)
{
fields
:=
strings
.
Split
(
urlStr
,
"/"
)
for
i
,
v
:=
range
fields
{
if
v
==
"projects"
&&
i
<
len
(
fields
)
-
1
{
return
fields
[
i
+
1
],
nil
}
}
return
""
,
fmt
.
Errorf
(
"could not find project field in url: %v"
,
urlStr
)
}
// getRegionInURL parses full resource URLS and shorter URLS
// https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/subnetworks/a
// projects/myproject/regions/us-central1/subnetworks/a
...
...
pkg/cloudprovider/providers/vsphere/vclib/utils.go
View file @
2ab0e321
...
...
@@ -146,18 +146,6 @@ func GetPathFromVMDiskPath(vmDiskPath string) string {
return
datastorePathObj
.
Path
}
// GetDatastoreFromVMDiskPath retrieves the path from VM Disk Path.
// Example: For vmDiskPath - [vsanDatastore] kubevols/volume.vmdk, the path is vsanDatastore
func
GetDatastoreFromVMDiskPath
(
vmDiskPath
string
)
string
{
datastorePathObj
:=
new
(
object
.
DatastorePath
)
isSuccess
:=
datastorePathObj
.
FromString
(
vmDiskPath
)
if
!
isSuccess
{
glog
.
Errorf
(
"Failed to parse vmDiskPath: %s"
,
vmDiskPath
)
return
""
}
return
datastorePathObj
.
Datastore
}
//GetDatastorePathObjFromVMDiskPath gets the datastorePathObj from VM disk path.
func
GetDatastorePathObjFromVMDiskPath
(
vmDiskPath
string
)
(
*
object
.
DatastorePath
,
error
)
{
datastorePathObj
:=
new
(
object
.
DatastorePath
)
...
...
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