fix: pass DO Marketplace img_check validation (#2276)

Three fixes for marketplace validation failures:

1. Install all security updates (apt-get dist-upgrade) — img_check
   fails if any security patches are pending.
2. Purge droplet-agent and /opt/digitalocean — img_check fails if
   the DO monitoring agent directory exists.
3. Correct img_check.sh filename to 99-img-check.sh — the previous
   URL returned 404.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ahmed Abushagur 2026-03-06 23:43:46 -08:00 committed by GitHub
parent 4719b49754
commit 7643b96266
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -106,6 +106,19 @@ build {
]
}
# DO Marketplace: install all security updates and remove DO droplet agent
provisioner "shell" {
inline = [
"apt-get update -y",
"apt-get dist-upgrade -y",
"apt-get purge -y droplet-agent || true",
"rm -rf /opt/digitalocean",
]
environment_vars = [
"DEBIAN_FRONTEND=noninteractive",
]
}
# DO Marketplace cleanup runs last before snapshot.
# Based on https://github.com/digitalocean/marketplace-partners/blob/master/scripts/cleanup.sh
# Clears secrets, history, logs, and machine-id so each launched droplet