kyma-project / nats-manager

Apache License 2.0
5 stars 13 forks source link

fix: nats-server runs as non-root #319

Closed friedrichwilken closed 8 months ago

friedrichwilken commented 8 months ago

Description

Changes proposed in this pull request:

Test We tested this with a pub-sub setup via the eventing-tools:

  1. We created a publisher (without a subscriber) that sends events to fill the file storage of the NATS-server. We eventually stop the publisher, so we have a defined number of events.
  2. We changed the NATS-manager image to this PR's image; this will update the StatefulSet which will trigger a rolling update of the Pods, starting with the InitContainer that changes the owner and rights of the files in the persistantStorage.
  3. We created a subscriber (without a publisher) that will receive the messages created in step 1 and stored in the file storage. All created messages where received; no messages were lost.

We also checked the owner of the persistent storage: Before the NATS-manager image change the owner was root and the group was 10001. After the owner was 1000 and the group was 10001.

Related issue(s)