mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-22 00:27:44 +01:00
Fix immutable rule sequence to list API
Signed-off-by: wang yan <wangyan@vmware.com>
This commit is contained in:
parent
06e4e124d8
commit
cbc9414db8
@ -5,6 +5,7 @@ import (
|
|||||||
"github.com/goharbor/harbor/src/pkg/immutabletag/dao"
|
"github.com/goharbor/harbor/src/pkg/immutabletag/dao"
|
||||||
dao_model "github.com/goharbor/harbor/src/pkg/immutabletag/dao/model"
|
dao_model "github.com/goharbor/harbor/src/pkg/immutabletag/dao/model"
|
||||||
"github.com/goharbor/harbor/src/pkg/immutabletag/model"
|
"github.com/goharbor/harbor/src/pkg/immutabletag/model"
|
||||||
|
"sort"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -84,6 +85,9 @@ func (drm *defaultRuleManager) QueryImmutableRuleByProjectID(projectID int64) ([
|
|||||||
rule.Disabled = daoRule.Disabled
|
rule.Disabled = daoRule.Disabled
|
||||||
rules = append(rules, rule)
|
rules = append(rules, rule)
|
||||||
}
|
}
|
||||||
|
sort.Slice(rules, func(i, j int) bool {
|
||||||
|
return rules[i].ID < rules[j].ID
|
||||||
|
})
|
||||||
return rules, nil
|
return rules, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user