Files
coolify/app/Enums/ManagedDnsDeletionResult.php
Andras BacsaiandClaude Opus 5.5 2063e84d7c fix(dns): release managed records when a domain edit removes a hostname
- Editing a domain (UI application, service and preview domains, the
  General form, API application, preview, service, and service
  application updates) now releases the hostnames that the edit
  removed, like removing a domain does. Records that another live
  resource still uses are kept.
- A per-hostname lock (managed-dns:{team}:{hostname}) now covers the
  release (re-check, Cloudflare delete, row delete) and the create
  paths. A release can no longer delete a record that is being added
  again; a busy lock makes the release retry and the create wait or
  retry, and a create after a release makes the record again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 18:06:37 +02:00

35 lines
971 B
PHP

<?php
namespace App\Enums;
enum ManagedDnsDeletionResult: string
{
/** The provider record was deleted. */
case Deleted = 'deleted';
/** The provider record no longer exists. */
case AlreadyGone = 'already_gone';
/** Coolify did not create the record, so it is never deleted. */
case NotOwned = 'not_owned';
/** The record no longer carries Coolify's ownership comment or its value changed. */
case ChangedExternally = 'changed_externally';
/** The provider could not be reached or rejected the request; retry later. */
case Failed = 'failed';
/** Another change for the same hostname held the hostname lock; nothing was changed, retry later. */
case Busy = 'busy';
public function removedFromProvider(): bool
{
return $this === self::Deleted || $this === self::AlreadyGone;
}
public function shouldRetry(): bool
{
return $this === self::Failed || $this === self::Busy;
}
}