Discover modules > github.com/xchangeee/syslet/schema > core
v0.2.0
#Sysdef: ¶

Sysdef collects containers, networks, volumes, builds, secrets by name and provides an 'enabled' flag to quickly remove items without deleting them from code

containers!: ¶

Containers by name, the key is set as the spec name

[Name=string]: #SysdefContainerUnit & {spec: name: Name} ¶
spec: ¶
name: Name ¶
networks!: ¶

Networks by name, the key is set as the spec name

[Name=string]: #SysdefNetworkUnit & {spec: name: Name} ¶
spec: ¶
name: Name ¶
volumes!: ¶

Volumes by name, the key is set as the spec name

[Name=string]: #SysdefVolumeUnit & {spec: name: Name} ¶
spec: ¶
name: Name ¶
builds!: ¶

Image builds by name, the key is set as the spec name

[Name=string]: #SysdefBuildUnit & {spec: name: Name} ¶
spec: ¶
name: Name ¶
secrets!: ¶

Secrets by name, the key is set as the spec name

[Name=string]: #SysdefSecret & {spec: name: Name} ¶
spec: ¶
name: Name ¶
#SysdefUnit: ¶

Fields shared by every Sysdef entry

enabled!: bool ¶

Disabled entries are left out of the output

#SysdefContainerUnit: ¶

Sysdef entry wrapping a container spec

spec!: #ContainerSpec ¶

Container spec

#SysdefNetworkUnit: ¶

Sysdef entry wrapping a network spec

spec!: #NetworkSpec ¶

Network spec

#SysdefVolumeUnit: ¶

Sysdef entry wrapping a volume spec

spec!: #VolumeSpec ¶

Volume spec

#SysdefBuildUnit: ¶

Sysdef entry wrapping a build spec

spec!: #BuildSpec ¶

Build spec

#SysdefSecret: ¶

Sysdef entry wrapping a secret spec

spec!: #SecretSpec ¶

Secret spec

#SysdefDefaults: ¶

Reasonable default values to sysdef

containers: ¶
[string]: ¶
enabled: bool | *true ¶
spec: ¶
removalAllowed: bool | *true ¶
desiredState: string | *#ContainerDesiredStateRunning ¶
networks: ¶
[string]: ¶
enabled: bool | *true ¶
spec: ¶
removalAllowed: bool | *true ¶
reclaimPolicy: string | *#ReclaimPolicyDelete ¶
volumes: ¶
[string]: ¶
enabled: bool | *true ¶
spec: ¶
removalAllowed: bool | *true ¶
reclaimPolicy: string | *#ReclaimPolicyDelete ¶
builds: ¶
[string]: ¶
enabled: bool | *true ¶
spec: ¶
reclaimPolicy: string | *#ReclaimPolicyDelete ¶
secrets: ¶
[string]: ¶
enabled: bool | *true ¶
#SpecTypeContainer: "container" ¶

Values of the 'type' field, selecting which spec a document describes

#SpecTypeNetwork: "network" ¶
#SpecTypeVolume: "volume" ¶
#SpecTypeBuild: "build" ¶
#SpecTypeSecret: "secret" ¶
#ReclaimPolicyRetain: "Retain" ¶

Retain keeps the podman resource when its unit is removed

#ReclaimPolicyDelete: "Delete" ¶

Delete removes the podman resource when its unit is removed

#ReclaimPolicy: #ReclaimPolicyRetain | #ReclaimPolicyDelete ¶

All valid reclaim policy values

#APIVersionV1: "v1" ¶

Spec apiVersion this schema describes, syslet routes each spec to its decoder by it

#Spec: ¶

Fields shared by every spec type

apiVersion: #APIVersionV1 ¶

Spec apiVersion, fixed by the schema so exported specs always carry it

type!: string ¶

Spec type

name!: string ¶

Spec name, will be also set as the unit name and podman name

#Env: ¶

Map form of a unit option value (e.g. Environment), rendered as one entry per key

[string]: string ¶
#UnitOptionSectionName: string ¶

Section name of a unit option

#UnitOptionSectionKey: string ¶

Section key of a unit option

#UnitOptionValue: string | [...string] | #Env ¶

Value of a unit option

[...]: string
#UnitSpec: ¶

Fields shared by specs that render to a quadlet unit (all except secret)

unit!: ¶

Quadlet unit options, keyed by section name and then option name; use {} for none

[#UnitOptionSectionName]: ¶
[#UnitOptionSectionKey]: #UnitOptionValue ¶
#RemovableSpec: ¶

Fields shared by specs whose unit syslet only prunes when allowed (container, volume, network). Builds are pruned unconditionally, so #BuildSpec doesn't include it.

removalAllowed!: bool ¶

If this is true, and the unit is no longer in the input, syslet will remove the unit

#ContainerDesiredStateRunning: "running" ¶

Container should be running after reconciliation

#ContainerDesiredStateStopped: "stopped" ¶

Container should be stopped after reconciliation

#ContainerDesiredStateOneshot: "oneshot" ¶

Container runs as a oneshot service (Type=oneshot). syslet never starts or stops it, other units trigger it through their [Unit] dependencies.

#ContainerDesiredState: #ContainerDesiredStateRunning | #ContainerDesiredStateStopped | #ContainerDesiredStateOneshot ¶

All valid container desired states

#ContainerSpec: ¶

Container rendered to a .container quadlet unit

type: #SpecTypeContainer ¶

Spec type

desiredState!: #ContainerDesiredState ¶

Desired state controls if container will be started or stopped

configFiles?: [...#ContainerConfigFile] ¶

Bind-mounted config files

[...]: #ContainerConfigFile
configDirs?: [...#ContainerConfigDir] ¶

Bind-mounted config directories

[...]: #ContainerConfigDir
#ContainerConfigFile: ¶

Single file bind-mounted into a container

mountPath!: string ¶

Mount path within the container

mode?: string ¶

File mode, e.g. 0600, defaults to 0644

content!: string ¶

File content

#ContainerConfigDir: ¶

Directory of files bind-mounted into a container

mountPath!: string ¶

Mount path within the container

files!: [...#ContainerConfigDirFile] ¶

Files inside the directory

[...]: #ContainerConfigDirFile
#ContainerConfigDirFile: ¶

File within a #ContainerConfigDir

name!: string ¶

Filename within the directory

mode?: string ¶

File mode, e.g. 0600, defaults to 0644

content!: string ¶

File content

#NetworkSpec: ¶

Network rendered to a .network quadlet unit

type: #SpecTypeNetwork ¶

Spec type

reclaimPolicy!: #ReclaimPolicy ¶

Reclaim policy controls if the podman network will be removed when the unit is removed

#VolumeSpec: ¶

Volume rendered to a .volume quadlet unit

type: #SpecTypeVolume ¶

Spec type

reclaimPolicy!: #ReclaimPolicy ¶

Reclaim policy controls if the volume will be removed when the unit is removed

#BuildSpec: ¶

Image build rendered to a .build quadlet unit

type: #SpecTypeBuild ¶

Spec type

reclaimPolicy!: #ReclaimPolicy ¶

Reclaim policy controls if the built image will be removed when the unit is removed

containerfile!: string ¶

Containerfile content

contextFiles?: [...#BuildContextFile] ¶

Files that will be added to the build context

[...]: #BuildContextFile
#BuildContextFile: ¶

File added to the build context

filename!: string ¶

Filename within the build context

mode?: string ¶

File mode, e.g. 0600, defaults to 0644

content!: string ¶

File content

#SecretSpec: ¶

SOPS-encrypted key/value file, each key becomes a podman secret named <name>-<key>

type: #SpecTypeSecret ¶

Spec type

ciphertext: string ¶

SOPS-encrypted YAML file content, a flat mapping of key to encrypted value

Source files

  • sysdef.cue
  • syslet.cue