Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If sprites are in k8s configMap, image names get garbled #1343

Open
nyurik opened this issue May 17, 2024 · 0 comments
Open

If sprites are in k8s configMap, image names get garbled #1343

nyurik opened this issue May 17, 2024 · 0 comments

Comments

@nyurik
Copy link
Member

nyurik commented May 17, 2024

SVG files could be stored as binary blobs in the kubernetes' ConfigMap, and bound to Martin using config example below. Viewing files by connecting to the pod seem ok, but all files are actually symlinks (which should be ok).

/ # ls /app/sprites/foobar
foo.svg           bar.svg

/ # ls -alh /app/sprites/foobar
total 12K    
drwxrwxrwx    3 root     root        4.0K May 17 17:57 .
drwxr-xr-x    3 root     root        4.0K May 17 17:57 ..
drwxr-xr-x    2 root     root        4.0K May 17 17:57 ..2024_05_17_17_57_51.390489675
lrwxrwxrwx    1 root     root          31 May 17 17:57 ..data -> ..2024_05_17_17_57_51.390489675
lrwxrwxrwx    1 root     root          18 May 17 17:57 foo.svg -> ..data/foo.svg
lrwxrwxrwx    1 root     root          22 May 17 17:57 bar.svg -> ..data/bar.svg

The sprite json file on the other hand is incorrectly generated - http://.../sprite/foobar.json:

{
  "..2024_05_17_17_57_51.390489675/foo": {
    "height": 84,
    "pixelRatio": 1,
    "width": 85,
    "x": 170,
    "y": 0
  },
  "..2024_05_17_17_57_51.390489675/bar": {
    "height": 85,
    "pixelRatio": 1,
    "width": 85,
    "x": 0,
    "y": 0
  }
}

The catalog is also showing incorrect images, and they are duplicated?

{
  "sprites": {
    "foobar": {
      "images": [
        "..2024_05_17_17_57_51.390489675/foo",
        "..2024_05_17_17_57_51.390489675/foo",
        "..2024_05_17_17_57_51.390489675/foo",
        "..2024_05_17_17_57_51.390489675/bar",
        "..2024_05_17_17_57_51.390489675/bar",
        "..2024_05_17_17_57_51.390489675/bar"
      ]
    }
  }
}
    # Pod config or template:

    spec:
      volumes:
        - name: sprite-files
          configMap:
            name: {{ .Chart.Name }}-tiles-sprites
      containers:
        - name: tiles
          image: ghcr.io/maplibre/martin:latest
          volumeMounts:
            - name: sprite-files
              mountPath: /app/sprites/foobar
          args:
            - --sprite
            - /app/sprites/foobar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant