Skip to content

Commit 16d5e02

Browse files
authored
Merge pull request #425 from shapeblue/fixup-client-cache-key
Fixup cache key for projects
2 parents 386ab62 + 3816259 commit 16d5e02

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/cloud/client.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ func NewClientFromConf(conf Config, clientConfig *corev1.ConfigMap, project stri
160160
clientCache = newClientCache(clientConfig)
161161
}
162162

163-
clientCacheKey := generateClientCacheKey(conf)
163+
clientCacheKey := generateClientCacheKey(conf, project)
164164
if item := clientCache.Get(clientCacheKey); item != nil {
165165
return item.Value(), nil
166166
}
@@ -252,8 +252,8 @@ func NewClientFromCSAPIClient(cs *cloudstack.CloudStackClient, user *User) Clien
252252
}
253253

254254
// generateClientCacheKey generates a cache key from a Config
255-
func generateClientCacheKey(conf Config) string {
256-
return fmt.Sprintf("%+v", conf)
255+
func generateClientCacheKey(conf Config, project string) string {
256+
return fmt.Sprintf("%s-%+v", project, conf)
257257
}
258258

259259
// newClientCache returns a new instance of client cache

0 commit comments

Comments
 (0)