-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix creation of replications with dest_namespace_replace = 0 (#314)
- 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](https://github.com/goharbor/harbor/blob/cb0749c7abef5783e4f8857f1f564377f64337c1/api/v2.0/swagger.yaml#L7167-L7172)). All other, non-zero values work fine. Also, I see that `omitempty` tag was set some time ago by #282. Thank you --------- Signed-off-by: Dmitry G <[email protected]> Co-authored-by: Florian Blampey <[email protected]>
- Loading branch information
Showing
3 changed files
with
5 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters