sheldonjuncker / node-kubycat

A Node.js library for automated Kubernetes file syncing.
https://www.kubycat.info
MIT License
7 stars 0 forks source link

Problems with sync-on-start when using build-cache-on-start #6

Open schlichtanders opened 1 year ago

schlichtanders commented 1 year ago

Hello,

I don't know what is going on but want to share this special case which seems not to work as expected

# config.yaml
kubycat:
  namespace: my-app-namespace
  sync:
  - name: my-app
    base: /home/myhome/MyApp
    from:
    - src
    - frontend-dist
    - Project.toml
    to: /home/myhome/MyApp
    pod-label: app.kubernetes.io/name=my-app
    shell: /bin/sh
    # Allows Kubycat to send desktop notifications on errors
    notify: true
    # Whether to show the logs for the sync
    show-logs: true
    # Sync files on startup
    sync-on-start: true
    # Build file caches on startup to prevent unintentional syncing
    # build-cache-on-start: true

  - name: MyApp.toml
    base: /home/myhome/MyApp/dev
    from:
    - MyApp.toml
    to: /home/myhome
    pod-label: app.kubernetes.io/name=my-app
    shell: /bin/sh
    # Allows Kubycat to send desktop notifications on errors
    notify: true
    # Whether to show the logs for the sync
    show-logs: true
    # Sync files on startup
    sync-on-start: true
    # Build file caches on startup to prevent unintentional syncing
    # build-cache-on-start: true

If I set build-cache-on-start: true to true for both, the second part is not synced on start. If I change the MyApp.toml file it will then get synced, but the initial sync does not happen. If I uncomment the build-cache-on-start option as above, everythings works correctly. (Hence this is also my workaround for now).

It would be great if build-cache-on-start works together with sync-on-start.

I hope this information can help

sheldonjuncker commented 1 year ago

I think I see the issue, which is being caused by the timing of the cache building and the syncing. I'll restructure things a bit and will have a fix shortly. I'm also closing #5 since it looks like a duplicate of this one.

schlichtanders commented 8 months ago

@sheldonjuncker have you made any progress here?

I experience very slow syncing and this caching could be one way to speed it up.