Skip to content

Commit

Permalink
Merge pull request #134 from projectsyn/feat/multi-tenant
Browse files Browse the repository at this point in the history
Update component template to generate multi-tenant aware components by default
  • Loading branch information
simu authored Jan 7, 2025
2 parents 42e3f6c + 976e9e3 commit f12cbb4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion {{ cookiecutter.slug }}/class/defaults.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
parameters:
{{ cookiecutter.parameter_key }}:
=_metadata: {}
=_metadata:
multi_tenant: true
namespace: syn-{{ cookiecutter.slug }}
2 changes: 1 addition & 1 deletion {{ cookiecutter.slug }}/class/{{ cookiecutter.slug }}.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ parameters:
- input_paths:
- ${_base_directory}/component/app.jsonnet
input_type: jsonnet
output_path: apps/
output_path: .
- input_paths:
- ${_base_directory}/component/main.jsonnet
input_type: jsonnet
Expand Down
10 changes: 5 additions & 5 deletions {{ cookiecutter.slug }}/component/app.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ local argocd = import 'lib/argocd.libjsonnet';

local app = argocd.App('{{ cookiecutter.slug }}', params.namespace);

local appPath =
local project = std.get(app, 'spec', { project: 'syn' }).project;
if project == 'syn' then 'apps' else 'apps-%s' % project;

{
{% if '-' in cookiecutter.slug -%}
'{{ cookiecutter.slug }}'
{%- else -%}
{{ cookiecutter.slug }}
{%- endif -%}: app,
['%s/{{ cookiecutter.slug }}' % appPath]: app,
}

0 comments on commit f12cbb4

Please sign in to comment.