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
7ffaa2f7
Unverified
Commit
7ffaa2f7
authored
Sep 23, 2018
by
k8s-ci-robot
Committed by
GitHub
Sep 23, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #68388 from wgliang/fixbug/defer-in-loop
fix bug that defer in infinite loop
parents
b51c1908
05aeea12
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
vsphere_util.go
pkg/cloudprovider/providers/vsphere/vsphere_util.go
+12
-9
No files found.
pkg/cloudprovider/providers/vsphere/vsphere_util.go
View file @
7ffaa2f7
...
@@ -19,24 +19,23 @@ package vsphere
...
@@ -19,24 +19,23 @@ package vsphere
import
(
import
(
"context"
"context"
"errors"
"errors"
"fmt"
"io/ioutil"
"os"
"os"
"path/filepath"
"regexp"
"regexp"
"strings"
"strings"
"time"
"time"
"github.com/golang/glog"
"github.com/golang/glog"
"github.com/vmware/govmomi/vim25"
"github.com/vmware/govmomi/vim25"
"fmt"
"github.com/vmware/govmomi/vim25/mo"
"github.com/vmware/govmomi/vim25/mo"
"io/ioutil"
"k8s.io/api/core/v1"
"k8s.io/api/core/v1"
k8stypes
"k8s.io/apimachinery/pkg/types"
k8stypes
"k8s.io/apimachinery/pkg/types"
"k8s.io/kubernetes/pkg/cloudprovider/providers/vsphere/vclib"
"k8s.io/kubernetes/pkg/cloudprovider/providers/vsphere/vclib"
"k8s.io/kubernetes/pkg/cloudprovider/providers/vsphere/vclib/diskmanagers"
"k8s.io/kubernetes/pkg/cloudprovider/providers/vsphere/vclib/diskmanagers"
"k8s.io/kubernetes/pkg/util/version"
"k8s.io/kubernetes/pkg/util/version"
"path/filepath"
)
)
const
(
const
(
...
@@ -298,11 +297,15 @@ func (vs *VSphere) cleanUpDummyVMs(dummyVMPrefix string) {
...
@@ -298,11 +297,15 @@ func (vs *VSphere) cleanUpDummyVMs(dummyVMPrefix string) {
continue
continue
}
}
// A write lock is acquired to make sure the cleanUp routine doesn't delete any VM's created by ongoing PVC requests.
// A write lock is acquired to make sure the cleanUp routine doesn't delete any VM's created by ongoing PVC requests.
defer
cleanUpDummyVMLock
.
Lock
()
cleanUpDummyVMs
:=
func
()
{
err
=
diskmanagers
.
CleanUpDummyVMs
(
ctx
,
vmFolder
,
dc
)
cleanUpDummyVMLock
.
Lock
()
if
err
!=
nil
{
defer
cleanUpDummyVMLock
.
Unlock
()
glog
.
V
(
4
)
.
Infof
(
"Unable to clean up dummy VM's in the kubernetes cluster: %q. err: %+v"
,
vs
.
cfg
.
Workspace
.
Folder
,
err
)
err
=
diskmanagers
.
CleanUpDummyVMs
(
ctx
,
vmFolder
,
dc
)
if
err
!=
nil
{
glog
.
V
(
4
)
.
Infof
(
"Unable to clean up dummy VM's in the kubernetes cluster: %q. err: %+v"
,
vs
.
cfg
.
Workspace
.
Folder
,
err
)
}
}
}
cleanUpDummyVMs
()
}
}
}
}
...
...
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