Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Container name should not be generated from maven group Id #1312

Closed
ChrisShain opened this issue Jun 28, 2018 · 0 comments
Closed

Container name should not be generated from maven group Id #1312

ChrisShain opened this issue Jun 28, 2018 · 0 comments
Assignees
Labels
cat/bug Bug which needs fixing

Comments

@ChrisShain
Copy link

Description

When generating Kubernetes configurations, if username is omitted then maven group Id is inserted instead. Maven group id's often have periods, which are illegal characters in Kubernetes container names. Therefore, defaulting to an unmodified group ID seems like the wrong thing to do. Either remove the periods, or default to something else.

The erroneous function is extractContainerName in KubernetesResourceUtil. Decompiled, roughly:

    private static String extractImageUser(String image, MavenProject project) {
        ImageName name = new ImageName(image);
        String imageUser = name.getUser();
        return imageUser != null ? imageUser : project.getGroupId();
    }

Info

  • f-m-p version : 3.5.40
  • Maven version (mvn -v) : Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T11:41:47-05:00)

  • Kubernetes / OpenShift setup and version : minikube version: v0.27.0
  • If it's a bug, how to reproduce : create a maven project with a period in the group Id, and configure the plugin as follows:
                <configuration>
                    <registry>registry.gitlab.com/deltavstudios/flightcontrol</registry>
                    <images>
                        <image>
                            <!-- I am using a private registry here -->
                            <name>192.168.99.100:32449/%a:%l</name>
                            <build>
                               <!-- whatever -->
                            </build>
                        </image>
                    </images>
                </configuration>
rohanKanojia added a commit to rohanKanojia/fabric8-maven-plugin that referenced this issue Jul 14, 2018
@rohanKanojia rohanKanojia added the cat/bug Bug which needs fixing label Jul 16, 2018
rohanKanojia added a commit to rohanKanojia/fabric8-maven-plugin that referenced this issue Jul 16, 2018
@rohanKanojia rohanKanojia self-assigned this Jul 16, 2018
rohanKanojia added a commit to rohanKanojia/fabric8-maven-plugin that referenced this issue Jul 19, 2018
rohanKanojia added a commit to rohanKanojia/fabric8-maven-plugin that referenced this issue Jul 24, 2018
@rhuss rhuss closed this as completed in e2f694e Jul 30, 2018
rhuss added a commit that referenced this issue Jul 30, 2018
Fix #1312 : Container name should not be generated from maven group Id
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cat/bug Bug which needs fixing
Projects
None yet
Development

No branches or pull requests

2 participants