Skip to content

[Bug]: ImageNameSubstitutor cannot set compatibility #9575

Open

Description

@Fleshgrinder

A custom ImageNameSubstitutor cannot be used to mark an image as compatible substitute for another image automatically, because all implementation I found call the compatibility assertion on their constructor argument, not on the image property from the parent class that actually applies the substitution.

I want to dynamically resolve images from a Dockerfile in the root of my project to allow Dependabot/Renovate to automatically update the images for me, and thus keep my tests up-to-date. For this I wanted to use short aliases and to set compatibility dynamically. However, this isn't possible for the reasons explained.

I'm filing this as a bug, because I believe that this isn't the intended behavior. Feel free to change this.

Activity

  1. changed the title [-][Bug]:[/-] [+][Bug]: `ImageNameSubstitutor` cannot be used to set compatibility[/+] on Nov 30, 2024
  2. changed the title [-][Bug]: `ImageNameSubstitutor` cannot be used to set compatibility[/-] [+][Bug]: `ImageNameSubstitutor` cannot set compatibility[/+] on Nov 30, 2024
  3. sci-jvm-study commented on Jul 14, 2026

    @sci-jvm-study

    I investigated this and reproduced the behavior. Compatibility checks happen in container constructors before ImageNameSubstitutor is applied. Since the current examples require users to explicitly call asCompatibleSubstituteFor(...), I am unsure whether this is intended behavior or whether ImageNameSubstitutor is expected to preserve compatibility metadata. Could a maintainer clarify the intended design before I work on a fix?

  4. sci-jvm-study commented on Nov 18, 2026

    @sci-jvm-study

    Just following up on this. I am still interested in investigating the issue. Would the maintainers be open to a change that preserves compatibility metadata through the substitution process, or is the current behavior intentional ?

    I would appreciate some guidance before proceeding with an implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions