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

Fix multi-team-awareness check in ArgoApp() helper #226

Merged
merged 1 commit into from
Feb 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/argocd.libjsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,20 @@ local params = inv.parameters.argocd;
* \arg `namespace` (required) the namespace where to deploy the app
* \arg `project` the Argo CD project for this app. Default: 'syn'
* \arg `secrets` if the Kapitan plugin should be used to reveal secrets from Vault. Default: 'true'
* \arg `base` the unaliased name of the component. Required for multi-team and multi-instance aware components. Default: null
*
* \returns an Argo CD Application object
*
* See the documentation https://argoproj.github.io/argo-cd/operator-manual/declarative-setup/#applications
*/
local ArgoApp(component, namespace, project=null, secrets=true) =
local ArgoApp(component, namespace, project=null, secrets=true, base=null) =
local base_component = if base != null then base else component;
local team = syn_teams.teamForApplication(component);
local proj =
if project != null then (
std.trace('Parameter `project` for `ArgoApp` is deprecated and will be removed in a future version. Set to `%s`' % project, project)
) else if team != syn_teams.owner then (
if syn_teams.isMultiTenantAware(component) then
if syn_teams.isMultiTenantAware(base_component) then
team
else
error
Expand Down