Skip to content

Commit

Permalink
Documentation - Update Go dependency management doc
Browse files Browse the repository at this point in the history
Update documentation to remove instructions to run make vendor.
This script was previously required when the ARO installer was vendored, as well as other OCP 4.x dependencies.
  • Loading branch information
s-fairchild committed Dec 11, 2023
1 parent aad0e2d commit e206e32
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions docs/updating-dependencies.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Updating dependencies

- Go Documentation for [Managing dependencies](https://go.dev/doc/modules/managing-dependencies)
- [Go Module Awareness](https://go.dev/blog/go116-module-changes)

To update golang dependencies one has to choose between two options:

1) update the whole dependency tree
Expand All @@ -9,37 +12,23 @@ To update golang dependencies one has to choose between two options:
## Update the whole dependency tree

Done when the need to catch upstream dependencies arises, it can be done by
calling

```bash
make vendor
```

in root folder, which calls `hack/update-go-module-dependencies.sh`.

The reason for calling script instead of directly calling:
calling:

```bash
# Ensure go module-aware mode is set to auto
export GO111MODULE=auto
go get -u ./...
go mod tidy -compat=1.18
go mod vendor
```

is that packages modified in this script do not fully support modules and
semantic versioning via tags. Therefore the proper version is parsed from the version
branch and fixed using replace directive. Otherwise it will upgrade every time
the command is started.

When upgrading to a newer version of OpenShift, this script have to be updated to
reflect the proper release.


## Update only required dependencies

When adding new dependencies or updating old ones, based on the requirement of
the PR, one can simply call
the PR, one can simply call:

```bash
export GO111MODULE=auto
go get <module>@<release> OR
go get -u <module>@<release>

Expand Down

0 comments on commit e206e32

Please sign in to comment.