Giter VIP home page Giter VIP logo

Comments (4)

rohanKanojia avatar rohanKanojia commented on July 23, 2024

@ecausarano : Is it possible to share a reproducer project? I tried reproducing this but could not reproduce the issue. Here are the steps I followed:

  1. Clone https://github.com/rohankanojia/podsetoperatorinjava
  2. Change jkube.generator.name property in pom.xml to quay.io/${image.user}/${project.artifactId}:%t
  3. Run mvn k8s:build

I was able to see image being tagged with timestamp:

[INFO] k8s: [quay.io/rohankanojia/podset-operator-in-java:snapshot-240613-102153-0649] "java-exec": Created docker-build.tar in 65 milliseconds
[INFO] k8s: [quay.io/rohankanojia/podset-operator-in-java:snapshot-240613-102153-0649] "java-exec": Built image sha256:4d492
[INFO] k8s: [quay.io/rohankanojia/podset-operator-in-java:snapshot-240613-102153-0649] "java-exec": Tag with latest

from jkube.

rohanKanojia avatar rohanKanojia commented on July 23, 2024

okay, I think I now understand the problem now. Image is correctly tagged with timestamp, however JKube is adding an additional <tag> in Build configuration. This results in an extra image getting created:

REPOSITORY                                     TAG                           IMAGE ID       CREATED              SIZE
quay.io/rohankanojia/podset-operator-in-java   latest                        dd581f0fe6ef   About a minute ago   507MB
quay.io/rohankanojia/podset-operator-in-java   snapshot-240613-102851-0116   dd581f0fe6ef   About a minute ago   507MB

This latest tag is being added for projects that have versions containing SNAPSHOT

protected void addLatestTagIfSnapshot(BuildConfiguration.BuildConfigurationBuilder buildBuilder) {
if (getProject().getVersion().endsWith("-SNAPSHOT")) {
buildBuilder.tags(Collections.singletonList("latest"));
}

Adding a check here to not add latest tag when image name contains %t fixes the issue

-        if (getProject().getVersion().endsWith("-SNAPSHOT")) {
+        if (getProject().getVersion().endsWith("-SNAPSHOT") && !getImageName().contains("%t")) {

from jkube.

ecausarano avatar ecausarano commented on July 23, 2024

That would fix it, but the tag name is already processed in another part of the codebase. (ImageNameFormatter.java

I'm no Docker guru, is there a reason for explicitly adding the latest tag? Wouldn't the Registry automatically add it?

from jkube.

rohanKanojia avatar rohanKanojia commented on July 23, 2024

I'm checking history of this change and it seems to have been introduced in fabric8io/fabric8-maven-plugin#186 . It doesn't provide much insight on why this was added.

from jkube.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.