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
d4d5c1e7
Commit
d4d5c1e7
authored
Aug 22, 2018
by
Doug MacEachern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vsphere: adjust to govmomi tags API changes
parent
5816a8bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
vsphere.go
pkg/cloudprovider/providers/vsphere/vsphere.go
+7
-7
No files found.
pkg/cloudprovider/providers/vsphere/vsphere.go
View file @
d4d5c1e7
...
@@ -34,7 +34,7 @@ import (
...
@@ -34,7 +34,7 @@ import (
"gopkg.in/gcfg.v1"
"gopkg.in/gcfg.v1"
"github.com/golang/glog"
"github.com/golang/glog"
_
"github.com/vmware/govmomi/vapi/rest"
"github.com/vmware/govmomi/vapi/rest"
"github.com/vmware/govmomi/vapi/tags"
"github.com/vmware/govmomi/vapi/tags"
"k8s.io/api/core/v1"
"k8s.io/api/core/v1"
k8stypes
"k8s.io/apimachinery/pkg/types"
k8stypes
"k8s.io/apimachinery/pkg/types"
...
@@ -1319,11 +1319,10 @@ func (vs *VSphere) NodeManager() (nodeManager *NodeManager) {
...
@@ -1319,11 +1319,10 @@ func (vs *VSphere) NodeManager() (nodeManager *NodeManager) {
return
vs
.
nodeManager
return
vs
.
nodeManager
}
}
func
withTagsClient
(
ctx
context
.
Context
,
connection
*
vclib
.
VSphereConnection
,
f
func
(
c
*
tags
.
RestClient
)
error
)
error
{
func
withTagsClient
(
ctx
context
.
Context
,
connection
*
vclib
.
VSphereConnection
,
f
func
(
c
*
rest
.
Client
)
error
)
error
{
vsURL
:=
connection
.
Client
.
URL
()
c
:=
rest
.
NewClient
(
connection
.
Client
)
vsURL
.
User
=
url
.
UserPassword
(
connection
.
Username
,
connection
.
Password
)
user
:=
url
.
UserPassword
(
connection
.
Username
,
connection
.
Password
)
c
:=
tags
.
NewClient
(
vsURL
,
connection
.
Insecure
,
""
)
if
err
:=
c
.
Login
(
ctx
,
user
);
err
!=
nil
{
if
err
:=
c
.
Login
(
ctx
);
err
!=
nil
{
return
err
return
err
}
}
defer
c
.
Logout
(
ctx
)
defer
c
.
Logout
(
ctx
)
...
@@ -1354,7 +1353,8 @@ func (vs *VSphere) GetZone(ctx context.Context) (cloudprovider.Zone, error) {
...
@@ -1354,7 +1353,8 @@ func (vs *VSphere) GetZone(ctx context.Context) (cloudprovider.Zone, error) {
return
cloudprovider
.
Zone
{},
err
return
cloudprovider
.
Zone
{},
err
}
}
client
:=
vsi
.
conn
client
:=
vsi
.
conn
err
=
withTagsClient
(
ctx
,
client
,
func
(
client
*
tags
.
RestClient
)
error
{
err
=
withTagsClient
(
ctx
,
client
,
func
(
c
*
rest
.
Client
)
error
{
client
:=
tags
.
NewManager
(
c
)
tags
,
err
:=
client
.
ListAttachedTags
(
ctx
,
vmHost
)
tags
,
err
:=
client
.
ListAttachedTags
(
ctx
,
vmHost
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"Cannot list attached tags. Get zone for node %s error"
,
nodeName
)
glog
.
Errorf
(
"Cannot list attached tags. Get zone for node %s error"
,
nodeName
)
...
...
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