Skip to content

Dependency FAQ

Eric Van Norman edited this page Jan 13, 2020 · 2 revisions

How do I update a dependency?

Istio uses Go modules to manage its dependencies. After enabling modules, use the standard go tooling to import or update a dependency (e.g. go get dependency@version).

Before you commit, make sure to update the module files: go mod tidy or make format

Here is an example for updating istio.io/api to the latest:

go get istio.io/api@latest
go mod tidy

Inter Istio repository dependencies

Using Go Modules

Some Istio repositories use Go module support to specify the dependent Istio repository. In this case, the steps in the earlier section can be used to update the dependency.

Example: istio/istio go.mod has the following snippet:

	istio.io/api v0.0.0-20200110220949-660e8ea29996
	istio.io/gogo-genproto v0.0.0-20191024203824-d079cc8b1d55
	istio.io/pkg v0.0.0-20191113122952-4f521de9c8ca

Using references in files

Some Istio repositories use files to point to particular SHA of another repository. In this case, one updates the reference in the file. istio/istio has a script, bin/update_deps.sh, which can be used to update all the dependencies (and in this case, also the common-files) with one command.

The following examples show how istio/istio references proxy which then references the Envoy proxy. Example 1: istio/istio istio.deps contains references to proxy and cni:

  {
    "_comment": "",
    "name": "PROXY_REPO_SHA",
    "repoName": "proxy",
    "file": "",
    "lastStableSHA": "a79985709efab24063beeb19bc17d0271daba967"
  },
  {
    "_comment": "",
    "name": "CNI_REPO_SHA",
    "repoName": "cni",
    "file": "",
    "lastStableSHA": "7116840b8a155cc41bb11dd77096f64587c0c773"
  }

Example 2: istio/proxy WORKSPACE contains a point to the Envoy proxy

ENVOY_SHA = "456bf9aef22d7b4df4916fa49c5dad2f5dbf0f0f"

ENVOY_SHA256 = "e26750cabcd5d55d4c91a08f63328bdfcacb47eb87ae3c807152b7345a0faf65"

# To override with local envoy, just pass `--override_repository=envoy=/PATH/TO/ENVOY` to Bazel or
# persist the option in `user.bazelrc`.
http_archive(
    name = "envoy",
    sha256 = ENVOY_SHA256,
    strip_prefix = "envoy-wasm-" + ENVOY_SHA,
    url = "https://github.com/envoyproxy/envoy-wasm/archive/" + ENVOY_SHA + ".tar.gz",
)

Dev Environment

Writing Code

Pull Requests

Testing

Performance

Releases

Misc

Central Istiod

Security

Mixer

Pilot

Telemetry

Clone this wiki locally