-
Notifications
You must be signed in to change notification settings - Fork 66
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
fix: The execution of the terraformDestroy method fails and the appli… #366
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #366 +/- ##
==========================================
- Coverage 79.31% 76.82% -2.49%
==========================================
Files 23 24 +1
Lines 1750 2054 +304
==========================================
+ Hits 1388 1578 +190
- Misses 278 379 +101
- Partials 84 97 +13
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
…ation cannot be uninstalled kubevela#363 Signed-off-by: 吴就业 <wujiuye@lizhi.fm>
0f81fc9
to
672d815
Compare
if len(tfState.Outputs) == 0 { | ||
return false | ||
} | ||
return true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return len(tfState.Outputs) > 0
// fix: The failure of terraformApply does not mean that it has never been successful, | ||
// but if the 'tfstate' file does not exist, then there is no need for terraformDestroy, | ||
// which can quickly clean up resources. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// fix: The failure of terraformApply does not mean that it has never been successful, | |
// but if the 'tfstate' file does not exist, then there is no need for terraformDestroy, | |
// which can quickly clean up resources. | |
// If no tfState has been generated, then perform a quick cleanup without dispatching destroying job. | |
} else { | ||
klog.Infof("No need to execute terraform destroy command, because tfstate file not found: %s/%s", configuration.Namespace, configuration.Name) | ||
if err := r.cleanUpSubResources(ctx, configuration, meta); err != nil { | ||
klog.Warningf("Failed to clean up sub-resources, but it's ignored as the resources are being forced to delete: %s", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No clue suggests the "configuration" is force to delete.
klog.Warningf("Failed to clean up sub-resources, but it's ignored as the resources are being forced to delete: %s", err) | |
klog.Warningf("Ignoring error when clean up sub-resources, for no resource is actually created: %s", err) |
Signed-off-by: 吴就业 <wujiuye@lizhi.fm>
…cation cannot be uninstalled(#363)