linkerd / linkerd/namerctl

namerctl 0.8.6 dtab update behavior differs when updating using json vs yaml format

Open
#21 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
30
Forks
9
PR merge metrics
No merged PRs in 30d

Description

Intro

  1. when you update a dtab it gets assigned with a new version value.
  2. namerctl doesn't check the version value included in a yaml dtab file, while it does provided it is json format.
  3. when you update a dtab using a mismatched version (json), the error received client side is not that clear

Prerequisites

  1. linkerd + namerd + namerctl
  2. create some dtab named internal

Repro steps

  1. download a dtab in yaml format: namerctl dtab get internal > internal.yaml
  2. update the dtab using the yaml downloaded in step 1: namerctl dtab update internal internal.yaml
  3. update the dtab twice: namerctl dtab update internal internal.yaml
    Note: please note that you should have been able update it successfully
  4. download a dtab in json format: namerctl dtab get internal --json > internal.json
  5. update the dtab using the json downloaded in step 4: namerctl dtab update internal internal.json
  6. 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

  1. download the json file again so you get the updated version value.
  2. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.