Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT REVIEW]add nodetopology CRD dependency and update vendor #781

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

YifeiZhuang
Copy link

@YifeiZhuang YifeiZhuang commented Nov 12, 2024

Goal: Bring in nodetopology CRD dependency from GoogleCloudPlatform/gke-networking-api#22

Due to transit dependency, we have to upgrade k8s.io/go-client dependency version.

$ go get github.com/GoogleCloudPlatform/gke-networking-api/apis/nodetopology/v1 && ./tools/update_vendor.sh
...
go: k8s.io/cloud-provider-gcp/cmd/cloud-controller-manager imports
	github.com/GoogleCloudPlatform/gke-networking-api/client/network/clientset/versioned imports
	github.com/GoogleCloudPlatform/gke-networking-api/client/network/clientset/versioned/typed/network/v1 imports
	k8s.io/client-go/gentype: no required module provides package k8s.io/client-go/gentype; to add it:
	go get k8s.io/client-go/gentype

$go get k8s.io/client-go/gentype
go: module k8s.io/client-go@upgrade found (v1.5.2, replaced by k8s.io/[email protected]), but does not contain package k8s.io/client-go/gentype

So, manually change go.mod replace k8s.io/client-go v1.31.0

$ go get k8s.io/client-go/gentype
go: downloading k8s.io/client-go v0.31.0
go: upgraded github.com/pmezard/go-difflib v1.0.0 => v1.0.1-0.20181226105442-5d4384ee4fb2
go: upgraded k8s.io/client-go v0.31.1 => v1.5.2

Run $ go get github.com/GoogleCloudPlatform/gke-networking-api/apis/nodetopology/v1 && ./tools/update_vendor.sh again

$  go get github.com/GoogleCloudPlatform/gke-networking-api/apis/nodetopology/v1 && ./tools/update_vendor.sh
+ set -o errexit
+ set -o nounset
+ set -o pipefail
++ pwd -P
+ cd /usr/local/google/home/zivy/cloud-provider-gcp
++ dirname ./tools/update_vendor.sh
+ KUBE_ROOT=./tools/..
+ go mod vendor
go: k8s.io/cloud-provider-gcp/pkg/controller/nodeipam/ipam imports
	k8s.io/client-go/kubernetes/scheme imports
	k8s.io/api/coordination/v1alpha1: no required module provides package k8s.io/api/coordination/v1alpha1; to add it:
	go get k8s.io/api/coordination/v1alpha1
go: k8s.io/cloud-provider-gcp/pkg/controller/nodeipam/ipam imports
	k8s.io/client-go/kubernetes/scheme imports
	k8s.io/api/resource/v1alpha3: no required module provides package k8s.io/api/resource/v1alpha3; to add it:
	go get k8s.io/api/resource/v1alpha3
go: k8s.io/cloud-provider-gcp/cluster/gce/gci tested by
	k8s.io/cloud-provider-gcp/cluster/gce/gci.test imports
	github.com/stretchr/testify/assert imports
	github.com/pmezard/go-difflib/difflib: missing go.sum entry for module providing package github.com/pmezard/go-difflib/difflib (imported by github.com/stretchr/testify/assert); to add:
	go get github.com/stretchr/testify/[email protected]
go: k8s.io/cloud-provider-gcp/pkg/controller/testutil imports
	k8s.io/client-go/kubernetes/fake imports
	k8s.io/client-go/testing imports
	gopkg.in/evanphx/json-patch.v4: missing go.sum entry for module providing package gopkg.in/evanphx/json-patch.v4 (imported by k8s.io/client-go/testing); to add:
	go get k8s.io/client-go/[email protected]

It looks like we need to upgrade k8s.io/api or actually ALL the k8s dependency to 1.31.0. But, let's just start with the ones that is complained.

$ git diff go.mod
diff --git a/go.mod b/go.mod
index 21406078..78a3e21b 100644
--- a/go.mod
+++ b/go.mod
...
@@ -145,12 +146,12 @@ require (

 replace (
        golang.org/x/net => golang.org/x/net v0.17.0
-       k8s.io/api => k8s.io/api v0.30.0
+       k8s.io/api => k8s.io/api v0.31.0
        k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.30.0
        k8s.io/apimachinery => k8s.io/apimachinery v0.30.0
        k8s.io/apiserver => k8s.io/apiserver v0.30.0
        k8s.io/cli-runtime => k8s.io/cli-runtime v0.30.0
-       k8s.io/client-go => k8s.io/client-go v0.30.0
+       k8s.io/client-go => k8s.io/client-go v0.31.0

However, we can't build due to errors:

vendor/k8s.io/api/authorization/v1/types.go:186:24: undefined: metav1.FieldSelectorRequirement
vendor/k8s.io/api/authorization/v1/generated.pb.go:2150:47: undefined: v1.FieldSelectorRequirement
vendor/k8s.io/api/authorization/v1/zz_generated.deepcopy.go:54:24: undefined: metav1.FieldSelectorRequirement
compilepkg: error running subcommand external/go_sdk/pkg/tool/linux_amd64/compile: exit status 2
Target //cmd/cloud-controller-manager:cloud-controller-manager failed to build

clearly, we need to upgrade more k8s.io dependencies. (k8s.io/apimachinery)

Change go.mod again to replace k8s.io/apimachinery v0.31.0 and run update vendor again but see missing dependency again:

$ go get k8s.io/apimachinery
go: downloading k8s.io/apimachinery v0.31.0
$ ./tools/update_vendor.sh
...
go: k8s.io/cloud-provider-gcp/cmd/auth-provider-gcp/provider imports
	k8s.io/apimachinery/pkg/apis/meta/v1 imports
	k8s.io/apimachinery/pkg/runtime/serializer/cbor/direct imports
	k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes imports
	github.com/fxamacker/cbor/v2: missing go.sum entry for module providing package github.com/fxamacker/cbor/v2 (imported by k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes); to add:
	go get k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/[email protected]

so we run go get k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/[email protected] && ./tools/update_vendor.sh, its completed successfully.

Then we build again, and failed with errors:

$ bazel build cmd/cloud-controller-manager
... ...
vendor/github.com/GoogleCloudPlatform/gke-networking-api/client/network/clientset/versioned/typed/network/v1alpha1/gkenetworkparamsetlist.go:44:18: *"k8s.io/cloud-provider-gcp/vendor/github.com/GoogleCloudPlatform/gke-networking-api/apis/network/v1alpha1".GKENetworkParamSetList does not satisfy gentype.objectWithMeta (missing method GetAnnotations)
vendor/github.com/GoogleCloudPlatform/gke-networking-api/client/network/clientset/versioned/typed/network/v1alpha1/gkenetworkparamsetlist.go:50:21: *"k8s.io/cloud-provider-gcp/vendor/github.com/GoogleCloudPlatform/gke-networking-api/apis/network/v1alpha1".GKENetworkParamSetList does not satisfy gentype.objectWithMeta (missing method GetAnnotations)
vendor/github.com/GoogleCloudPlatform/gke-networking-api/client/network/clientset/versioned/typed/network/v1alpha1/networkinterfacelist.go:44:18: *"k8s.io/cloud-provider-gcp/vendor/github.com/GoogleCloudPlatform/gke-networking-api/apis/network/v1alpha1".NetworkInterfaceList does not satisfy gentype.objectWithMeta (missing method GetAnnotations)
vendor/github.com/GoogleCloudPlatform/gke-networking-api/client/network/clientset/versioned/typed/network/v1alpha1/networkinterfacelist.go:50:21: *"k8s.io/cloud-provider-gcp/vendor/github.com/GoogleCloudPlatform/gke-networking-api/apis/network/v1alpha1".NetworkInterfaceList does not satisfy gentype.objectWithMeta (missing method GetAnnotations)
vendor/github.com/GoogleCloudPlatform/gke-networking-api/client/network/clientset/versioned/typed/network/v1alpha1/networklist.go:44:18: *"k8s.io/cloud-provider-gcp/vendor/github.com/GoogleCloudPlatform/gke-networking-api/apis/network/v1alpha1".NetworkList does not satisfy gentype.objectWithMeta (missing method GetAnnotations)
vendor/github.com/GoogleCloudPlatform/gke-networking-api/client/network/clientset/versioned/typed/network/v1alpha1/networklist.go:50:21: *"k8s.io/cloud-provider-gcp/vendor/github.com/GoogleCloudPlatform/gke-networking-api/apis/network/v1alpha1".NetworkList does not satisfy gentype.objectWithMeta (missing method GetAnnotations)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 12, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If the repository mantainers determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Nov 12, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @YifeiZhuang!

It looks like this is your first PR to kubernetes/cloud-provider-gcp 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/cloud-provider-gcp has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 12, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @YifeiZhuang. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot requested a review from cici37 November 12, 2024 19:34
@k8s-ci-robot k8s-ci-robot added the sig/network Categorizes an issue or PR as relevant to SIG Network. label Nov 12, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: YifeiZhuang
Once this PR has been reviewed and has the lgtm label, please assign sergeykanzhelev for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Nov 12, 2024
@YifeiZhuang YifeiZhuang changed the title add nodetopology CRD dependency and update vendor [DO NOT REVIEW]add nodetopology CRD dependency and update vendor Nov 13, 2024
@sawsa307
Copy link

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 14, 2024
@k8s-ci-robot
Copy link
Contributor

@YifeiZhuang: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
cloud-provider-gcp-verify-up-to-date c4c515c link true /test cloud-provider-gcp-verify-up-to-date
cloud-provider-gcp-tests c4c515c link true /test cloud-provider-gcp-tests
cloud-provider-gcp-e2e-full c4c515c link true /test cloud-provider-gcp-e2e-full
pull-cloud-provider-gcp-scenario-kops-simple c4c515c link false /test pull-cloud-provider-gcp-scenario-kops-simple
cloud-provider-gcp-verify-all c4c515c link true /test cloud-provider-gcp-verify-all

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. sig/network Categorizes an issue or PR as relevant to SIG Network. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants