openshift / openshift/oadp-operator
Improve DPA reconcile error messages
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 92
- Forks
- 93
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 43
Description
Problem
It is difficult for users (and developers) to debug OADP errors without more context (studying DPA, for example).
Example
Some months ago, a new user was not able to set custom credential name to BSL (managed by DPA), as DPA would reconcile false with the generic error
Secret "cloud-credentials" not found
After some hours, OADP team asked for user DPA, and the problem was found. There was also VSL defined in DPA (probably copy/paste from example DPA)
This problem could have been resolved immediately if the error message was more informative. Example
VolumeSnapshotLocation <VSL-name> defined in DPA spec.snapshotLocations[<index>] is invalid:
create Secret "cloud-credentials" in namespace <namespace-name> or change Secret name in DPA spec.snapshotLocations[<index>].velero.credential.name
Solution
Solution would be to rewrite OADP error messages to be more informative.
A first approach suggestion is to check error messages in tests that are already written, BUT do NOT check error messages.
Example
This test
only checks if error occurred, without testing the error message.
This is very WRONG. Some of these tests are broken, because their error messages do not relate to what is being tested. But they are are not failing in CI, as we check only if an error occurred, and not what error occurred.
Maybe this command can help found other tests like this
grep -Iinr 'wantErr:' . --include=\*_test.go
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with controllers/bsl_test.go and use the suggested grep command to find tests that only check whether an error occurred. Review the DPA example in config/samples/oadp_v1alpha1_dpa.yaml for the credential and snapshot-location context. Done means reconciliation errors identify the relevant DPA location, secret, namespace, or field, with tests checking the resulting messages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100