Skip to content

🐘 Untangle genproto / cloud.google.com/go dependencies #113366

@liggitt

Description

@liggitt

#113225 uncovered a coming snarl of dependencies between cloud.google.com/go and google.golang.org/genproto

Because several generic libraries use the cloud.google.com/go/compute/metadata package, the following chain makes it almost impossible to avoid adding all cloud.google.com/go submodules into the dependency graph for all downstream consumers:

  • {golang.org/x/oauth2, google.golang.org/api, google.golang.org/grpc} --> cloud.google.com/go/compute --> cloud.google.com/go --> google.golang.org/genproto --> cloud.google.com/go/*

It's possible we can avoid the updates that expanded these cross-references in the short-term with judicious upstream changes back to older genproto versions, but we should get ahead of this if we want to avoid being forced to pull in these dependency graph increases in the future for a critical bugfix.

Recommendations

1. Isolate cloud.google.com/go/compute/metadata

The cloud.google.com/go/compute/metadata package (https://github.com/googleapis/google-cloud-go/tree/main/compute/metadata) only uses stdlib dependencies, but lives inside cloud.google.com/go/compute, which has many other references (https://github.com/googleapis/google-cloud-go/blob/main/compute/go.mod)

  1. Isolate cloud.google.com/go/compute/metadata to its own zero-dependency module

  2. Sweep dependencies using cloud.google.com/go/compute/metadata and update them to use the zero-dependency alternative

2. Prune use of cloud genproto packages in non-cloud.google.com modules

  1. Update github.com/googleapis/gax-go/v2 test to not require the google.golang.org/genproto/googleapis/cloud/location package

3. Isolate generic genproto packages

4. Drop use of google.golang.org/genproto/protobuf/field_mask

Update to use canonical google.golang.org/protobuf/types/known/fieldmaskpb package instead

/priority important-longterm
/area code-organization
/sig architecture
/cc @dims
fyi @codyoss @bertinatto

Metadata

Metadata

Assignees

Labels

area/code-organizationIssues or PRs related to kubernetes code organizationlifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.priority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete.sig/architectureCategorizes an issue or PR as relevant to SIG Architecture.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions