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

Template variable bundle.invocationImage is incorrect #1824

Closed
carolynvs opened this issue Nov 9, 2021 · 4 comments · Fixed by #2283
Closed

Template variable bundle.invocationImage is incorrect #1824

carolynvs opened this issue Nov 9, 2021 · 4 comments · Fixed by #2283
Assignees
Labels
2 - 🍕 Pizza should be eaten daily breaking change 💥 Breaking changes to Porter's CLI, config or behavior gap We missed a spot
Milestone

Comments

@carolynvs
Copy link
Member

Describe the bug

The bundle.invocationImage template value that is injected into the bundle at runtime is incorrect. It should reflect the final resolved invocation image, but it is the value built into the bundle at build time.

So if you publish it to a different location, it isn't the right value. Other problems:

  • it doesn't take into account relocation mapping files. For example, really for any published bundle the invocation image is an artifact inside the bundle repository. It's always getporter/mybundle:sha256:abc123, and never getporter/mybundle-installer:v0.1.1.
  • It should use a digest instead of a tag.

To Reproduce

  1. Create a bundle
  2. Echo {{ bundle.invocationImage}} from the porter.yaml during install
  3. Build the bundle and publish it to a local registry.
  4. Run the bundle from the published location.

Expected behavior

The same image that is being executed by porter should be printed. Instead it prints the value built into the bundle at buildtime.

Version

v0.38.7 and v1.0.0-alpha.5

@carolynvs carolynvs added the bug Oops, sorry! label Nov 9, 2021
@carolynvs carolynvs added this to the 1.0 milestone Nov 9, 2021
@carolynvs
Copy link
Member Author

I guess the question is do we want to deprecate this template variable (like it's documented), or do we want to actually provide the right value?

@carolynvs carolynvs added question Halp plz and removed bug Oops, sorry! labels Nov 10, 2021
@bherw
Copy link

bherw commented Nov 17, 2021

The impression I got from reading various sources (sorry if I'm misremembering; I can't find them now) was that the reason for this deprecation was twofold:

  • the invocationImage name should no longer be set in the porter.yaml, but rather should be automatically determined
  • the name "installer" is now preferred as it's clearer than "invocationImage"

If getting the installer image is useful for some reason and the invocationImage is deprecated as planned (I would currently like to reuse it; albeit for a workaround), then maybe a new template variable bundle.installerImage could be introduced, which uses the correct relocated image.

@carolynvs
Copy link
Member Author

Thanks that's a great suggestion.

Here's how I think we can do this in a way that works with the CNAB spec. The porter runtime (RuntimeManifest) will read in the bundle.json and get the invocationImage. Then look up the relocated invocation image from the relocation mapping file, and add that as a template variable bundle.installerImage.

Doing it this way would be compatible with the CNAB spec and not require changes to our cnab provider.

@carolynvs carolynvs added 2 - 🍕 Pizza should be eaten daily gap We missed a spot and removed question Halp plz labels Nov 18, 2021
@VinozzZ VinozzZ self-assigned this Jul 25, 2022
@carolynvs carolynvs added the breaking change 💥 Breaking changes to Porter's CLI, config or behavior label Aug 2, 2022
@github-actions
Copy link

github-actions bot commented Aug 8, 2022

Closed by #2283.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 - 🍕 Pizza should be eaten daily breaking change 💥 Breaking changes to Porter's CLI, config or behavior gap We missed a spot
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants