-
Notifications
You must be signed in to change notification settings - Fork 244
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
odo deploy - devfile variable substitution does not occur in uri referenced deployment manifest yaml file #5451
Labels
kind/bug
Categorizes issue or PR as related to a bug.
priority/High
Important issue; should be worked on before any other issues (except priority/Critical issue(s)).
Comments
kadel
added
priority/High
Important issue; should be worked on before any other issues (except priority/Critical issue(s)).
v2
Issue or PR that applies to the v2 of odo
v3
labels
Feb 11, 2022
3 tasks
This was referenced Apr 29, 2022
openshift-merge-robot
pushed a commit
that referenced
this issue
May 5, 2022
#5451) (#5711) * Add integration test highlighting the issue The devfile used is the same as devfile-deploy.yaml, except that the the Kubernetes component is referenced via the URI. This is why the same integration test logic is being reused here. * Add higher-level function in 'libdevfile' allowing to load component resource manifest and substitute variables This works with both Inlined or Uri resources. Notes: - Ideally, it would make more sense to rely on the same logic used in Devfile to substitute variables (defined in the 'variables' package), but this function is not exported; and the exported ones substitute variables only in the URI name, not in the content itself (it is not fetched), which is actually the issue we are trying to solve here. * Switch to using 'uri' Kubernetes components in test Devfiles This seems to be a much more realistic case when referencing external Kubernetes manifests. Notes: Some tests, like for `odo deploy`, still test 'Inlined' manifests. * Pass the component name to 'GetComponentResourceManifestContentWithVariablesResolved' As suggested in review, this makes more sense now that we are passing the entire devfile object * Rename 'GetComponentResourceManifestContentWithVariablesResolved' with 'GetK8sManifestWithVariablesSubstituted' Previous name was a bit long ^^ * Remove extra parentheses in error string returned by 'ComponentsWithSameNameError#Error', as suggested in review * Revert "Switch to using 'uri' Kubernetes components in test Devfiles" This reverts commit df1f19e. This will be done in a separate PR, with ideally changes that should allow to use the same set of tests for testing both Inlined and URI-referenced manifests.
Repository owner
moved this from For Review
to Done
in odo v3-beta1
May 5, 2022
cdrage
pushed a commit
to cdrage/odo
that referenced
this issue
Aug 31, 2022
redhat-developer#5451) (redhat-developer#5711) * Add integration test highlighting the issue The devfile used is the same as devfile-deploy.yaml, except that the the Kubernetes component is referenced via the URI. This is why the same integration test logic is being reused here. * Add higher-level function in 'libdevfile' allowing to load component resource manifest and substitute variables This works with both Inlined or Uri resources. Notes: - Ideally, it would make more sense to rely on the same logic used in Devfile to substitute variables (defined in the 'variables' package), but this function is not exported; and the exported ones substitute variables only in the URI name, not in the content itself (it is not fetched), which is actually the issue we are trying to solve here. * Switch to using 'uri' Kubernetes components in test Devfiles This seems to be a much more realistic case when referencing external Kubernetes manifests. Notes: Some tests, like for `odo deploy`, still test 'Inlined' manifests. * Pass the component name to 'GetComponentResourceManifestContentWithVariablesResolved' As suggested in review, this makes more sense now that we are passing the entire devfile object * Rename 'GetComponentResourceManifestContentWithVariablesResolved' with 'GetK8sManifestWithVariablesSubstituted' Previous name was a bit long ^^ * Remove extra parentheses in error string returned by 'ComponentsWithSameNameError#Error', as suggested in review * Revert "Switch to using 'uri' Kubernetes components in test Devfiles" This reverts commit df1f19e. This will be done in a separate PR, with ideally changes that should allow to use the same set of tests for testing both Inlined and URI-referenced manifests.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
kind/bug
Categorizes issue or PR as related to a bug.
priority/High
Important issue; should be worked on before any other issues (except priority/Critical issue(s)).
/kind bug
What versions of software are you using?
Operating System:
Output of
odo version
:How did you run odo exactly?
$ odo deploy
with the following devfile variables defined:
and the following component (and related commands) defined:
app-deploy.yaml contains substitution placeholders for the vars defined in the devfile:
Actual behavior
the app-deploy.yaml is used as is to do the deploy - no substitution occurs and the deploy fails because the names cannot be parsed:
Expected behavior
variable substitution occurs first and the deploy occurs next, successfully
Note: if i inline the contents of app-deploy.yaml in the devfile the substitutions occur as expected. This should happen as well for a uri specified deployment manifest yaml.
Any logs, error output, etc?
The text was updated successfully, but these errors were encountered: