Skip to content

Commit

Permalink
fix: reinitialization of cache rule context
Browse files Browse the repository at this point in the history
  • Loading branch information
npk-amperon committed May 29, 2024
1 parent 3f6ae05 commit 827c7d3
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (r ContainerRegistryCacheRule) Create() sdk.ResourceFunc {
Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error {
cacheRulesClient := metadata.Client.Containers.CacheRulesClient
subscriptionId := metadata.Client.Account.SubscriptionId
ctx, cancel := timeouts.ForCreate(metadata.Client.StopContext, metadata.ResourceData)
_, cancel := timeouts.ForCreate(metadata.Client.StopContext, metadata.ResourceData)

var config ContainerRegistryCacheRuleModel
if err := metadata.Decode(&config); err != nil {
Expand Down Expand Up @@ -149,7 +149,7 @@ func (ContainerRegistryCacheRule) Read() sdk.ResourceFunc {
Timeout: 5 * time.Minute,
Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error {
cacheRulesClient := metadata.Client.Containers.CacheRulesClient
ctx, cancel := timeouts.ForRead(metadata.Client.StopContext, metadata.ResourceData)
_, cancel := timeouts.ForRead(metadata.Client.StopContext, metadata.ResourceData)

var config ContainerRegistryCacheRuleModel
if err := metadata.Decode(&config); err != nil {
Expand Down Expand Up @@ -196,7 +196,7 @@ func (r ContainerRegistryCacheRule) Update() sdk.ResourceFunc {
Timeout: 30 * time.Minute,
Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error {
cacheRulesClient := metadata.Client.Containers.CacheRulesClient
ctx, cancel := timeouts.ForUpdate(metadata.Client.StopContext, metadata.ResourceData)
_, cancel := timeouts.ForUpdate(metadata.Client.StopContext, metadata.ResourceData)

var config ContainerRegistryCacheRuleModel
if err := metadata.Decode(&config); err != nil {
Expand Down Expand Up @@ -233,7 +233,7 @@ func (ContainerRegistryCacheRule) Delete() sdk.ResourceFunc {
Timeout: 30 * time.Minute,
Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error {
cacheRulesClient := metadata.Client.Containers.CacheRulesClient
ctx, cancel := timeouts.ForDelete(metadata.Client.StopContext, metadata.ResourceData)
_, cancel := timeouts.ForDelete(metadata.Client.StopContext, metadata.ResourceData)
defer cancel()

id, err := cacherules.ParseCacheRuleID(metadata.ResourceData.Id())
Expand Down

0 comments on commit 827c7d3

Please sign in to comment.