-
Notifications
You must be signed in to change notification settings - Fork 541
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
ImageName should be able to parse image names with IPv6 address literals #2603
Conversation
Eclipse JKube CI ReportStarted new GH workflow run for #2603 (2024-02-08T06:15:03Z) ⚙️ JKube E2E Tests (7825557044)
|
1.added IPv6 address 2.upated DOMAIN_REGEX for the IPv6 addresses 3.uncommented the related tests removing issue references removing issue references
500718d
to
6949be6
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #2603 +/- ##
=============================================
+ Coverage 59.36% 70.46% +11.10%
- Complexity 4586 4995 +409
=============================================
Files 500 486 -14
Lines 21211 19449 -1762
Branches 2830 2504 -326
=============================================
+ Hits 12591 13705 +1114
+ Misses 7370 4522 -2848
+ Partials 1250 1222 -28 ☔ View full report in Codecov by Sentry. |
Add TestHttpBuildPackArtifactsServer to host build pack download artifacts so that this test utility class can be reused in dependent modules Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…heck before 'equals()' call
…richerConfigTest with builders eclipse-jkube#2597 (eclipse-jkube#2604)
private static final Pattern DOMAIN_REGEXP = Pattern.compile("^(?:" + IPV6_ADDRESS_REGEXP + "|" + DOMAIN_COMPONENT_REGEXP + "(?:\\." + DOMAIN_COMPONENT_REGEXP + ")*)" + | ||
"(?::\\d+)?$"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make it easier to read, could you break this down into more REGEXP COMPONENTS:
private static final String OPTIONAL_PORT_REGEXP = "(?::[0-9]+)?";
private static final String DOMAIN_NAME_REGEXP = DOMAIN_COMPONENT_REGEXP + "(?:\\." + DOMAIN_COMPONENT_REGEXP + ")*";
private static final String REGISTRY_HOST_REGEXP = "^(?:" + IPV6_ADDRESS_REGEXP + "|" + DOMAIN_NAME_REGEXP + ")";
private static final Pattern REGISTRY_REGEXP = Pattern.compile(REGISTRY_HOST_REGEXP + OPTIONAL_PORT_REGEXP);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make it easier to read, could you break this down into more REGEXP COMPONENTS:
private static final String OPTIONAL_PORT_REGEXP = "(?::[0-9]+)?"; private static final String DOMAIN_NAME_REGEXP = DOMAIN_COMPONENT_REGEXP + "(?:\\." + DOMAIN_COMPONENT_REGEXP + ")*"; private static final String REGISTRY_HOST_REGEXP = "^(?:" + IPV6_ADDRESS_REGEXP + "|" + DOMAIN_NAME_REGEXP + ")"; private static final Pattern REGISTRY_REGEXP = Pattern.compile(REGISTRY_HOST_REGEXP + OPTIONAL_PORT_REGEXP);
Done
@@ -352,7 +353,8 @@ private boolean isRegistryValidPathComponent() { | |||
private static final Pattern IMAGE_NAME_REGEXP = Pattern.compile(NAME_COMPONENT_REGEXP + "(?:(?:/" + NAME_COMPONENT_REGEXP + ")+)?"); | |||
|
|||
// https://github.com/docker/docker/blob/04da4041757370fb6f85510c8977c5a18ddae380/vendor/github.com/docker/distribution/reference/regexp.go#L31 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please update the comment pointing to regexp source too?
…List() instead of null eclipse-jkube#2530 (eclipse-jkube#2605)
Signed-off-by: Marc Nuri <marc@marcnuri.com>
…n exception is never thrown issue eclipse-jkube#2592 (eclipse-jkube#2611)
…kube#2618) Remove unnecessary exception declaration in IngressEnricherTest.setUp
Hii @rohanKanojia sonarcloud asking to refactor this code should i do it? |
Bumps [org.apache.maven:maven-core](https://github.com/apache/maven) from 3.6.3 to 3.8.1. - [Release notes](https://github.com/apache/maven/releases) - [Commits](apache/maven@maven-3.6.3...maven-3.8.1) --- updated-dependencies: - dependency-name: org.apache.maven:maven-core dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
@Devashishbasu : Could you please check Docker's distribution/regexp.go if they also have same repetition. We should be aligned with what's in docker source. |
…ls added via resource configuration While adding labels and selectors to a resource, WellKnownLabelEnricher and ProjectLabelEnricher would give precedence to label configured via resource label XML/Groovy DSL configuration. This precedence would depend on the type of resource label configuration used. If `all` has been provided in configuration, this means precedence would be given for all resources. However, if some specific resource label configuration is used; precedence would only be given for that specific resource Signed-off-by: Rohan Kumar <rohaan@redhat.com>
Signed-off-by: Marc Nuri <marc@marcnuri.com>
…yList() instead of null (eclipse-jkube#2610)
I have checked it with Docker's distribution/regexp.go and with master branch also...the new expression is aligned with Docker's [distribution/regexp.go] (https://github.com/distribution/reference/blob/8507c7fcf0da9f570540c958ea7b972c30eeaeca/regexp.go) and the sonar cloud is also suggesting to refactor optional port regex what should we do now? |
@Devashishbasu : You can ignore the sonar warning. |
So is it ready to merge? or I have do anything else? |
Add TestHttpBuildPackArtifactsServer to host build pack download artifacts so that this test utility class can be reused in dependent modules Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…jkube#2493) + Add new enum for buildpacks in JKubeBuildStrategy + Add BuildPackBuildService that would be activated when build strategy is set to buildpacks Signed-off-by: Rohan Kumar <rohaan@redhat.com>
Signed-off-by: Marc Nuri <marc@marcnuri.com>
Signed-off-by: Marc Nuri <marc@marcnuri.com>
Signed-off-by: Marc Nuri <marc@marcnuri.com>
Hii @rohanKanojia |
@@ -351,8 +354,13 @@ private boolean isRegistryValidPathComponent() { | |||
// https://github.com/docker/docker/blob/04da4041757370fb6f85510c8977c5a18ddae380/vendor/github.com/docker/distribution/reference/regexp.go#L53 | |||
private static final Pattern IMAGE_NAME_REGEXP = Pattern.compile(NAME_COMPONENT_REGEXP + "(?:(?:/" + NAME_COMPONENT_REGEXP + ")+)?"); | |||
|
|||
// https://github.com/distribution/reference/blob/8507c7fcf0da9f570540c958ea7b972c30eeaeca/regexp.go#L65 | |||
private static final String OPTIONAL_PORT_REGEXP = "(?::[0-9]+)?"; | |||
private static final String DOMAIN_NAME_REGEXP = DOMAIN_COMPONENT_REGEXP + "(?:\\." + DOMAIN_COMPONENT_REGEXP + ")*"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private static final String DOMAIN_NAME_REGEXP = DOMAIN_COMPONENT_REGEXP + "(?:\\." + DOMAIN_COMPONENT_REGEXP + ")*"; | |
// https://github.com/distribution/reference/blob/8507c7fcf0da9f570540c958ea7b972c30eeaeca/regexp.go#L99 | |
private static final String DOMAIN_NAME_REGEXP = DOMAIN_COMPONENT_REGEXP + "(?:\\." + DOMAIN_COMPONENT_REGEXP + ")*"; |
// https://github.com/distribution/reference/blob/8507c7fcf0da9f570540c958ea7b972c30eeaeca/regexp.go#L65 | ||
private static final String OPTIONAL_PORT_REGEXP = "(?::[0-9]+)?"; | ||
private static final String DOMAIN_NAME_REGEXP = DOMAIN_COMPONENT_REGEXP + "(?:\\." + DOMAIN_COMPONENT_REGEXP + ")*"; | ||
private static final String REGISTRY_HOST_REGEXP = "^(?:" + IPV6_ADDRESS_REGEXP + "|" + DOMAIN_NAME_REGEXP + ")"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private static final String REGISTRY_HOST_REGEXP = "^(?:" + IPV6_ADDRESS_REGEXP + "|" + DOMAIN_NAME_REGEXP + ")"; | |
// https://github.com/distribution/reference/blob/8507c7fcf0da9f570540c958ea7b972c30eeaeca/regexp.go#L106 | |
private static final String REGISTRY_HOST_REGEXP = "^(?:" + IPV6_ADDRESS_REGEXP + "|" + DOMAIN_NAME_REGEXP + ")"; |
// https://github.com/docker/docker/blob/04da4041757370fb6f85510c8977c5a18ddae380/vendor/github.com/docker/distribution/reference/regexp.go#L31 | ||
private static final Pattern DOMAIN_REGEXP = Pattern.compile("^" + DOMAIN_COMPONENT_REGEXP + "(?:\\." + DOMAIN_COMPONENT_REGEXP + ")*(?::[0-9]+)?$"); | ||
private static final Pattern REGISTRY_REGEXP = Pattern.compile(REGISTRY_HOST_REGEXP + OPTIONAL_PORT_REGEXP); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private static final Pattern REGISTRY_REGEXP = Pattern.compile(REGISTRY_HOST_REGEXP + OPTIONAL_PORT_REGEXP); | |
// https://github.com/distribution/reference/blob/8507c7fcf0da9f570540c958ea7b972c30eeaeca/regexp.go#L110 | |
private static final Pattern REGISTRY_REGEXP = Pattern.compile(REGISTRY_HOST_REGEXP + OPTIONAL_PORT_REGEXP); |
Looks good, only minor comment regarding adding regexp sources |
1.added IPv6 address 2.upated DOMAIN_REGEX for the IPv6 addresses 3.uncommented the related tests removing issue references removing issue references Implemented suggested changes by sonarcloud updated the suggested changes adding suggested changes by rohan sir
…-address-literals' of https://github.com/Devashishbasu/jkube into ImageName-should-be-able-to-parse-image-names-with-IPv6-address-literals
|
1.added IPv6 address
2.upated DOMAIN_REGEX for the IPv6 addresses
3.uncommented the related tests
Fixes #2541
Type of change
Checklist