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

Update various k8s.io modules to v0.22.0 #263

Closed
wants to merge 8 commits into from

Conversation

sdmodi
Copy link

@sdmodi sdmodi commented Aug 10, 2021

This was done by modifying the version of k8s.io/cloud-provider in go.mod and providers/go.mod to v0.22.0 and running ./tools/update_vendor.sh.

This change pulls in kubernetes/kubernetes#103951 which is required for correct bringup of the nodeipam controller in cloud-controller-manager.

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

Hi @sdmodi. 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 10, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sdmodi
To complete the pull request process, please assign saad-ali after the PR has been reviewed.
You can assign the PR to them by writing /assign @saad-ali in a comment when ready.

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

go.mod Outdated
@@ -80,7 +70,7 @@ replace (
k8s.io/apiserver => k8s.io/apiserver v0.21.0
k8s.io/cli-runtime => k8s.io/cli-runtime v0.21.0
k8s.io/client-go => k8s.io/client-go v0.21.0
k8s.io/cloud-provider => k8s.io/cloud-provider v0.21.0
k8s.io/cloud-provider => k8s.io/cloud-provider v0.22.0
k8s.io/cloud-provider-gcp/providers => ./providers
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.21.0
k8s.io/code-generator => k8s.io/code-generator v0.21.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the k8s v0.21.0 modules should be upgraded to v0.22.0 at the same time.

go.mod Outdated
k8s.io/klog/v2 v2.8.0
k8s.io/component-base v0.22.0
k8s.io/controller-manager v0.22.0
k8s.io/klog/v2 v2.9.0
k8s.io/kubelet v0.21.0
k8s.io/kubernetes v1.21.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the k8s v0.21.0 modules should be upgraded to v0.22.0 at the same time.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I update k8s.io/kubernetes v1.21.0 to v1.22.0, I see this:

go: k8s.io/kubernetes@v1.22.0 requires
k8s.io/pod-security-admission@v0.0.0: reading k8s.io/pod-security-admission/go.mod at revision v0.0.0: unknown revision v0.0.0

How should I resolve this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you should add k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.22.0 in the replace section.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this: openshift#2 It seems working.

@sdmodi
Copy link
Author

sdmodi commented Aug 11, 2021

I made progress on this and I am unable to commit the changes. Here is the message I see:

sdmodi@sdmodi-glaptop:~/go/src/cloud-provider-gcp$ git commit -a
vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp.go:79://       "access-token": "ya29.CjWdA4GiBPTt",

[ERROR] Matched one or more prohibited patterns

Possible mitigations:
- Mark false positives as allowed using: git config --add secrets.allowed ...
- Mark false positives as allowed by adding regular expressions to .gitallowed at repository's root directory
- List your configured patterns: git config --get-all secrets.patterns
- List your configured allowed patterns: git config --get-all secrets.allowed
- List your configured allowed patterns in .gitallowed at repository's root directory
- Use --no-verify if this is a one-time false positive

This looks like a false positive because the git config for allowed secrets is this:

sdmodi@sdmodi-glaptop:~/go/src/cloud-provider-gcp$ git config --get-all secrets.patterns
(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}
("|')?(AWS|aws|Aws)?_?(SECRET|secret|Secret)?_?(ACCESS|access|Access)?_?(KEY|key|Key)("|')?\s*(:|=>|=)\s*("|')?[A-Za-z0-9/\+=]{40}("|')?
("|')?(AWS|aws|Aws)?_?(ACCOUNT|account|Account)_?(ID|id|Id)?("|')?\s*(:|=>|=)\s*("|')?[0-9]{4}\-?[0-9]{4}\-?[0-9]{4}("|')?
AIza[0-9A-Za-z_-]{35}
[0-9]+-[0-9A-Za-z_]{32}\.apps\.googleusercontent\.com
(^|[^0-9A-Za-z/+])1/[0-9A-Za-z_-]{43}
(^|[^0-9A-Za-z/+])1/[0-9A-Za-z_-]{64}
ya29\.[0-9A-Za-z_-]+

The last pattern should have allowed the access token. I committed the code using 'git commit -a --no-verify'

@sdmodi sdmodi changed the title Update k8s.io/cloud-provider to v0.22.0 Update various k8s.io modules to v0.22.0 Aug 11, 2021
@sdmodi
Copy link
Author

sdmodi commented Aug 11, 2021

Joe/Minhan, would you please review this. I think it also requires the ok-to-test label. Thanks!

@cici37
Copy link
Contributor

cici37 commented Aug 11, 2021

/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 Aug 11, 2021
@cici37
Copy link
Contributor

cici37 commented Aug 11, 2021

@sdmodi Here is the documentation for bumping version with latest k/k release: #236 ^^

@freehan
Copy link
Contributor

freehan commented Aug 12, 2021

I would recommend breaking this into 2 commits. One with the go mod changes. The other one with auto generated changes.

@sdmodi
Copy link
Author

sdmodi commented Aug 12, 2021

Split this up into 2 commits.

@sdmodi
Copy link
Author

sdmodi commented Aug 12, 2021

Looks like the build is failing for the following reason:

/root/.cache/bazel/_bazel_prow/64d8524508afe27b4f354a7f46b8c0c3/sandbox/linux-sandbox/545/execroot/io_k8s_cloud_provider_gcp/vendor/go.opentelemetry.io/proto/otlp/collector/metrics/v1/metrics_service_grpc.pb.go:14:11: undefined: grpc.SupportPackageIsVersion7
/root/.cache/bazel/_bazel_prow/64d8524508afe27b4f354a7f46b8c0c3/sandbox/linux-sandbox/545/execroot/io_k8s_cloud_provider_gcp/vendor/go.opentelemetry.io/proto/otlp/collector/metrics/v1/metrics_service_grpc.pb.go:68:37: undefined: grpc.ServiceRegistrar

@sdmodi
Copy link
Author

sdmodi commented Aug 13, 2021

I updated google.golang.org/grpc to v1.32.0 and that got rid of the original error. Now I am seeing a new one:

/workspace/.bazel/sandbox/processwrapper-sandbox/1228/execroot/io_k8s_cloud_provider_gcp/cmd/gke-exec-auth-plugin/request.go:139:48: not enough arguments in call to csr.RequestCertificate
	have (kubernetes.Interface, []byte, string, string, []"k8s.io/cloud-provider-gcp/vendor/k8s.io/api/certificates/v1".KeyUsage, interface {})
	want (kubernetes.Interface, []byte, string, string, *time.Duration, []"k8s.io/cloud-provider-gcp/vendor/k8s.io/api/certificates/v1".KeyUsage, interface {})

@sdmodi
Copy link
Author

sdmodi commented Aug 13, 2021

This is another error for the e2e-full tests:

/root/.cache/bazel/_bazel_prow/64d8524508afe27b4f354a7f46b8c0c3/sandbox/linux-sandbox/591/execroot/io_k8s_cloud_provider_gcp/vendor/go.etcd.io/etcd/client/v3/logger.go:36:40: cannot use zapgrpc.NewLogger(lg) (type *zapgrpc.Logger) as type "k8s.io/cloud-provider-gcp/vendor/google.golang.org/grpc/grpclog".LoggerV2 in argument to "k8s.io/cloud-provider-gcp/vendor/google.golang.org/grpc/grpclog".SetLoggerV2:
	*zapgrpc.Logger does not implement "k8s.io/cloud-provider-gcp/vendor/google.golang.org/grpc/grpclog".LoggerV2 (missing Error method)

@liggitt
Copy link
Member

liggitt commented Aug 13, 2021

/workspace/.bazel/sandbox/processwrapper-sandbox/1228/execroot/io_k8s_cloud_provider_gcp/cmd/gke-exec-auth-plugin/request.go:139:48: not enough arguments in call to csr.RequestCertificate
	have (kubernetes.Interface, []byte, string, string, []"k8s.io/cloud-provider-gcp/vendor/k8s.io/api/certificates/v1".KeyUsage, interface {})
	want (kubernetes.Interface, []byte, string, string, *time.Duration, []"k8s.io/cloud-provider-gcp/vendor/k8s.io/api/certificates/v1".KeyUsage, interface {})

you can pass nil for the new arg

@liggitt
Copy link
Member

liggitt commented Aug 13, 2021

it seems likely you'll need to bump to a version newer than 0.22.0 to pick up a compatible version of k8s.io/legacy-cloud-providers that can work with the updated google api library

@k8s-ci-robot
Copy link
Contributor

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

Test name Commit Details Rerun command
cloud-provider-gcp-e2e-full 7d25eba link /test cloud-provider-gcp-e2e-full
cloud-provider-gcp-tests 7d25eba link /test cloud-provider-gcp-tests

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/test-infra repository. I understand the commands that are listed here.

@sdmodi
Copy link
Author

sdmodi commented Aug 13, 2021

Updating legacy-cloud-providers runs into another problem:

/workspace/.bazel/sandbox/processwrapper-sandbox/769/execroot/io_k8s_cloud_provider_gcp/vendor/github.com/GoogleCloudPlatform/k8s-cloud-provider/pkg/cloud/meta/meta.go:602:32: undefined: "k8s.io/cloud-provider-gcp/vendor/google.golang.org/api/compute/v0.beta".ServiceAttachmentsService

What is our usual process for updating k8s.io modules? Is it common to keep running into these issues? Are there a set of modules that we always update in one go.

@cici37
Copy link
Contributor

cici37 commented Aug 13, 2021

/workspace/.bazel/sandbox/processwrapper-sandbox/769/execroot/io_k8s_cloud_provider_gcp/vendor/github.com/GoogleCloudPlatform/k8s-cloud-provider/pkg/cloud/meta/meta.go:602:32: undefined: "k8s.io/cloud-provider-gcp/vendor/google.golang.org/api/compute/v0.beta".ServiceAttachmentsService

It could be cause by inconsistent of dependency version. k/k is using google.golang.org/api v0.46.0 here while cloud-provider-gcp is with v0.30.0. I believe it could be solved by version update.

@sdmodi
Copy link
Author

sdmodi commented Aug 18, 2021

I have combined this patch with #262 as both need to be updated at the same time for tests to pass.

@sdmodi sdmodi closed this Aug 18, 2021
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

None yet

7 participants