diff --git a/struct_module/contribs/configs/kubectl.yaml b/struct_module/contribs/configs/kubectl.yaml index 274f8c1..5000cda 100644 --- a/struct_module/contribs/configs/kubectl.yaml +++ b/struct_module/contribs/configs/kubectl.yaml @@ -17,7 +17,7 @@ files: default: "true" variables: - - name: namespace - description: The name of the namespace to create. - type: string - default: default + - namespace: + description: The name of the namespace to create. + type: string + default: default diff --git a/struct_module/contribs/github/workflows/execute-tf-workflow.yaml b/struct_module/contribs/github/workflows/execute-tf-workflow.yaml index 34147da..4892962 100644 --- a/struct_module/contribs/github/workflows/execute-tf-workflow.yaml +++ b/struct_module/contribs/github/workflows/execute-tf-workflow.yaml @@ -25,15 +25,15 @@ files: gh-token: {{@ github_token @}} variables: - - name: app_name - description: "The name of the app." - default: "environments-dev" - type: string - - name: app_path - description: "The working directory for the terraform workflow." - default: "environments/dev" - type: string - - name: github_token - description: "The GitHub token for authentication." - default: "${{ secrets.GITHUB_TOKEN }}" - type: string + - app_name: + description: "The name of the app." + default: "environments-dev" + type: string + - app_path: + description: "The working directory for the terraform workflow." + default: "environments/dev" + type: string + - github_token: + description: "The GitHub token for authentication." + default: "${{ secrets.GITHUB_TOKEN }}" + type: string diff --git a/struct_module/file_item.py b/struct_module/file_item.py index d321f05..a664908 100644 --- a/struct_module/file_item.py +++ b/struct_module/file_item.py @@ -100,11 +100,16 @@ def apply_template_variables(self, template_vars): missing_vars = self.template_renderer.prompt_for_missing_vars(self.content, vars) vars.update(missing_vars) + self.vars = vars + self.logger.debug(f"Final template variables: {self.vars}") + self.content = self.template_renderer.render_template(self.content, vars) def create(self, base_path, dry_run=False, backup_path=None, file_strategy='overwrite'): file_path = os.path.join(base_path, self.name) + file_path = self.template_renderer.render_template(file_path, self.vars) + if self.skip: self.logger.info(f"skip is set to true. skipping creation.") return