holos-run / holos

Holos - The Holistic platform manager
https://holos.run
Apache License 2.0
23 stars 0 forks source link

Environments #262

Closed jeffmccune closed 1 month ago

jeffmccune commented 1 month ago

Spike out a prototype design for environment support.

We already unify multiple instances here, so maybe we just need to plumb this into the PlatformSpecComponent by adding a Paths []string field and deprecating Path.

jeffmccune commented 1 month ago

This should almost certainly just be a tag. Unifying multiple instances fails here

❯ holos render component ./environments/development/ ./projects/platform/components/namespaces
could not run: /Users/jeff/Holos/bank-of-holos/projects/platform/components/namespaces/namespaces.cue:4:8: reference "#Environment" not found (and 1 more errors) at internal/builder/builder.go:181
let[].Name: reference "#Environment" not found:
    /Users/jeff/Holos/bank-of-holos/projects/platform/components/namespaces/namespaces.cue:4:8

❯ cat environments/development/env.cue
package holos

#Environment: {
        Name: "development"
        Tag:  "dev"
}

[!NOTE] Explore adding arbitrary tags to PlatformSpecComponent

jeffmccune commented 1 month ago

Done in the v1alpha4 work. Environment is now a Component field passed from the platform to the build plan as a tag.

Only open question is if this should be a component field at all or just leave it to an user-defined tags. Seems fine to leave it as a field for now, though it will be hard to remove later...