namerctl 0.8.6 dtab update behavior differs when updating using json vs yaml format
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 30
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
Intro
- when you update a dtab it gets assigned with a new version value.
- namerctl doesn't check the version value included in a yaml dtab file, while it does provided it is json format.
- when you update a dtab using a mismatched version (json), the error received client side is not that clear
Prerequisites
- linkerd + namerd + namerctl
- create some dtab named internal
Repro steps
- download a dtab in yaml format:
namerctl dtab get internal > internal.yaml - update the dtab using the yaml downloaded in step 1:
namerctl dtab update internal internal.yaml - update the dtab twice:
namerctl dtab update internal internal.yaml
Note: please note that you should have been able update it successfully - download a dtab in json format:
namerctl dtab get internal --json > internal.json - update the dtab using the json downloaded in step 4:
namerctl dtab update internal internal.json - update the dtab twice:
namerctl dtab update internal internal.json
Expected
It could either work like in step 3 for yaml format or at least both could behave in the very same way
Actual
Error: unexpected response: 412 Precondition Failed
Workaround
- download the json file again so you get the updated version value.
- as @rmars mentioned, you could just remove the version value from your json and it should behave similarly to yaml case.
Warning
I couldn't realize when/why. But at some point you might need to restart namerd to get the latest version. It looks like it get cached or similar.
Contributor guide
No contributing guide indexed for this repository
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 by reproducing the documented namerctl dtab get and dtab update commands with both YAML and JSON files, using the stated Linkerd, namerd, and namerctl prerequisites. Compare how each format handles the version value and the 412 response. Done means both formats behave consistently and the mismatched-version error is clearer.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100