feat(admin): clear deploy event suppression after successful deploy
- commit
- 68b8dd119f42d55d6a57fa7ae63065657b59eea1
- author
- brice · · 2026-03-04 06:42 UTC
- parent
- faec534
- signature
- unsigned
1 file · +16 -0
M internal/adapters/in/http/admin/handler.go +16 -0
| @@ -1104,6 +1104,22 @@ func (h *Handler) handleDeploy(w http.ResponseWriter, r *http.Request, path stri | |||
| 1104 | 1104 | return | |
| 1105 | 1105 | } | |
| 1106 | 1106 | ||
| 1107 | + | // Clear deploy event suppression now that the explicit deploy has completed. | |
| 1108 | + | // This re-enables event-based deploys for future direct docker pushes. | |
| 1109 | + | if route.Image != "" { | |
| 1110 | + | // Extract image name (without registry prefix and tag) for suppression key | |
| 1111 | + | imageName := route.Image | |
| 1112 | + | // The suppression key is just the image name as stored in the registry | |
| 1113 | + | // (e.g., "my-app" not "reg.example.com/my-app:latest") | |
| 1114 | + | if parts := strings.SplitN(imageName, "/", 2); len(parts) == 2 { | |
| 1115 | + | imageName = parts[1] | |
| 1116 | + | } | |
| 1117 | + | if idx := strings.LastIndex(imageName, ":"); idx != -1 { | |
| 1118 | + | imageName = imageName[:idx] | |
| 1119 | + | } | |
| 1120 | + | h.registrySvc.ClearDeployEventSuppression(imageName) | |
| 1121 | + | } | |
| 1122 | + | ||
| 1107 | 1123 | log.Info().Str("domain", deployDomain).Str("container_id", container.ID).Msg("container deployed via admin API") | |
| 1108 | 1124 | h.sendJSON(w, http.StatusOK, dto.DeployResponse{ | |
| 1109 | 1125 | Status: "deployed", | |
| @@ -1104,6 +1104,22 @@ func (h *Handler) handleDeploy(w http.ResponseWriter, r *http.Request, path stri | |||||
| 1104 | return | 1104 | return | ||
| 1105 | } | 1105 | } | ||
| 1106 | 1106 | ||||
| 1107 | + | // Clear deploy event suppression now that the explicit deploy has completed. | |||
| 1108 | + | // This re-enables event-based deploys for future direct docker pushes. | |||
| 1109 | + | if route.Image != "" { | |||
| 1110 | + | // Extract image name (without registry prefix and tag) for suppression key | |||
| 1111 | + | imageName := route.Image | |||
| 1112 | + | // The suppression key is just the image name as stored in the registry | |||
| 1113 | + | // (e.g., "my-app" not "reg.example.com/my-app:latest") | |||
| 1114 | + | if parts := strings.SplitN(imageName, "/", 2); len(parts) == 2 { | |||
| 1115 | + | imageName = parts[1] | |||
| 1116 | + | } | |||
| 1117 | + | if idx := strings.LastIndex(imageName, ":"); idx != -1 { | |||
| 1118 | + | imageName = imageName[:idx] | |||
| 1119 | + | } | |||
| 1120 | + | h.registrySvc.ClearDeployEventSuppression(imageName) | |||
| 1121 | + | } | |||
| 1122 | + | ||||
| 1107 | log.Info().Str("domain", deployDomain).Str("container_id", container.ID).Msg("container deployed via admin API") | 1123 | log.Info().Str("domain", deployDomain).Str("container_id", container.ID).Msg("container deployed via admin API") | ||
| 1108 | h.sendJSON(w, http.StatusOK, dto.DeployResponse{ | 1124 | h.sendJSON(w, http.StatusOK, dto.DeployResponse{ | ||
| 1109 | Status: "deployed", | 1125 | Status: "deployed", | ||