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

Add logic to handle :<port> in key or value for swap map entries #50

Merged
merged 9 commits into from
Sep 2, 2021

Conversation

phenixblue
Copy link
Owner

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:

/kind bug

/kind cleanup
/kind deprecation
/kind design
/kind documentation
/kind feature
/kind release

What this PR does / why we need it:

This PR adds additional logic to handle :<port> style registry syntax for the key or value portions of a map definition.

Example:

registry.waldo.com:8443::registry.garply.com # Swap map key that includes a port
registry.foo.com::localhost:30003/foo # Swap map value that includes a port
registry.bar.com:8443::registry.baz.com:30003/bar # Swap map key & value that include a port

This adds a new separator type for map definitions: :: instead of :

Going forward the :: syntax will be the default, but for now the existing : will work for any map definitions that don't include a port in the key or value.

Additional logic has also been added to handle the case where a map definition includes a port in the key or value with/without the new separator.

Warning messages will be logged for maps using the old style separator or when a port is specified with the incorrect syntax.

Which issue(s) this PR fixes:

Fixes #49

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

- The existing separator syntax for maps (ie `:`) has been deprecated. A new separator syntax has been added for map definitions. Please use `::` instead of `:` from now on. 
- Logic has been added to filter out lines of the map file with incorrect syntax. While this shouldn't interfere with backwards compatibility, not all possible combinations of characters have been tested. Check the logs of the ImageSwap pods if you experience issues and open an issue if necessary.

Additional documentation e.g., usage docs, etc.:


Copy link
Collaborator

@ilrudie ilrudie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Ready for doc...

@phenixblue phenixblue changed the title [WIP] Add logic to handle :<port> in key or value for swap map entries Add logic to handle :<port> in key or value for swap map entries Sep 1, 2021
@phenixblue
Copy link
Owner Author

Docs updated

Copy link
Collaborator

@ilrudie ilrudie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@phenixblue phenixblue merged commit d7d8d65 into master Sep 2, 2021
@phenixblue phenixblue deleted the issue-49-fix branch July 5, 2022 15:10
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.

Map doesn't parse correctly when a port is specified
2 participants