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

feat: allow destinations to be configured to write straight to the root of the state store #234

Open
kirederik opened this issue Aug 30, 2024 · 0 comments
Labels
enhancement New feature or request Lavender

Comments

@kirederik
Copy link
Member

We recently introduced filepath.mode=none in destinations, which stops kratix from nesting files into directories. However, Kratix will still create at least one directory, named after the destination metadata.name.

There's a good reason why it behaves this way: state stores can be shared across different destinations, and not having a unique top-level directory can lead to file clashes. On the other hand, it's a bit confusing for users to explicitly set it to none but still get "one".

A less surprising experience would be if filepath.mode=none didn't create any directories at all. Users can still create subdirs for the destination by setting the spec.path field. We could also make it configurable via another property.

Warning

Depending on the implementation decision, this may be a breaking change. Consider a migration webhook so it's not

Scenarios

# Migration for existing Destinatinos
Given a destination set to filepath.mode=none and path=subdir
When I upgrade Kratix to the latest version
Then the migration webhook updates my Destination
And the `spec.path` migrates from `subdir` to `<destination name>/subdir`

# Brand new destination
Given a destination set to filepath.mode=none and path=nil
When a workplacement is created for that destination
Then it's written to the root directory
@kirederik kirederik added the enhancement New feature or request label Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Lavender
Projects
None yet
Development

No branches or pull requests

2 participants