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

Option to disable adding new tags to existing images #2360

Closed
karl-dpg opened this issue Mar 25, 2020 · 10 comments · Fixed by #2531
Closed

Option to disable adding new tags to existing images #2360

karl-dpg opened this issue Mar 25, 2020 · 10 comments · Fixed by #2531
Milestone

Comments

@karl-dpg
Copy link

Is there a way how to disable adding new tags to existing images?

We have a monorepo with multiple microservices, and for every build, we create a new tag. We would like to tag only those services that generate new images. Other services that have no changes (hence, their images have the same digest) do not need to get new tags.

@loosebazooka
Copy link
Member

Could you help clarify what you mean by new tags? Presumably if your tag is not dynamically generated this shouldn't be happening?

@karl-dpg
Copy link
Author

karl-dpg commented Mar 25, 2020

Yes, the tags are dynamically generated and their value changes for every build.

This is a typical build we have: some microservices have changes and others no. A new tag is generated, and each service is built. As it is, Jib will:

  1. push images that are new with they newly created tag, and,
  2. add a tag to the existing images for the services that have no changes in them.

We would like to disable (2), ie, not add tags to existing images.

@loosebazooka
Copy link
Member

So a couple of things here.

  • Is this maven or gradle?
  • Can you know already at build time which services need to be updated? -- and just skip jib yourself? Presumably this is much harder in a CI.
  • You may already be aware: but tags on a registry are just pointers to digests. So a new tag doesn't really do anything except add noise to the entries. Could be annoying if something in your container orchestration is watching for new tags though.

I think there might be some scope for adding this feature as a flag/config option, but I'm not sure yet.

@karl-dpg
Copy link
Author

  • Gradle
  • Not at this time.
  • This is exactly the issue. We have some orchestrator watching the registry, and it is unnecessarily deploying the services that have no changes.

@loosebazooka
Copy link
Member

Thanks @karlmuscat-dpg this is useful information. If you're interested in submitting a design/proposal for this that we can work on together that could speed up the process -- https://github.com/GoogleContainerTools/jib/tree/master/proposals

I would start off with something less formal, like a range of ideas and we can narrow down what might work in the comments.

If that is not an option for you, someone on the jib dev team can take a look at some point in the (hopefully near) future.

@karl-dpg
Copy link
Author

Sure. I'll give it a shot.

@karl-dpg
Copy link
Author

karl-dpg commented Apr 3, 2020

@loosebazooka PR 2382 👍

@karlmuscat
Copy link
Contributor

@loosebazooka @chanseokoh Pushed PR #2531 to resolve this issue

@chanseokoh
Copy link
Member

chanseokoh commented Aug 7, 2020

@karlmuscat @karlmuscat-dpg Jib Gradle 2.5.0 and Jib Maven 2.5.2 are released with the feature. Thanks for your contribution! Try it out, and let us know if it works.

@karlmuscat
Copy link
Contributor

hey @chanseokoh! upgraded to 2.5.0, set the env var, and works like a charm 👍 thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants