Fix repo maintenance command (#4240)

If we continue passing UnknownService then the
command fails when trying to initialize the
graph client. Longer term we should rework the
logic in the helper functions for connecting
to a repo (see #4239)

This issue isn't present in the most recent
release

---

#### Does this PR need a docs update or release note?

- [ ]  Yes, it's included
- [ ] 🕐 Yes, but in a later PR
- [x]  No

#### Type of change

- [ ] 🌻 Feature
- [x] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Supportability/Tests
- [ ] 💻 CI/Deployment
- [ ] 🧹 Tech Debt/Cleanup

#### Issue(s)

* #3217

#### Test Plan

- [x] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E
This commit is contained in:
ashmrtn 2023-09-13 16:15:03 -07:00 committed by GitHub
parent 804131338d
commit f2b0bd7eb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,7 +121,12 @@ func handleMaintenanceCmd(cmd *cobra.Command, args []string) error {
return err
}
r, _, err := utils.AccountConnectAndWriteRepoConfig(ctx, path.UnknownService, S3Overrides(cmd))
r, _, err := utils.AccountConnectAndWriteRepoConfig(
ctx,
// Need to give it a valid service so it won't error out on us even though
// we don't need the graph client.
path.OneDriveService,
S3Overrides(cmd))
if err != nil {
return print.Only(ctx, err)
}