nutanix / calm-dsl

Keep Calm and DSL On!
https://nutanix.github.io/calm-dsl/
Apache License 2.0
32 stars 51 forks source link

Support for passing existing environments in project spec file for update command #187

Closed abhijeetkaurav1st closed 2 years ago

abhijeetkaurav1st commented 3 years ago

calm update project -f <project_file>. command update the project with the file data. All data is overrided as of now. Need a way to pass existing environments in project file. Ex:

class Project1(Project):
     envs = [Env1, Env2]
     env_refs = [Ref.Environment("Existing environment with this project")]

Where env_refs will take existing environments to be remain in the project

abhijeetkaurav1st commented 2 years ago

Or much better, if during update we will not remove existing envs from project also.

glover-chris commented 2 years ago

Agree with your above better comment. We use separate environment files and do not create envs within the project file. Maybe a switch at project update which will not remove existing? Also a switch to ensure users/groups are not removed from the project if not included in the project.py file (most customers want to separate their envs and users/groups from the project file in order to keep them as atomic as possible.