Skip to content

Commit

Permalink
Remove unneeded cloud-init support
Browse files Browse the repository at this point in the history
  • Loading branch information
robertvolkmann committed Jan 17, 2025
1 parent 980f807 commit 6ae7ef9
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 63 deletions.
1 change: 0 additions & 1 deletion almalinux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ RUN set -ex \
audit \
ca-certificates \
chrony \
cloud-init \
dbus \
efibootmgr \
gettext \
Expand Down
12 changes: 0 additions & 12 deletions cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,18 +485,6 @@ func (i *installer) processUserdata() error {
}
}()

if isCloudInitFile(content) {
_, err := i.exec.command(&cmdParams{
name: "cloud-init",
args: []string{"devel", "schema", "--config-file", userdata},
})
if err != nil {
i.log.Error("error when running cloud-init userdata, continuing anyway", "error", err)
}

return nil
}

err = i.fs.Rename(userdata, "/etc/metal/config.ign")
if err != nil {
return err
Expand Down
19 changes: 0 additions & 19 deletions cmd/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -809,25 +809,6 @@ func Test_installer_processUserdata(t *testing.T) {
{
name: "no userdata given",
},
{
name: "cloud-init",
oss: osDebian,
fsMocks: func(fs afero.Fs) {
require.NoError(t, afero.WriteFile(fs, "/etc/metal/userdata", []byte(sampleCloudInit), 0700))
},
execMocks: []fakeexecparams{
{
WantCmd: []string{"cloud-init", "devel", "schema", "--config-file", "/etc/metal/userdata"},
Output: "",
ExitCode: 0,
},
{
WantCmd: []string{"systemctl", "preset-all"},
Output: "",
ExitCode: 0,
},
},
},
{
name: "ignition",
oss: osDebian,
Expand Down
6 changes: 0 additions & 6 deletions debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ RUN set -ex \
apt-transport-https \
apt-utils \
ca-certificates \
cloud-init \
cpufrequtils \
curl \
dbus \
Expand Down Expand Up @@ -139,10 +138,6 @@ RUN chmod 600 /etc/ssh/sshd_config \
&& chmod -R 640 /var/log \
&& chown -R root:root /var/log

# Copy the dependencies of `cloud-init-custom.service` into the image.
COPY /cloud-init/cloud-init-custom.service /etc/systemd/system/
COPY /cloud-init/cloud-init-custom.sh /etc/metal/

# Enable all required systemd services
RUN systemctl set-default multi-user.target \
&& systemctl enable lldpd.service \
Expand All @@ -151,7 +146,6 @@ RUN systemctl set-default multi-user.target \
systemd-networkd \
systemd-timesyncd \
watchdog.service \
cloud-init-custom.service \
[email protected] \
&& systemctl disable console-getty.service \
&& systemctl mask console-getty.service \
Expand Down
14 changes: 0 additions & 14 deletions debian/cloud-init/cloud-init-custom.service

This file was deleted.

11 changes: 0 additions & 11 deletions debian/cloud-init/cloud-init-custom.sh

This file was deleted.

0 comments on commit 6ae7ef9

Please sign in to comment.