Skip to content

Commit

Permalink
add config enabled boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-lombardi committed Jun 17, 2024
1 parent a78c68c commit 58e70c1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions pkg/types/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ type GatewayServiceConfig struct {
type ImageServiceConfig struct {
CacheURL string `key:"cacheURL" json:"cache_url"`
CacheConfig blobcache.BlobCacheConfig `key:"cacheConfig" json:"cache_config"`
CachedEnabled bool `key:"cachedEnabled" json:"cache_enabled"`
RegistryStore string `key:"registryStore" json:"registry_store"`
RegistryCredentialProviderName string `key:"registryCredentialProvider" json:"registry_credential_provider_name"`
Registries ImageRegistriesConfig `key:"registries" json:"registries"`
Expand Down
10 changes: 7 additions & 3 deletions pkg/worker/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,13 @@ func NewImageClient(config types.ImageServiceConfig, workerId string, workerRepo
return nil, err
}

client, err := blobcache.NewBlobCacheClient(context.TODO(), config.CacheConfig)
if err != nil {
return nil, err
var client *blobcache.BlobCacheClient = nil

if config.CachedEnabled {
client, err = blobcache.NewBlobCacheClient(context.TODO(), config.CacheConfig)
if err != nil {
return nil, err
}
}

c := &ImageClient{
Expand Down

0 comments on commit 58e70c1

Please sign in to comment.