-
Notifications
You must be signed in to change notification settings - Fork 146
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: cleanup azcopy jobs after job complete #2394
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andyzhangx 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 |
@andyzhangx: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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-sigs/prow repository. I understand the commands that are listed here. |
@@ -1167,6 +1167,9 @@ func (d *Driver) copyFileShareByAzcopy(srcFileShareName, dstFileShareName, srcPa | |||
klog.Warningf("CopyFileShare(%s, %s, %s) failed with error: %v", accountOptions.ResourceGroup, dstAccountName, dstFileShareName, 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.
I could see that below azcopy job completion states are not handled in job parsing. Andy, can you please check once.
azurefile-csi-driver/pkg/util/util.go
Line 176 in 4df8f6e
case "Completed": |
Unhandled States: CompletedWithErrors, CompletedWithSkipped, CompletedWithErrorsAndSkipped-
And it should be handled in this switch statement as well.
https://github.com/kubernetes-sigs/azurefile-csi-driver/blob/166c186e1123486cebef2659ca78cd1f37393186/pkg/azurefile/controllerserver.go#L1136C2-L1136C18
Azcopy Job States:
https://github.com/Azure/azure-storage-azcopy/blob/a9a6a80d598a2074d6922d50e4ece2af180a4f4a/common/fe-ste-models.go#L504
func (ac *Azcopy) TestListJobs(accountName, storageEndpointSuffix string, authAzcopyEnv []string) (string, error) { | ||
cmdStr := fmt.Sprintf("azcopy list %s", fmt.Sprintf("https://%s.file.%s", accountName, storageEndpointSuffix)) | ||
func (ac *Azcopy) CleanJobs() (string, error) { | ||
cmdStr := "azcopy jobs clean --with-status=completed" |
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.
Andy, do we need some kind of eventual cleanups of other completion/failed/cancelled azcopy jobs as well so that over time these were not accumulated?
What type of PR is this?
/kind bug
What this PR does / why we need it:
fix: cleanup azcopy jobs after job complete
this could reduce .azopy/plans folder files
Which issue(s) this PR fixes:
Fixes #2387
Requirements:
Special notes for your reviewer:
Release note: