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

Extend allInstances with the component names of instantiated components #5

Merged
merged 1 commit into from
Jan 9, 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
11 changes: 8 additions & 3 deletions syn-teams.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,15 @@ local appKeys(name, raw=false) =

// Extract all instances from `inv.applications`.
// The design doc (SDD-0030) specifies that entries in `syn.<team>.instances`
// must be component instances, so we don't need to worry about the component
// name for instantiated components.
// must be component instances.
// However, Commodore doesn't require that instance-aware components generate
// an ArgoCD application per instance, and some existing components generate a
// single ArgoCD application for all their instances. For such components,
// individual instances can't be assigned to a team, but the whole component
// can be assigned. To accommodate this design choice, we keep both the
// instance and component name in allInstances for instantiated components.
local allInstances = std.set(
std.map(function(app) appKeys(app, true)[0], inv.applications)
std.flattenArrays(std.map(function(app) appKeys(app, true), inv.applications))
);


Expand Down
Loading