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

internal error when running kusion apply #65

Closed
howieyuen opened this issue Jun 7, 2022 · 1 comment · Fixed by #64
Closed

internal error when running kusion apply #65

howieyuen opened this issue Jun 7, 2022 · 1 comment · Fixed by #64
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@howieyuen
Copy link
Collaborator

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  1. kusion init
  2. kusion apply

2. What did you expect to see? (Required)

create 3 resources successfully

3. What did you see instead (Required)

image

4. What is your KusionStack components version? (Required)

releaseVersion: v0.4.2-alpha.1
gitInfo:
latestTag: v0.4.2-alpha.1
commit: 28b4f93
treeState: clean
buildInfo:
goVersion: go1.17.10
GOOS: linux
GOARCH: amd64
numCPU: 2
compiler: gc
buildTime: "2022-05-26 08:37:19"
dependency:
kclvmgoVersion: v0.4.2-alpha4
kclPluginVersion: v0.4.1-alpha2

@howieyuen howieyuen added kind/bug Something isn't working cli labels Jun 7, 2022
@howieyuen howieyuen self-assigned this Jun 7, 2022
@howieyuen howieyuen added this to the v0.5.0 milestone Jun 7, 2022
@howieyuen
Copy link
Collaborator Author

howieyuen commented Jun 8, 2022

root cause

The error occurs in the picture above, caused by reading live state for a not existing resource, it's just like what returns from deleting a not existing resource. So we need to ignore NotFound error.

other bug

kusion apply has 2 phases: preview what to do and make preview work. In the preview stage, user can see changes not only belongs to one resource but also all resources.
However, whatever we choose now, always follows a cancel command.

actions

  1. refactor runtime apply logic, which requires create and patch separately.
  2. About preview and apply operation, we combined with 2 conditions to distinguish preview of apply or destroy, which is extremely ugly and easy to make mistake. So I add two new Operation ApplyPreviw and DestroyPreviw. And we can categorize these as preview operation and update operation.
    a. DestroyPreviw not need to compute node action, because it's triggered by kusion destroy, which is use to delete everything.
    b. ApplyPreviw need to compute node action, but not make changes actually, it return earlier than Apply
    c. Destroy is one step further than DestroyPreview, will delete all resources here.
    d. Apply need to compute node action first, and then make changes.
  3. fix unexpected cancel command in prompt cycle.

leftovers

  1. diff logic used planed resources and last applied resources to generate report in the past, now should be consistent with runtime logic, 3-ways diff, now just compare planed resources with live resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant