Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

#1732 - Resolving template placeholders only in kubernetes.yaml but not individual template files (which will be resolved by helm mojo) #1733

Merged
merged 5 commits into from
Oct 14, 2019

Conversation

djotanov
Copy link
Contributor

@djotanov djotanov commented Oct 14, 2019

Fix #1732

@@ -656,13 +656,6 @@ private void resolveTemplateVariablesIfAny(KubernetesList resources) throws Mojo
}
File kubernetesYaml = new File(this.targetDir, "kubernetes.yml");
resolveTemplateVariables(parameters, kubernetesYaml);
File kubernetesResourceDir = new File(this.targetDir, "kubernetes");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please elaborate on how this fixes #1732

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, so we were resolving placeholders in template files also.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those lines were replacing template placeholders in kubernetes resource files with concrete values specified in template.yaml file. The placeholders need to be resolved only in kubernetes.yml in order to be able to do fabric8:deploy or fabric8:apply, but they don't need to be resolved in individual kubernetes resource files as they will be needed in HelmMojo execution.
The HelmMojo is using those same kubernetes resources to create chart, but since the placeholders were already replaced with concrete values from template.yaml, it can not replace them with corresponding .Values.xxx placeholders.

Copy link
Contributor Author

@djotanov djotanov Oct 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Easiest is to build spring-boot-with-yaml sample on this branch with fabric8:helm goal and inspect generated helm chart

@rohanKanojia rohanKanojia merged commit a476814 into fabric8io:master Oct 14, 2019
@rohanKanojia rohanKanojia added the jkube/pending The issue/PR has to be taken care of in JKube https:/eclipse/jkube label Oct 24, 2019
rohanKanojia added a commit to rohanKanojia/jkube that referenced this pull request Nov 7, 2019
…ividual

  template files (which will be resolved by helm mojo)
+ HELM mode does not support parameters without value

Ported PR fabric8io/fabric8-maven-plugin#1713
Ported PR fabric8io/fabric8-maven-plugin#1733
@rohanKanojia rohanKanojia removed the jkube/pending The issue/PR has to be taken care of in JKube https:/eclipse/jkube label Nov 7, 2019
rohanKanojia added a commit to eclipse-jkube/jkube that referenced this pull request Nov 29, 2019
…ividual

  template files (which will be resolved by helm mojo)
+ HELM mode does not support parameters without value

Ported PR fabric8io/fabric8-maven-plugin#1713
Ported PR fabric8io/fabric8-maven-plugin#1733
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Helm Mojo not replacing template placeholders with corresponding .Values.xxx placeholders
3 participants