hauler-dev/hauler

[BUG] PDFs being treated as images

Closed this issue · 2 comments

Environmental Info:

I have tested this on darwin and linux.

clembookair:clemenko Desktop $ uname -a
Darwin clembookair.local 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:16:46 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T8112 arm64

Hauler Version: 1.0.7

Describe the Bug:

Loading an pdf as a file is handled as an image. Hauler then serves it out as an image.

Steps to Reproduce:

Use

apiVersion: content.hauler.cattle.io/v1alpha1
kind: Files
metadata:
  name: rancher-files
spec:
  files:
  - path: https://rfed.io/Carbide_Provisioning_docs.pdf
clembookair:clemenko Desktop $ hauler store sync -f pdf_not_image.yaml 
2024-08-15 22:00:43 INF syncing [content.hauler.cattle.io/v1alpha1, Kind=Files] to store
2024-08-15 22:00:43 INF adding 'file' [https://rfed.io/Carbide_Provisioning_docs.pdf] to the store as [hauler/carbide_provisioning_docs.pdf:latest]
2024-08-15 22:00:44 INF successfully added 'file' [hauler/carbide_provisioning_docs.pdf:latest]
clembookair:clemenko Desktop $ hauler store info
+---------------------------------------------+------+----------+----------+-------+
| REFERENCE                                   | TYPE | PLATFORM | # LAYERS | SIZE  |
+---------------------------------------------+------+----------+----------+-------+
| hauler/carbide_provisioning_docs.pdf:latest | file | -        |        1 | 153 B |
+---------------------------------------------+------+----------+----------+-------+
|                                                                  TOTAL   | 153 B |
+---------------------------------------------+------+----------+----------+-------+
clembookair:clemenko Desktop $ hauler store serve registry
2024-08-15 22:00:59 INF hauler/carbide_provisioning_docs.pdf:latest
2024-08-15 22:00:59 INF 2024/08/15 22:00:59 existing manifest: latest@sha256:99840916342bf2227de67b583873d2805b7ac34f241f0ec56f65914b800a05d3
2024-08-15 22:00:59 INF copied artifacts to [127.0.0.1:63557]
2024-08-15 22:00:59 INF starting registry on port [5000]
WARN[0001] No HTTP secret provided - generated random secret. This may cause problems with uploads if multiple registries are behind a load-balancer. To provide a shared secret, fill in http.secret in the configuration file or set the REGISTRY_HTTP_SECRET environment variable.  go.version=go1.21.12 version=v3.0.0+unknown
INFO[0001] redis not configured                          go.version=go1.21.12 version=v3.0.0+unknown
INFO[0001] Starting upload purge in 12m0s                go.version=go1.21.12 version=v3.0.0+unknown
INFO[0001] using inmemory blob descriptor cache          go.version=go1.21.12 version=v3.0.0+unknown
INFO[0001] listening on [::]:5000                        go.version=go1.21.12 version=v3.0.0+unknown

Expected Behavior:

Not to serve the pdf as an image.

Actual Behavior:

Serve the pdf as a file only.

Additional Context:

Closing due to the intended functionality that all content within hauler is an oci artifact.

Users are able to use any type of content within hauler and transport via any oci capable tool or workflow.

May want to reconsider this since both the hauler store server registry and hauler store serve fileserver functions copy the file out of the store and into the respective directory. This is causing extra disk space AND confusion. There is ZERO reason to actually serve "files" out like this. Why not create a filter to open serve charts and images?