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

"skaffold init" generates incorrect config for Jib project #2844

Closed
chanseokoh opened this issue Sep 9, 2019 · 4 comments · Fixed by GoogleContainerTools/jib#1974
Closed
Assignees
Labels
area/init build/jib kind/bug Something isn't working priority/p1 High impact feature/bug.

Comments

@chanseokoh
Copy link
Member

chanseokoh commented Sep 9, 2019

In #2843, the config for a Jib project has module: demo

    jibMaven:
      module: demo

However, the project was a simple Spring Boot demo generated from the Initializr and not a multi-module project. I had to remove module: to make it work correctly. Seems like a bug.

@GoogleContainerTools/java-tools-build

@chanseokoh chanseokoh changed the title "skaffold init "skaffold init" generates incorrect config for Jib project Sep 9, 2019
@balopat balopat added kind/bug Something isn't working priority/p1 High impact feature/bug. area/init labels Sep 9, 2019
@loosebazooka
Copy link
Member

@TadCordle

@TadCordle
Copy link
Contributor

TadCordle commented Sep 9, 2019

Ah, I think I see the issue. In SkaffoldInitMojo.java in Jib, we do this check:

if (getProject().getParent() != null) {
  skaffoldInitOutput.setProject(getProject().getName());
}

i.e. if the goal is running on the root project, don't provide the module name to skaffold. The problem is that a spring initializr project is not actually the root project. In the demo project's pom.xml:

<parent>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-parent</artifactId>
	<version>2.1.8.RELEASE</version>
	<relativePath/> <!-- lookup parent from repository -->
</parent>

So, it seems we need to find a different way of determining whether or not a module is the root project on the Jib side of things.

@TadCordle
Copy link
Contributor

TadCordle commented Sep 9, 2019

Alternatively, I think we could fix this skaffold-side by just checking the number of modules that were output by Jib, and ignore the project if it's only one.

@TadCordle
Copy link
Contributor

TadCordle commented Sep 10, 2019

This will be fixed in the next release of Jib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/init build/jib kind/bug Something isn't working priority/p1 High impact feature/bug.
Projects
None yet
4 participants