mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-03 05:21:38 +01:00
fix: fix replication list projects with pure numberic name (#19090)
Quote the project name when listing projects in the replication, resolve the issue of pure number name of project. Signed-off-by: chlins <chenyuzh@vmware.com>
This commit is contained in:
parent
530b78285b
commit
8c23bcdc54
@ -164,7 +164,8 @@ func (a *Adapter) PrepareForPush(resources []*model.Resource) error {
|
|||||||
for p := range projects {
|
for p := range projects {
|
||||||
ps = append(ps, p)
|
ps = append(ps, p)
|
||||||
}
|
}
|
||||||
q := fmt.Sprintf("name={%s}", strings.Join(ps, " "))
|
// query by project name, decorate the name as string to avoid parsed as int by server in case of pure numbers as project name
|
||||||
|
q := fmt.Sprintf("name={'%s'}", strings.Join(ps, " "))
|
||||||
// get exist projects
|
// get exist projects
|
||||||
queryProjects, err := a.Client.ListProjectsWithQuery(q, false)
|
queryProjects, err := a.Client.ListProjectsWithQuery(q, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user