[x] Ensure State is recorded each run of aspirate (regardless of which command is running)
[x] Previous state should be loaded
[x] After previous state loaded, ensure state is augmented by newly passed in cli options
[x] Any cli options should be recorded in state so that they are not required to be passed on subsequent runs.
[x] State Management should be rolled through any action that asks a question. i.e. Deploy Dashboard, Kube Cluster chosen etc.
[x] On run after restoring state, allow to skip it and only restore secrets.
[x] Remove storage of secrets in a file in the output directory, combine them in the shared state file for aspirate. This means state can be committed, and secrets are still protected / encrypted.
[x] Remove the version field from the secrets object - pointless?
[x] Remove the Base64 secret provider. Its served it's purpose, but is no longer required - we should promote actual security as opposed to cling film...
[x] Setup base implementations of converting kustomize kubernetes deployment data to kubernetes client objects for when we implement the run command.
Base 64 Secret Provider has been removed. Opting to secret support now only offers encryption.
Secrets file has been removed from the aspirate-output directory. Secret state now resides in the shared state for aspirate in the AppHost directory, in the file 'aspirate-state.json'
Any command you run, and pass a cli option to will be recorded in state and is shared across all commands. This means if you were to run with --disable-secrets, and the next time you don't specify, secrets will remain disabled until you either change true to false in the state file, or pass --disable-secrets false (which will then be saved to state and persisted across runs). Each parameter you pass augments / mutates the previous state of the application when you pass it. Another example is changing format. If you were to run aspirate generate --output-format compose, and then aspirate generate the second run of generate would also produce a compose file. This is because your state now has the recorded option outputFormat: compose. You can either change this in the state file, or just run aspirate generate --output-format kustomize which will augment the previous state with the new setting, and all subsequent runs will be kustomize again. This behavior also affects the options you chose when running aspirate. The first run of generate will ask you which components etc, if you'd like the dashboard. Subsequent runs will remember all the options chosen in state (but can be overridden with cli options). When you run up aspirate and it restores the previous state, you will be prompted if you'd like to skip the previous state and re-choose options. This loses all state apart from secrets. Secrets ill be transferred over and you will be prompted to unlock them to augment them again.
🚀 New Features
State Management - shared additive state across all Aspir8 commands.
🚀 Feature Description
This PR introduces State Management for Aspirate, as well as removing the base64 secret provider (chocolate fireguard really...)
=======================================================
🧰 Technical Solution
=======================================================
⚠️ Breaking Changes
Base 64 Secret Provider has been removed. Opting to secret support now only offers encryption.
Secrets file has been removed from the aspirate-output directory. Secret state now resides in the shared state for aspirate in the AppHost directory, in the file 'aspirate-state.json'
Any command you run, and pass a cli option to will be recorded in state and is shared across all commands. This means if you were to run with --disable-secrets, and the next time you don't specify, secrets will remain disabled until you either change true to false in the state file, or pass
--disable-secrets false
(which will then be saved to state and persisted across runs). Each parameter you pass augments / mutates the previous state of the application when you pass it. Another example is changing format. If you were to runaspirate generate --output-format compose
, and thenaspirate generate
the second run of generate would also produce a compose file. This is because your state now has the recorded option outputFormat: compose. You can either change this in the state file, or just runaspirate generate --output-format kustomize
which will augment the previous state with the new setting, and all subsequent runs will be kustomize again. This behavior also affects the options you chose when running aspirate. The first run of generate will ask you which components etc, if you'd like the dashboard. Subsequent runs will remember all the options chosen in state (but can be overridden with cli options). When you run up aspirate and it restores the previous state, you will be prompted if you'd like to skip the previous state and re-choose options. This loses all state apart from secrets. Secrets ill be transferred over and you will be prompted to unlock them to augment them again.🚀 New Features