kthcloud / console

kthcloud web console
https://cloud.cbh.kth.se
MIT License
3 stars 3 forks source link

Feature request: Init commands #302

Closed Phillezi closed 3 weeks ago

Phillezi commented 3 weeks ago

Is your feature request related to a problem? Please describe. It would be nice to be able to set init commands using the console, if you for example want to use keycloak with the start command.

Describe the solution you'd like A text field similar to the one in the ImageManager would be nice, that on save updates the initCommands field on the deployment.

Describe alternatives you've considered It could work like the EnvManager otherwise, where the user can insert each command manually and it being displayed as a Table.

It could look something like this image

Phillezi commented 3 weeks ago

I have made a component for this: InitCommandManager.tsx it is pretty similar to ImageManager.tsx but it splits the commands by space into a string array and warns the user if they exceed 100 commands (100 was specified as max in the go-deploy model).

I'm just unsure if splitting by space is correct, should mongod --auth be treated as one command or as two commands? If i split by space the it becomes

...
"initCommands": [
  "mongod",
  "--auth"
] 

Here's how it looks: image image

The text should probably be changed to be more descriptive, let me know what you think.

Also let me know if you think if it is better to handle it like the EnvManager does with environment variables (in a table)

pierrelefevre commented 3 weeks ago

I believe this is a duplicate of https://github.com/kthcloud/console/issues/198?

Phillezi commented 3 weeks ago

oh yeah, sorry

pierrelefevre commented 3 weeks ago

The current version is pretty bare bones however so feel free to refine it :D

pierrelefevre commented 3 weeks ago

I'll merge it to main so you can check it out on a local branch