Document what the DownloadRequest Processed phase means (#10245)

Processed means the controller signed a URL into status.downloadURL. It
does not mean the object is present: GetDownloadURL builds the key by
convention and signs it, with no existence check, so a request whose
target never produced a file still reaches Processed and the URL 404s.

The CLI never sees this because it filters on backup and restore phase
before creating the request. Other API consumers have nothing in the
status telling them that filter is needed, and the field description
said only "Phase is the current state of the DownloadRequest".

Documentation only. The field comments are what controller-gen writes
into the CRD, so this reaches kubectl explain and generated clients
without anyone reading the Go source.

Refs #10232

Signed-off-by: saral <ilovegojo2580@gmail.com>
This commit is contained in:
Ralthos
2026-08-14 15:37:05 +08:00
committed by GitHub
parent d60ee8ba0e
commit 8e3c92f0bf
4 changed files with 21 additions and 8 deletions
+1
View File
@@ -0,0 +1 @@
Document that the DownloadRequest Processed phase means a URL has been signed, and that it does not imply the target object exists
@@ -79,8 +79,9 @@ spec:
description: DownloadRequestStatus is the current status of a DownloadRequest.
properties:
downloadURL:
description: DownloadURL contains the pre-signed URL for the target
file.
description: |-
DownloadURL contains the pre-signed URL for the target file. It is signed for a fixed
lifetime and expires at Expiration, so it should be used promptly and not cached.
type: string
expiration:
description: Expiration is when this DownloadRequest expires and can
@@ -89,7 +90,12 @@ spec:
nullable: true
type: string
phase:
description: Phase is the current state of the DownloadRequest.
description: |-
Phase is the current state of the DownloadRequest. Processed means a URL has been
signed into DownloadURL. It does not mean the target object exists in object storage,
so a request whose target never produced a file still reaches Processed and the URL
returns 404. Callers should check that the backup or restore is in a phase that
produces the target before relying on the download.
enum:
- New
- Processed
File diff suppressed because one or more lines are too long
+10 -4
View File
@@ -64,18 +64,24 @@ const (
// DownloadRequestController yet.
DownloadRequestPhaseNew DownloadRequestPhase = "New"
// DownloadRequestPhaseProcessed means the DownloadRequest has been processed by the
// DownloadRequestController.
// DownloadRequestPhaseProcessed means the DownloadRequestController has signed a URL
// into Status.DownloadURL. The controller signs the key by convention and does not
// check that the object is present, so this phase does not imply the file exists.
DownloadRequestPhaseProcessed DownloadRequestPhase = "Processed"
)
// DownloadRequestStatus is the current status of a DownloadRequest.
type DownloadRequestStatus struct {
// Phase is the current state of the DownloadRequest.
// Phase is the current state of the DownloadRequest. Processed means a URL has been
// signed into DownloadURL. It does not mean the target object exists in object storage,
// so a request whose target never produced a file still reaches Processed and the URL
// returns 404. Callers should check that the backup or restore is in a phase that
// produces the target before relying on the download.
// +optional
Phase DownloadRequestPhase `json:"phase,omitempty"`
// DownloadURL contains the pre-signed URL for the target file.
// DownloadURL contains the pre-signed URL for the target file. It is signed for a fixed
// lifetime and expires at Expiration, so it should be used promptly and not cached.
// +optional
DownloadURL string `json:"downloadURL,omitempty"`