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

Fix creation of replications with dest_namespace_replace = 0 #314

Merged
merged 4 commits into from
Jun 5, 2023

Conversation

dmitry-g
Copy link
Contributor

@dmitry-g dmitry-g commented Apr 2, 2023

  • Remove omitempty tag from DestNamespaceReplace

When the value of dest_namespace_replace is set to 0, Harbor actually creates a replication rule with dest_namespace_replace_count of -1 (flatten all levels).

It happens because DestNamespaceReplace field has omitempty tag, which filters out the field when its value is set to 0. Therefore Harbor falls back to its default value of -1 (docs).

All other, non-zero values work fine.

Also, I see that omitempty tag was set some time ago by #282.

Thank you

 - Remove `omitempty` tag from `DestNamespaceReplace`

Signed-off-by: Dmitry G <[email protected]>
@dmitry-g dmitry-g requested a review from a team as a code owner April 2, 2023 18:04
@flbla
Copy link
Contributor

flbla commented May 22, 2023

hi @dmitry-g,
thank you for the PR 👍
I think we should update the default value to -1 as it's the actual default one

@flbla flbla merged commit dd5d6a8 into goharbor:main Jun 5, 2023
@OrlinVasilev
Copy link
Member

@dmitry-g congrats on merging your first PR here :))

@dmitry-g dmitry-g deleted the fix/dest_namespace_replace branch August 9, 2023 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants