package domain import "errors" // Domain errors represent business-level errors that can occur in the system. // These errors are used across layers to communicate specific failure conditions. var ( // Container errors ErrContainerNotFound = errors.New("container not found") ErrContainerExists = errors.New("container already exists") ErrContainerNotRunning = errors.New("container is not running") ErrContainerRunning = errors.New("container is already running") ErrContainerExited = errors.New("container exited") // ErrRuntimeUnsupported wraps device-bearing create failures on // engines that cannot serve CDI device requests. It fails closed: // Gordon never retries without devices. ErrRuntimeUnsupported = errors.New("runtime does not support CDI device requests") // Image errors ErrImageNotFound = errors.New("image not found") ErrImagePullFailed = errors.New("failed to pull image") ErrInvalidImageFormat = errors.New("invalid image format") // Route errors ErrRouteNotFound = errors.New("route not found") ErrRouteExists = errors.New("route already exists") ErrInvalidRoute = errors.New("invalid route configuration") ErrNoRouteForImage = errors.New("no route configured for image") ErrRouteDomainEmpty = errors.New("route domain cannot be empty") ErrRouteImageEmpty = errors.New("route image cannot be empty") ErrRouteDomainInvalid = errors.New("route domain is not a valid public hostname") ErrNoTargetAvailable = errors.New("no target available for route") // Registry errors ErrManifestNotFound = errors.New("manifest not found") ErrBlobNotFound = errors.New("blob not found") ErrUploadNotFound = errors.New("upload not found") ErrInvalidDigest = errors.New("invalid digest") ErrDigestMismatch = errors.New("digest mismatch") ErrUnauthorized = errors.New("unauthorized") ErrBlobSizeExceeded = errors.New("blob size exceeds maximum") ErrExecOutputExceeded = errors.New("container exec output exceeds maximum") // ErrManifestBlobUnknown marks a manifest that references config or // layer content the repository never completed an upload for. ErrManifestBlobUnknown = errors.New("manifest references a blob the repository does not own") // Network errors ErrNetworkNotFound = errors.New("network not found") ErrNetworkExists = errors.New("network already exists") // Volume errors ErrVolumeNotFound = errors.New("volume not found") ErrVolumeExists = errors.New("volume already exists") ErrVolumeBackupUnavailable = errors.New("volume backup service unavailable") ErrVolumeOwnershipUnverified = errors.New("volume ownership cannot be verified") // Preview errors ErrPreviewNotFound = errors.New("preview not found") // Config errors ErrTrafficGraphRequired = errors.New("traffic graph is required") ErrClientHelloTooLarge = errors.New("client hello exceeds maximum") ErrConfigNotFound = errors.New("configuration not found") ErrInvalidConfig = errors.New("invalid configuration") ErrConfigLoadFailed = errors.New("failed to load configuration") ErrInvalidDomainPattern = errors.New("invalid domain pattern") ErrRouteConflict = errors.New("route conflicts with existing configuration") // App manifest errors ErrInvalidAppSpec = errors.New("invalid app manifest") // ErrInvalidNetworkProbe wraps malformed bounded container-network // readiness requests. It is distinct from ErrInvalidAppSpec: the // manifest may be valid while one probe request is not. ErrInvalidNetworkProbe = errors.New("invalid network probe request") // ErrNetworkProbeCleanup marks a helper that could not be force-removed. // Callers must fail immediately rather than create another helper. ErrNetworkProbeCleanup = errors.New("network probe helper cleanup failed") // ErrBindPolicy wraps administrative bind policy violations. It is // distinct from ErrInvalidAppSpec: the manifest may be valid while the // installation policy refuses to serve it. ErrBindPolicy = errors.New("bind policy violation") // ErrDevicePolicy wraps administrative device policy violations. It is // distinct from ErrInvalidAppSpec: the manifest may be valid while the // installation policy refuses to serve it. ErrDevicePolicy = errors.New("device policy violation") // ErrRuntimeGuard wraps app container configs refused by the runtime // guard: host or shared namespaces, host paths passed as volume // names, or binds overlapping Gordon's own sensitive paths. ErrRuntimeGuard = errors.New("runtime guard violation") // App state errors ErrAppStateIO = errors.New("app state storage failure") ErrAppStateCorrupt = errors.New("app state is corrupt") ErrAppStateIncompatible = errors.New("app state format is not supported by this binary") ErrAppStateConflict = errors.New("app state conflict") // ErrAppNotFound marks a lifecycle mutation of a name that has no // live app identity at all. It is distinct from a missing revision // or operation on a known app. ErrAppNotFound = errors.New("app not found") ErrAppRevisionNotFound = errors.New("app revision not found") ErrAppIntentNotFound = errors.New("app apply intent not found") ErrAppOperationNotFound = errors.New("app operation not found") ErrAppReservationConflict = errors.New("listener reservation conflict") ErrAppTrafficProjection = errors.New("app traffic projection failed") ErrAppImageUnresolvable = errors.New("image reference unresolvable") ErrAppImageNotAllowed = errors.New("image reference not allowed by installation policy") ErrAppSecretMissing = errors.New("required app secret missing") ErrAppUnmanagedImageVolume = errors.New("image declares unmanaged volume") // ErrAppServiceScope marks an app-wide mutation of a multi-service app // that named neither one service nor all of them. ErrAppServiceScope = errors.New("app service scope required") // ErrPruneDisabled means prune could not establish a safe scope for // the requested operation at all (for example, its protection or // runtime ports are not wired). It is never returned merely because // app state exists: protected and unknown candidates are reported // per candidate and do not fail the operation. ErrPruneDisabled = errors.New("pruning unavailable: cannot establish a safe prune scope") // Environment errors ErrEnvFileNotFound = errors.New("environment file not found") ErrSecretNotFound = errors.New("secret not found") ErrSecretsAlreadyExist = errors.New("secrets already exist") ErrProviderNotFound = errors.New("secret provider not found") ErrAttachmentOwnershipMismatch = errors.New("attachment ownership mismatch") ErrReadinessLogSizeExceeded = errors.New("readiness log exceeds maximum") // Authentication errors ErrInvalidToken = errors.New("invalid token") ErrExpiredToken = errors.New("token has expired") ErrRevokedToken = errors.New("token has been revoked") ErrInvalidCredentials = errors.New("invalid credentials") ErrTokenNotFound = errors.New("token not found") // Security errors ErrPathTraversal = errors.New("path traversal not allowed") ErrInvalidPath = errors.New("invalid path format") ErrInsufficientScope = errors.New("insufficient scope for operation") ErrInvalidScope = errors.New("invalid scope format") ErrSSRFBlocked = errors.New("request to internal/blocked network not allowed") ErrInvalidEnvKey = errors.New("invalid environment variable key") ErrEnvContainsSecretRef = errors.New("environment file contains secret reference") ErrLongLivedToken = errors.New("long-lived tokens must be exchanged via /auth/token") // Remote errors ErrEmptyRemoteName = errors.New("remote name must not be empty") ErrInvalidRemoteNameChar = errors.New("remote name contains invalid characters") ErrConsecutiveDots = errors.New("remote name must not contain consecutive dots") ErrPassUnavailable = errors.New("pass is not available") ErrRemoteNotFound = errors.New("remote not found") // Attachment errors ErrAttachmentNotFound = errors.New("attachment not found") ErrAttachmentExists = errors.New("attachment already exists") ErrAttachmentImageEmpty = errors.New("attachment image cannot be empty") ErrAttachmentTargetEmpty = errors.New("attachment target (domain or group) cannot be empty") ErrAttachmentNotDeployed = errors.New("configured attachment is not deployed; run gordon deploy to create it") // TLS / ACME errors ErrACMEDisabled = errors.New("acme disabled") ErrACMEEmailRequired = errors.New("acme email required") ErrACMEChallengeInvalid = errors.New("acme challenge invalid") ErrDNSConfigInvalid = errors.New("dns configuration invalid") ErrCloudflareTokenMissing = errors.New("cloudflare api token missing") ErrCertificateStoreRequired = errors.New("certificate store required") ErrCertificateIssuerRequired = errors.New("certificate issuer required") ErrRouteSourceRequired = errors.New("route source required") ErrHTTPChallengeSinkRequired = errors.New("http challenge sink required") ErrTLSRouteNotCovered = errors.New("tls route not covered by public certificate") // Traffic errors ErrTrafficStatusUnavailable = errors.New("traffic status unavailable") )