properly ignore permission denied error with mirror (#4803)

This commit is contained in:
Harshavardhana
2023-12-26 10:07:28 -08:00
committed by GitHub
parent c27ddd4adf
commit 176f657e53
+9 -2
View File
@@ -533,8 +533,15 @@ func (mj *mirrorJob) monitorMirrorStatus(cancel context.CancelFunc) (errDuringMi
if isErrIgnored(sURLs.Error) {
ignoreErr = true
} else {
errorIf(sURLs.Error.Trace(sURLs.SourceContent.URL.String()),
fmt.Sprintf("Failed to copy `%s`.", sURLs.SourceContent.URL.String()))
switch sURLs.Error.ToGoError().(type) {
case PathInsufficientPermission:
// Ignore Permission error.
ignoreErr = true
}
if !ignoreErr {
errorIf(sURLs.Error.Trace(sURLs.SourceContent.URL.String()),
fmt.Sprintf("Failed to copy `%s`.", sURLs.SourceContent.URL.String()))
}
}
case sURLs.TargetContent != nil:
// When sURLs.SourceContent is nil, we know that we have an error related to removing