Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

350 all resource cleanups should happen properly when environment is getting deleted it is not deleting all the resources under it#353

Merged
abdheshnayak merged 2 commits into
release-v1.0.7from
350-all-resource-cleanups-should-happen-properly-when-environment-is-getting-deleted-it-is-not-deleting-all-the-resources-under-it
Jul 19, 2024
Merged

350 all resource cleanups should happen properly when environment is getting deleted it is not deleting all the resources under it#353
abdheshnayak merged 2 commits into
release-v1.0.7from
350-all-resource-cleanups-should-happen-properly-when-environment-is-getting-deleted-it-is-not-deleting-all-the-resources-under-it

Conversation

@abdheshnayak
Copy link
Copy Markdown
Contributor

@abdheshnayak abdheshnayak commented Jul 19, 2024

  • added deleting resources of environment while deleting environment.

Summary by Sourcery

This pull request ensures that all resources associated with an environment are properly deleted when the environment itself is deleted. This includes applications, external applications, secrets, configurations, routers, and imported resources.

  • Bug Fixes:
    • Fixed issue where deleting an environment did not remove all associated resources.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Jul 19, 2024

Reviewer's Guide by Sourcery

This pull request addresses the issue of incomplete resource cleanup when an environment is deleted. The changes ensure that all associated resources are properly deleted when an environment is removed.

File-Level Changes

Files Changes
apps/console/internal/domain/environment.go Introduced a new function to clean up resources and integrated it into the environment deletion workflow.
apps/accounts/internal/domain/accounts.go Handled the unsupported operation for deleting namespaces by returning an error instead of panicking.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @abdheshnayak - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

t "github.com/kloudlite/api/pkg/types"
)

func (d *domain) cleanupEnvironment(ctx ConsoleContext, envName string) error {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Consider adding a log statement at the start of the cleanupEnvironment function.

Adding a log statement at the beginning of the cleanupEnvironment function can help in debugging and tracking the flow of the cleanup process.

Suggested change
func (d *domain) cleanupEnvironment(ctx ConsoleContext, envName string) error {
func (d *domain) cleanupEnvironment(ctx ConsoleContext, envName string) error {
log.Printf("Starting cleanup for environment: %s in account: %s", envName, ctx.AccountName)

@abdheshnayak abdheshnayak deleted the 350-all-resource-cleanups-should-happen-properly-when-environment-is-getting-deleted-it-is-not-deleting-all-the-resources-under-it branch July 19, 2024 07:50
abdheshnayak added a commit that referenced this pull request Nov 5, 2024
…getting deleted it is not deleting all the resources under it (#353)

* 🎨 Added env resources deletion when env is deleted

* 🎨 Added imported-mres for deletion while deleting environment
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

All resource cleanups should happen properly. When environment is getting deleted it is not deleting all the resources under it.

1 participant