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
Delete storage policy ids when cluser is deleted #5075
Delete storage policy ids when cluser is deleted #5075
Conversation
/test e2e-vsphere cc: @rvanderp3 |
pkg/destroy/vsphere/vsphere.go
Outdated
matchingProfileIds = append(matchingProfileIds, profileID) | ||
} | ||
} | ||
_, err = pbmClient.DeleteProfile(ctx, matchingProfileIds) |
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.
Please log deleted profiles, like deleted VMs and folders are logged.
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.
added logging
pkg/destroy/vsphere/vsphere.go
Outdated
@@ -212,6 +249,11 @@ func (o *ClusterUninstaller) Run() error { | |||
o.Logger.Debug("No managed Folder found") | |||
} | |||
|
|||
err = deleteStoragePolicy(context.TODO(), o.Client, o.InfraID) |
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.
Could vCenter return storage policies in getAttachedObjectsOnTag
above? It feels odd to distinguish VMs and folders by tag and storage policies by name.
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.
you can't tag storage policies AFAIK. I spent bit of time looking into that and I could not find an option.
if err != nil { | ||
return errors.Errorf("error deleting storage policy: %v", err) | ||
} | ||
|
||
o.Logger.Debug("Delete tag") | ||
tagLogger := o.Logger.WithField("Tag", o.InfraID) | ||
if err = deleteTag(context.TODO(), o.RestClient, o.InfraID); err != nil { |
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.
Just to confirm: will this delete tag on the Datastore?
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.
Yes, deleting the tag removes the tag from associated objects (including datastore).
/test e2e-vsphere |
1 similar comment
/test e2e-vsphere |
/retest |
/lgtm |
/retest |
1 similar comment
/retest |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: patrickdillon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
@gnufied: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
cc @jcpowermac