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

Overriding parameters in a parameter set still requires the overriden parameter to be resolvable #3308

Open
kichristensen opened this issue Jan 5, 2025 · 0 comments · May be fixed by #3309
Assignees
Labels
bug Oops, sorry!

Comments

@kichristensen
Copy link
Contributor

kichristensen commented Jan 5, 2025

Describe the bug

When overriden a parameter specified in a parameter set, the overriden parameter should not be resolved as specified in the parameter set.
This block scenarios, where you override a parameter read from an environment variable that haven't been defined, because it is overriden.

According to the documentation:

When a bundle is executed, parameter values are resolved in a hierarchy of (from highest to lowest precedence):

  • Overrides specified either with the --param flag or by setting parameters directly on an installation resource
  • Parameter sets specified with the --parameter-set flag or by setting the parameter set name directly on an installation resource
  • Parameter values remembered from the last time the bundle was run
  • Defaults defined for the parameter in the bundle definition

To Reproduce

Steps to reproduce the behavior:

  1. Create and apply a parameter set containing the value name with an environment source, e.g.:
{
    "schemaType": "ParameterSet",
    "schemaVersion": "1.0.1",
    "name": "hello-llama",
    "parameters": [
        {
            "name": "name",
            "source": {
                "env": "FOO"
            }
        }
    ]
}
  1. Run porter install --reference getporter/hello-llama:v0.1.1 -p hello-llama --param name=Bar
  2. See error describing that the parameter hello-llama.name could not be resolved

Expected behavior

The installation should succeed because the parameter is overriden, and should not be read from the parameter set.

Porter Command and Output

$ porter install --reference getporter/hello-llama:v0.1.1 -p hello-llama --param name=Bar
unable to process provided parameter sets: 1 error occurred:
        * unable to resolve parameter hello-llama.name from env FOO: environment variable env is not defined

Version

porter v1.2.1 (aa97c59)

@kichristensen kichristensen added the bug Oops, sorry! label Jan 5, 2025
@kichristensen kichristensen self-assigned this Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Oops, sorry!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant