Skip to content

Commit 99c7921

Browse files
authored
[credentials] Add version to cache key (jetify-com#2066)
## Summary TSIA ## How was it tested?
1 parent 43481bb commit 99c7921

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

internal/devbox/providers/nixcache/nixcache.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package nixcache
22

33
import (
44
"context"
5+
"fmt"
56
"slices"
67
"time"
78

@@ -27,7 +28,12 @@ func Get() *Provider {
2728
// Credentials fetches short-lived credentials that grant access to the user's
2829
// private cache.
2930
func (p *Provider) Credentials(ctx context.Context) (AWSCredentials, error) {
30-
cache := filecache.New[AWSCredentials]("devbox/providers/nixcache")
31+
// Adding version to caches to avoid conflicts if we want to update the schema
32+
// or while working on dev.
33+
cache := filecache.New[AWSCredentials](fmt.Sprintf(
34+
"devbox/%s/providers/nixcache",
35+
build.Version,
36+
))
3137
token, err := identity.Get().GenSession(ctx)
3238
if err != nil {
3339
return AWSCredentials{}, err

0 commit comments

Comments
 (0)