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

imageName option is confusing #1381

Open
t0yv0 opened this issue Sep 16, 2024 · 2 comments
Open

imageName option is confusing #1381

t0yv0 opened this issue Sep 16, 2024 · 2 comments
Labels
kind/bug Some behavior is incorrect or out of spec

Comments

@t0yv0
Copy link
Member

t0yv0 commented Sep 16, 2024

What happened?


Mitch Gerdisch
  Thursday at 5:58 PM

Given the following (awsx) code, I would expect the image tag in the ecr to be latest. Instead it is set to the imageName value (i.e. “mitch-image”).

Am I mistaken about how this should work? Or is this a bug?

const image = new awsx.ecr.Image("my-image", {
    imageName: "mitch-image",
    repositoryUrl: repository.url,
    context: "./app", // Path to your Dockerfile and application directory
    imageTag: "latest",
});

Checking up on this, #1171 introduced the imageName option but it's behaviorally identical to imageTag option at the moment, we probably only want one of those, not two. We should consider retracting 1171.

Example

See above.

Output of pulumi about

N/A

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@t0yv0 t0yv0 added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Sep 16, 2024
@flostadler
Copy link
Contributor

Ideally we should remove imageName and keep only imageTag.

Image name usually refers to the part before the tag (see docker docs), but here the imageName is used like a tag.

For ECR, the image name is set when creating the repository. So if users want different image names, they need to create different repos. If they just want different tags, then they can set the imageTag property on awsx.ecr.Image

@flostadler
Copy link
Contributor

flostadler commented Sep 16, 2024

If we're touching this, we should also try to fix the resource name of the Image. I just saw that's it's using the TAG as the resource name:

const imageName = args.imageName
? args.imageName
: imageTag
? imageTag
: createUniqueImageName(dockerInputs);

const image = new docker.Image(imageName, dockerImageArgs, { parent });

But you can have the same tag (e.g. latest) across many different images, which would lead to duplicate URN errors right now if they're in the same stack.

@corymhall corymhall removed the needs-triage Needs attention from the triage team label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

3 participants