Skip to content

Commit

Permalink
Improve comments and rename c.computeResourceVersion to c.areStableRe…
Browse files Browse the repository at this point in the history
…sourceVersionsComputed to make it state rather than action
  • Loading branch information
valerian-roche committed Feb 7, 2024
1 parent 8d3db09 commit 81b2834
Show file tree
Hide file tree
Showing 5 changed files with 393 additions and 280 deletions.
9 changes: 4 additions & 5 deletions pkg/cache/v3/delta.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ import (

// groups together resource-related arguments for the createDeltaResponse function
type resourceContainer struct {
resourceMap map[string]types.Resource
versionMap map[string]string
systemVersion string
resourceMap map[string]types.Resource
versionMap map[string]string
}

func createDeltaResponse(ctx context.Context, req *DeltaRequest, sub Subscription, resources resourceContainer) *RawDeltaResponse {
func createDeltaResponse(ctx context.Context, req *DeltaRequest, sub Subscription, resources resourceContainer, cacheVersion string) *RawDeltaResponse {
// variables to build our response with
var nextVersionMap map[string]string
var filtered []types.Resource
Expand Down Expand Up @@ -81,7 +80,7 @@ func createDeltaResponse(ctx context.Context, req *DeltaRequest, sub Subscriptio
Resources: filtered,
RemovedResources: toRemove,
NextVersionMap: nextVersionMap,
SystemVersionInfo: resources.systemVersion,
SystemVersionInfo: cacheVersion,
Ctx: ctx,
}
}
Loading

0 comments on commit 81b2834

Please sign in to comment.