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

k8s:build fails to build image when image tag contains + #2301

Closed
rohanKanojia opened this issue Jul 24, 2023 · 0 comments · Fixed by #2303
Closed

k8s:build fails to build image when image tag contains + #2301

rohanKanojia opened this issue Jul 24, 2023 · 0 comments · Fixed by #2303
Assignees
Labels
bug Something isn't working
Milestone

Comments

@rohanKanojia
Copy link
Member

rohanKanojia commented Jul 24, 2023

Describe the bug

originally posted by @cimnine in #1859

If we configure Kubernetes Maven Plugin to use image name like this:

<jkube.generator.name>%a:4.3.3-SNAPSHOT+st1666023054591-b24-7ca68455</jkube.generator.name>

k8s:build fails with the following error saying image name is invalid:

The given version is a valid SemVer version, however, it's not a valid image tag name. We should replace + character with some other character to handle this scenario.

Eclipse JKube version

1.13.1

Component

Kubernetes Maven Plugin

Apache Maven version

other (please specify in additional context)

Gradle version

None

Steps to reproduce

Change image name generated by jkube to %a:4.3.3-SNAPSHOT+st1666023054591-b24-7ca68455 using property jkube.generator.name

Expected behavior

k8s:build should handle + tag by replacing it with some other docker compatible token

Runtime

Kubernetes (vanilla)

Kubernetes API Server version

1.25.3

Environment

Linux

Eclipse JKube Logs

[ERROR] k8s: Failed to execute the build [Given Docker name 'random-generator:4.3.3-SNAPSHOT+st1666023054591-b24-7ca68455' is invalid:
   * tag part '4.3.3-SNAPSHOT+st1666023054591-b24-7ca68455' doesn't match allowed pattern '^[\w][\w.-]{0,127}$'
See http://bit.ly/docker_image_fmt for more details]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  24.399 s
[INFO] Finished at: 2023-07-24T16:05:50+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.jkube:kubernetes-maven-plugin:1.14-SNAPSHOT:build (default-cli) on project random-generator: Failed to execute the build: Given Docker name 'random-generator:4.3.3-SNAPSHOT+st1666023054591-b24-7ca68455' is invalid:
[ERROR]    * tag part '4.3.3-SNAPSHOT+st1666023054591-b24-7ca68455' doesn't match allowed pattern '^[\w][\w.-]{0,127}$'
[ERROR] See http://bit.ly/docker_image_fmt for more details

Sample Reproducer Project

No response

Additional context

No response

@rohanKanojia rohanKanojia added the bug Something isn't working label Jul 24, 2023
rohanKanojia pushed a commit to rohanKanojia/jkube that referenced this issue Jul 27, 2023
Signed-off-by: Christian Mäder <christian.maeder@nxt.engineering>
manusa pushed a commit to rohanKanojia/jkube that referenced this issue Jul 31, 2023
Signed-off-by: Christian Mäder <christian.maeder@nxt.engineering>
manusa pushed a commit to rohanKanojia/jkube that referenced this issue Jul 31, 2023
Signed-off-by: Christian Mäder <christian.maeder@nxt.engineering>
rohanKanojia pushed a commit to rohanKanojia/jkube that referenced this issue Aug 3, 2023
Signed-off-by: Christian Mäder <christian.maeder@nxt.engineering>
rohanKanojia pushed a commit to rohanKanojia/jkube that referenced this issue Aug 7, 2023
Signed-off-by: Christian Mäder <christian.maeder@nxt.engineering>
@manusa manusa added this to the 1.14.0 milestone Aug 11, 2023
rohanKanojia pushed a commit to rohanKanojia/jkube that referenced this issue Aug 22, 2023
Signed-off-by: Christian Mäder <christian.maeder@nxt.engineering>
manusa pushed a commit that referenced this issue Aug 22, 2023
Signed-off-by: Christian Mäder <christian.maeder@nxt.engineering>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants