Skip to content

centralize uuid storage and version checking #1646

@siggy

Description

@siggy

Background

Requests to https://versioncheck.linkerd.io/version.json occur from 3 different call sites, and include a UUID query param retrieved via 3 different methods.

Current state

The version check's query params include version, uuid, and source, for example:
https://versioncheck.linkerd.io/version.json?version=v18.9.1&uuid=foo&source=cli

The canonical source for the uuid value is a command-line argument passed to the web process, generated on linkerd install.

3 call sites and uuid retrievals

  1. cli

    • call site:
      versionCheckURL = "https://versioncheck.linkerd.io/version.json"
    • uuid retrieval: reads web PodSpec from k8s, parses command-line args
  2. web

    • call site:
      let versionUrl = `https://versioncheck.linkerd.io/version.json?version=${this.props.releaseVersion}&uuid=${this.props.uuid}`;
    • uuid retrieval: passed from web command-line to rendered field in web dashboard
  3. grafana

    • call site:
      "content": "<div>\n <div style=\"position: absolute; top: 0, left: 0\">\n <a href=\"https://linkerd.io\" target=\"_blank\"><img src=\"https://linkerd.io/images/identity/svg/linkerd_primary_color_white.svg\" style=\"height: 30px;\"></a>\n </div>\n <div id=\"version\" style=\"position: absolute; top: 0; right: 0; font-size: 15px\">\n </div>\n</div>\n<script type=\"text/javascript\">\nvar localReqURL =\n window.location.href.substring(\n 0,\n window.location.href.indexOf(\n \"/services/grafana:http/proxy/\"\n )\n )+'/services/web:http/proxy/overview';\n\nfetch(localReqURL, {\n credentials: 'include',\n headers: {\n \"Content-Type\": \"text/html; charset=utf-8\",\n },\n})\n.then(response => response.text())\n.then(text => (new window.DOMParser()).parseFromString(text, \"text/html\"))\n.then(html => {\n var main = html.getElementById('main');\n var localVersion = main.getAttribute(\"data-release-version\");\n var uuid = main.getAttribute(\"data-uuid\");\n\n var versionElem = document.getElementById('version');\n versionElem.innerHTML += 'Running Linkerd ' + localVersion + '.<br>';\n\n fetch('https://versioncheck.linkerd.io/version.json?version='+localVersion+'&uuid='+uuid+'&source=grafana', {\n credentials: 'include',\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n },\n })\n .then(response => response.json())\n .then(json => {\n if (json.version === localVersion) {\n versionElem.innerHTML += 'Linkerd is up to date.';\n } else {\n versionElem.innerHTML += \"A new version (\"+json.version+\") is available. <a href='https://versioncheck.linkerd.io/update' target='_blank'>Update now</a>.\";\n }\n });\n});\n</script>",
    • uuid retrieval: queries and parses web dashboard html

Proposal

  1. Store the UUID in a single canonical location, possibly as an annotation on the control-plane namespace.
  2. Provide an endpoint in the public API to retrieve the control-plane's UUID.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions