Skip to content

Commit

Permalink
o/assertstate: use ValidationSetKey to create unique identifiers for …
Browse files Browse the repository at this point in the history
…validation sets
  • Loading branch information
andrewphelpsj authored and Meulengracht committed Feb 23, 2024
1 parent a1e658d commit 04fd0ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions overlord/assertstate/validation_set_tracking.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func TrackedEnforcedValidationSets(st *state.State, extraVss ...*asserts.Validat
skip := make(map[string]bool, len(extraVss))
for _, extraVs := range extraVss {
sets.Add(extraVs)
skip[fmt.Sprintf("%s:%s", extraVs.AccountID(), extraVs.Name())] = true
skip[ValidationSetKey(extraVs.AccountID(), extraVs.Name())] = true
}

skipSet := func(key string) bool {
Expand All @@ -221,7 +221,7 @@ func TrackedEnforcedValidationSets(st *state.State, extraVss ...*asserts.Validat
func TrackedEnforcedValidationSetsForModel(st *state.State, model *asserts.Model) (*snapasserts.ValidationSets, error) {
modelSets := make(map[string]bool, len(model.ValidationSets()))
for _, vs := range model.ValidationSets() {
modelSets[fmt.Sprintf("%s:%s", vs.AccountID, vs.Name)] = true
modelSets[ValidationSetKey(vs.AccountID, vs.Name)] = true
}

skipSet := func(key string) bool {
Expand Down Expand Up @@ -249,7 +249,7 @@ func trackedEnforcedValidationSets(st *state.State, skipSet func(string) bool, s
continue
}

if skipSet(fmt.Sprintf("%s:%s", vs.AccountID, vs.Name)) {
if skipSet(ValidationSetKey(vs.AccountID, vs.Name)) {
continue
}

Expand Down

0 comments on commit 04fd0ec

Please sign in to comment.