Documentation
¶
Index ¶
- func CheckUploadProgress(ctx context.Context, httpClient *safeClient.SafeClient, targetURL string) (int64, error)
- func CreateDataImport(ctx context.Context, name, namespace, ttl string, ...) error
- func DeleteDataImport(ctx context.Context, diName, namespace string, rtClient ctrlrtclient.Client) error
- func EnsureDataImportPublish(ctx context.Context, diObj *v1alpha1.DataImport, publish bool, ...) error
- func GetDataImport(ctx context.Context, diName, namespace string, rtClient ctrlrtclient.Client) (*v1alpha1.DataImport, error)
- func GetDataImportWithRestart(ctx context.Context, diName, namespace string, rtClient ctrlrtclient.Client, ...) (*v1alpha1.DataImport, error)
- func PostFinished(ctx context.Context, httpClient *safeClient.SafeClient, baseURL string) error
- func PrepareUpload(ctx context.Context, diName, namespace string, publish bool, ...) (string, string, string, *safeClient.SafeClient, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckUploadProgress ¶
func CheckUploadProgress(ctx context.Context, httpClient *safeClient.SafeClient, targetURL string) (int64, error)
func CreateDataImport ¶
func CreateDataImport( ctx context.Context, name, namespace, ttl string, publish, waitForFirstConsumer bool, pvcTpl *v1alpha1.PersistentVolumeClaimTemplateSpec, rtClient ctrlrtclient.Client, ) error
func DeleteDataImport ¶
func EnsureDataImportPublish ¶ added in v0.29.8
func EnsureDataImportPublish( ctx context.Context, diObj *v1alpha1.DataImport, publish bool, rtClient ctrlrtclient.Client, ) error
EnsureDataImportPublish patches DataImport.Spec.Publish to match the resolved value. Only upgrades publish: false -> true is patched, true -> false is intentionally skipped to avoid downgrading already-published resources.
func GetDataImport ¶
func GetDataImport(ctx context.Context, diName, namespace string, rtClient ctrlrtclient.Client) (*v1alpha1.DataImport, error)
func GetDataImportWithRestart ¶
func GetDataImportWithRestart( ctx context.Context, diName, namespace string, rtClient ctrlrtclient.Client, log *slog.Logger, ) (*v1alpha1.DataImport, error)
func PostFinished ¶ added in v0.33.7
func PostFinished(ctx context.Context, httpClient *safeClient.SafeClient, baseURL string) error
PostFinished signals end-of-upload to the importer (POST <baseURL>/api/v1/finished), which flips the DataImport's serverState to Finished. This is mandatory: the last data chunk (a PUT that fills the device / writes the final file) does NOT finalise on its own, and the controller only sets UploadFinished=True — the gate for rebinding the target and reaching Completed — once serverState is Finished. baseURL is the importer base (status.url / status.publicURL), the same base the /api/v1/{files,block} data endpoint hangs off of.
func PrepareUpload ¶
func PrepareUpload( ctx context.Context, diName, namespace string, publish bool, sClient *safeClient.SafeClient, log *slog.Logger, ) (string, string, string, *safeClient.SafeClient, error)
Types ¶
This section is empty.