Skip to content

Commit

Permalink
os: create host-containers config template
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Berning <[email protected]>
  • Loading branch information
sam-berning committed Feb 14, 2024
1 parent 86607d1 commit f66ea4a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
20 changes: 20 additions & 0 deletions packages/os/host-containers-toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[required-extensions]
host-containers = "v1"
+++
{{#if settings.host-containers}}
{{#each settings.host-containers}}
[host-containers."{{@key}}"]
{{#if this.source}}
source = "{{{this.source}}}"
{{/if}}
{{#if this.enabled}}
enabled = {{this.enabled}}
{{/if}}
{{#if this.superpowered}}
superpowered = {{this.superpowered}}
{{/if}}
{{#if this.user-data}}
user-data = "{{{this.user-data}}}"
{{/if}}
{{/each}}
{{/if}}
4 changes: 3 additions & 1 deletion packages/os/os.spec
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Source12: 00-resolved.conf
Source13: cis-checks-k8s-metadata-json
%endif
Source14: certdog-toml
Source19: host-containers-toml

# 1xx sources: systemd units
Source100: apiserver.service
Expand Down Expand Up @@ -473,7 +474,7 @@ install -d %{buildroot}%{_cross_datadir}/updog
install -p -m 0644 %{_cross_repo_root_json} %{buildroot}%{_cross_datadir}/updog

install -d %{buildroot}%{_cross_templatedir}
install -p -m 0644 %{S:5} %{S:6} %{S:7} %{S:8} %{S:14} %{buildroot}%{_cross_templatedir}
install -p -m 0644 %{S:5} %{S:6} %{S:7} %{S:8} %{S:14} %{S:19} %{buildroot}%{_cross_templatedir}

install -d %{buildroot}%{_cross_unitdir}
install -p -m 0644 \
Expand Down Expand Up @@ -591,6 +592,7 @@ install -p -m 0644 %{S:400} %{S:401} %{S:402} %{buildroot}%{_cross_licensedir}
%{_cross_tmpfilesdir}/host-containers.conf
%dir %{_cross_templatedir}
%{_cross_templatedir}/host-ctr-toml
%{_cross_templatedir}/host-containers-toml

%files -n %{_cross_os}storewolf
%{_cross_bindir}/storewolf
Expand Down
6 changes: 5 additions & 1 deletion sources/models/shared-defaults/defaults.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,17 @@ seed.setting-generator = "bork seed"
# HostContainers

[services.host-containers]
configuration-files = ["host-ctr-toml"]
configuration-files = ["host-ctr-toml", "host-containers-toml"]
restart-commands = ["/usr/bin/host-containers"]

[configuration-files.host-ctr-toml]
path = "/etc/host-containers/host-ctr.toml"
template-path = "/usr/share/templates/host-ctr-toml"

[configuration-files.host-containers-toml]
path = "/etc/host-containers/host-containers.toml"
template-path = "/usr/share/templates/host-containers-toml"

[metadata.settings.host-containers]
affected-services = ["host-containers"]

Expand Down

0 comments on commit f66ea4a

Please sign in to comment.