Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time
August 18, 2023 16:47
September 19, 2023 20:29
February 28, 2023 12:15
September 7, 2023 09:18
September 2, 2022 16:16
December 23, 2022 16:55
September 7, 2023 09:18
March 16, 2023 08:14
July 19, 2018 10:55
September 8, 2023 17:13


Publishing gcp-controller-manager image

This command will build and publish

bazel run //cmd/gcp-controller-manager:publish

Environment variables IMAGE_REGISTRY, IMAGE_REPO and IMAGE_TAG can be used to override destination GCR repository and tag.

This command will build and publish IMAGE_REPO=my-repo IMAGE_TAG=v1 bazel run //cmd/gcp-controller-manager:publish


Selecting the target platform is done with the --platforms option with bazel. This command builds release tarballs for Windows:

bazel build --platforms=@io_bazel_rules_go//go/toolchain:windows_amd64 //release:release-tars

This command explicitly targets Linux as the target platform:

bazel build --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //release:release-tars

Dependency management

Dependencies are managed using Go modules (go mod subcommands).

Note that builds are done with Bazel and not the Go tool. Don't follow public Go module docs, instead use instructions in this readme.

Working within GOPATH

If you work within GOPATH, go mod will error out unless you do one of:

  • move repo outside of GOPATH (it should "just work")
  • set env var GO111MODULE=on

Add a new dependency

go get && ./tools/

Update an existing dependency

go get -u && ./tools/

Update all dependencies

go get -u && ./tools/

Note that this most likely won't work due to cross-dependency issues or repos not implementing modules correctly.


Bazel is required to build and release cloud-provider-gcp.

To install:

go get
alias bazel=bazelisk

To re-generate BUILD files: