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

support live diff preview at the level of model abstraction #24

Open
amyXia1994 opened this issue Mar 18, 2023 · 2 comments
Open

support live diff preview at the level of model abstraction #24

amyXia1994 opened this issue Mar 18, 2023 · 2 comments

Comments

@amyXia1994
Copy link
Contributor

amyXia1994 commented Mar 18, 2023

Feature

provide live diff preview, so that users will see what changes will be made before actually applying. And the preview should be displayed at the level of model abstraction to avoid the cognitive burden to be aware of infra-oriented details.

Design

The live diff preview can be triggered by 2 entries:

  • Command Palette -> select Kusion: Preview Live Diff and Apply
  • Right-click on a stack -> click Preview Live Diff and Apply

users can:

  • see side-to-side diff view with different values highlighted(green for added, red for deleted)
  • select or fill in the dynamic parameters for local configurations to digest
  • sync runtime configurations to local files by clicking the sync button on the diff lines
  • check the diffs, component by component
  • navigate through diff blocks up and down with current diff blocks highlighted

image

@Peefy
Copy link

Peefy commented Mar 28, 2023

Due to configuration drift, only displaying the stack configuration diff through the kusion state file or the git state cannot reflect the real situation. Therefore, additional means are needed to configure the mapping of the stack configuration and the cluster's real k8s resources. This configuration can usually be obtained in YAML format or directly written in KCL code through the KCL API. The following describes the approximate format written in KCL configuration.

schema Resource:
     @info(mapping_to = "spec.template.spec.containers[0].resources.requests.cpu")
     cpu: int

schema Server:
     @info(mapping_to = "spec.template.spec.containers[0].resources.requests")
     resource: Resource

Reference:

@amyXia1994
Copy link
Contributor Author

support live diff preview at raw k8s level: #50 #52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants