-
Notifications
You must be signed in to change notification settings - Fork 0
/
timoni.cue
47 lines (40 loc) · 1.35 KB
/
timoni.cue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Code generated by timoni.
// Note that this file is required and should contain
// the values schema and the timoni workflow.
package main
import (
templates "timoni.sh/flipt/templates"
)
// Define the schema for the user-supplied values.
// At runtime, Timoni injects the supplied values
// and validates them according to the Config schema.
values: templates.#Config
// Define how Timoni should build, validate and
// apply the Kubernetes resources.
timoni: {
apiVersion: "v1alpha1"
// Define the instance that outputs the Kubernetes resources.
// At runtime, Timoni builds the instance and validates
// the resulting resources according to their Kubernetes schema.
instance: templates.#Instance & {
// The user-supplied values are merged with the
// default values at runtime by Timoni.
config: values
// These values are injected at runtime by Timoni.
config: {
metadata: {
name: string @tag(name)
namespace: string @tag(namespace)
}
moduleVersion: string @tag(mv, var=moduleVersion)
kubeVersion: string @tag(kv, var=kubeVersion)
}
}
// Pass Kubernetes resources outputted by the instance
// to Timoni's multi-step apply.
apply: app: [for obj in instance.objects {obj}]
// Conditionally run tests after an install or upgrade.
if instance.config.test.enabled {
apply: test: [for obj in instance.tests {obj}]
}
}