implement archive managed services#343
Conversation
Reviewer's Guide by SourceryThis pull request implements the archiving of managed services by adding an ArchiveClusterManagedService method. This method sets the isArchived field to true for the specified cluster's managed services. The DeleteCluster method is updated to call this new method before deleting a cluster. Additionally, the isArchived field and its constant are added to the ClusterManagedService struct. File-Level Changes
Tips
|
There was a problem hiding this comment.
Hey @nxtcoder19 - 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
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
| return destMsvc, nil | ||
| } | ||
|
|
||
| func (d *domain) ArchiveClusterManagedService(ctx InfraContext, clusterName string) error { |
There was a problem hiding this comment.
suggestion (bug_risk): Consider adding a check for empty or invalid clusterName.
Adding a check for an empty or invalid clusterName at the beginning of the function can prevent unnecessary database queries and potential errors.
| func (d *domain) ArchiveClusterManagedService(ctx InfraContext, clusterName string) error { | |
| func (d *domain) ArchiveClusterManagedService(ctx InfraContext, clusterName string) error { | |
| if clusterName == "" { | |
| return errors.New("clusterName cannot be empty") | |
| } |
implement archive managed services
Summary by Sourcery
This pull request introduces a new feature to archive cluster managed services. It adds a new function, ArchiveClusterManagedService, and modifies the DeleteCluster function to utilize this new archiving capability. Additionally, a new field 'IsArchived' is added to the ClusterManagedService entity to support this feature.