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

'invalid reference format' during push #40

Open
tpischke-bedag opened this issue Jul 1, 2021 · 1 comment
Open

'invalid reference format' during push #40

tpischke-bedag opened this issue Jul 1, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@tpischke-bedag
Copy link

@tpischke-bedag Could you test the current release version of the Maven extension and give me feedback if it works in your use case? IMHO there are some dependencies clean-ups to do. If it is better for the community, I can move the Maven extension to this project (@rhuss what do you think?). But we cannot merge it with the plugin because a Maven extension is a separate concept towards a Maven plugin.

During testing, I get the following error at the end of the build:
build 01-Jul-2021 13:25:08 [WARNING] Failed to notify spy com.github.sparsick.maven.docker.extension.DockerPushExtension: {"message":"invalid reference format"}

The push works normally when the extension is not active. The image name is composed using some maven properties, maybe they are not being resolved correctly?

registry.example.com/${docker.namespace}/backend:git-commit-id_${git.commit.id}

My suspicion is that the following code does not allow for interpolation of maven properties in the image name:

private void parseDockerImageName(Object configuration) {
LOGGER.debug("Configuration: {}", configuration);

    // this is necessary because cast throw an exception "incompatible type"
    Xpp3Dom dom = Xpp3DomBuilder.build(new StringReader(configuration.toString()));
    dockerImageNames.addAll(Arrays.stream(dom.getChild("images").getChildren("image")).map(image -> image.getChild("name").getValue()).collect(Collectors.toSet()));
    LOGGER.info("Found docker image names: {}", dockerImageNames);
}

I haven't been able to get the extension to log any debug information, even with the maven -X flag, is there some trick to turn on the logging?

@sparsick
Copy link
Owner

sparsick commented Mar 8, 2022

@tpischke-bedag Sorry for my delayed answer. I wrote a test to reproduce your issue. It shows that the Maven properties are solved correctly. You should see the docker image name as log info ("Found docker image names ...").

Regards to debugging: Do you try mvnDebug instead of using -X flag?

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
Development

No branches or pull requests

2 participants