Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cherry-pick] fix: fix replication list projects with pure numberic name #19092

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/pkg/reg/adapter/harbor/base/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ func (a *Adapter) PrepareForPush(resources []*model.Resource) error {
for p := range projects {
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
queryProjects, err := a.Client.ListProjectsWithQuery(q, false)
if err != nil {
Expand Down