Skip to content

Commit 6204808

Browse files
committed
Fix repo/key locker naming
1 parent 381bac1 commit 6204808

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pkg/helm/client.go

+5-6
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type PathCacher interface {
3131
GetPaths() map[string]string
3232
}
3333

34-
type KeyLock interface {
34+
type KeyLocker interface {
3535
Lock(key string)
3636
Unlock(key string)
3737
RLock(key string)
@@ -40,12 +40,11 @@ type KeyLock interface {
4040

4141
type Client struct {
4242
Paths PathCacher
43+
RepoLock KeyLocker
4344
MaxExtractSize resource.Quantity
4445
Project string
4546
Proxy string
4647
NoProxy string
47-
48-
repoLock KeyLock
4948
}
5049

5150
func NewClient(paths PathCacher, project, maxExtractSize string) (*Client, error) {
@@ -56,9 +55,9 @@ func NewClient(paths PathCacher, project, maxExtractSize string) (*Client, error
5655

5756
return &Client{
5857
Paths: paths,
58+
RepoLock: globalLock,
5959
MaxExtractSize: maxExtractSizeResource,
6060
Project: project,
61-
repoLock: globalLock,
6261
}, nil
6362
}
6463

@@ -134,8 +133,8 @@ func (c *Client) getCachedOrRemoteChart(chart, version string, repo *helmrepo.Re
134133
return "", fmt.Errorf("error getting cached chart path: %w", err)
135134
}
136135

137-
c.repoLock.Lock(cachedChartPath)
138-
defer c.repoLock.Unlock(cachedChartPath)
136+
c.RepoLock.Lock(cachedChartPath)
137+
defer c.RepoLock.Unlock(cachedChartPath)
139138

140139
// check if chart tar is already downloaded
141140
exists, err := fileExists(cachedChartPath)

0 commit comments

Comments
 (0)