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

Add Whippet to bottlerocket #3270

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions packages/os/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ source-groups = [
"driverdog",
"cfsignal",
"bloodhound",
"whippet",
]
package-features = [ "systemd-networkd" ]

Expand Down
20 changes: 20 additions & 0 deletions packages/os/os.spec
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Source119: reboot-if-required.service
Source120: warm-pool-wait.service
Source121: disable-udp-offload.service
Source122: has-boot-ever-succeeded.service
Source123: whippet.service

# 2xx sources: tmpfilesd configs
Source200: migration-tmpfiles.conf
Expand Down Expand Up @@ -131,6 +132,7 @@ Summary: Bottlerocket userdata configuration system
Summary: Bottlerocket network configuration helper
%if %{with systemd_networkd}
Requires: %{_cross_os}systemd-networkd
Requires: %{_cross_os}whippet
%else
Requires: %{_cross_os}wicked
%endif
Expand Down Expand Up @@ -287,6 +289,11 @@ Summary: Compliance check framework
%description -n %{_cross_os}bloodhound
%{summary}.

%package -n %{_cross_os}whippet
Summary: D-Bus listener and marshaller
%description -n %{_cross_os}whippet
%{summary}.

Comment on lines +292 to +296
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you should make the whole sub-package conditional rather than creating an empty rpm with no files

%prep
%setup -T -c
%cargo_prep
Expand Down Expand Up @@ -346,6 +353,7 @@ echo "** Output from non-static builds:"
-p certdog \
-p shimpei \
-p bloodhound \
%{?with_systemd_networkd: -p whippet} \
%{?with_ecs_runtime: -p ecs-settings-applier} \
%{?with_aws_platform: -p shibaken -p cfsignal} \
%{?with_aws_k8s_family: -p pluto} \
Expand All @@ -372,6 +380,7 @@ for p in \
signpost updog metricdog logdog \
ghostdog bootstrap-containers \
shimpei bloodhound bottlerocket-checks \
%{?with_systemd_networkd: whippet} \
%{?with_ecs_runtime: ecs-settings-applier} \
%{?with_aws_platform: shibaken cfsignal} \
%{?with_aws_k8s_family: pluto} \
Expand Down Expand Up @@ -471,6 +480,11 @@ install -p -m 0644 %{S:302} %{buildroot}%{_cross_udevrulesdir}/82-supplemental-s
install -p -m 0644 %{S:121} %{buildroot}%{_cross_unitdir}
%endif

# Whippet should only have a service file installed if using systemd-networkd
%if %{with systemd_networkd}
install -p -m 0644 %{S:123} %{buildroot}%{_cross_unitdir}
%endif

%cross_scan_attribution --clarify %{_builddir}/sources/clarify.toml \
cargo --offline --locked %{_builddir}/sources/Cargo.toml

Expand Down Expand Up @@ -631,4 +645,10 @@ install -p -m 0644 %{S:121} %{buildroot}%{_cross_unitdir}
%{_cross_bindir}/bottlerocket-checks
%{_cross_libexecdir}/cis-checks/bottlerocket

%files -n %{_cross_os}whippet
%if %{with systemd_networkd}
%{_cross_bindir}/whippet
%{_cross_unitdir}/whippet.service
%endif

%changelog
15 changes: 15 additions & 0 deletions packages/os/whippet.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=Bottlerocket D-Bus listener for network events
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: doesn't necessarily need to be Bottlerocket-specific

Suggested change
Description=Bottlerocket D-Bus listener for network events
Description=D-Bus listener for network events

After=generate-network-config.service
Requires=generate-network-config.service
Requires=dbus-org.freedesktop.network1.service

[Service]
Type=exec
ExecStart=/usr/bin/whippet
Restart=always
RestartSec=5
StandardError=journal+console

[Install]
WantedBy=network-pre.target
Loading
Loading