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 to Kubernetes 1.27 #1909

Merged
merged 7 commits into from
Jun 14, 2023
Merged

Conversation

laverya
Copy link
Contributor

@laverya laverya commented Apr 28, 2023

What this PR does / why we need it:
Kubernetes 1.27 added aggregated discovery logic, and we have experienced issues calling 1.27 apiservers with sonobouy built with 1.26 libraries.

Which issue(s) this PR fixes

  • Fixes #

Special notes for your reviewer:

Release note:

Use Kubernetes 1.27 libraries

Signed-off-by: Andrew Lavery <laverya@umich.edu>
@franknstyle
Copy link
Collaborator

Hi @laverya. Are you able to raise an issue with detail of symptoms experienced in your tooling that led to the decision to update to the 1.27 API and update this pull request to reference.

@laverya
Copy link
Contributor Author

laverya commented May 1, 2023

This was the issue that prompted the PR: #1910

I also see a lint error, but I don't know what the actual error message is - it's not included in the logs I can see. I'll try running locally.

EDIT: running locally doesn't seem to be working - I get OOM errors/sigkill from golangci-lint, which seems wrong

@laverya
Copy link
Contributor Author

laverya commented May 1, 2023

The lint error also appears to be occurring in main 😢

@franknstyle
Copy link
Collaborator

franknstyle commented May 2, 2023

Hi @laverya

run golangci-lint Running [/home/runner/golangci-lint-1.52.2-linux-amd64/golangci-lint run --out-format=github-actions --timeout=5m0s -v] in [] ... Error: SA1019: wait.Poll is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck) Error: SA1019: wait.Poll is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)

I've bumped some linting versions and increased the timeout and found the above. Are you able to update the referenced deprecated Polls to something like https://pkg.go.dev/k8s.io/apimachinery/pkg/util/wait#PollUntilContextTimeout

Additionally, for posterity. Are you able to please add the commands and golang binary version used to update the go.* files in this pull request.

Best Regards,

Signed-off-by: Andrew Lavery <laverya@umich.edu>
@laverya
Copy link
Contributor Author

laverya commented May 2, 2023

I've updated the polls - second time I've run into this bad linter message 😅

Additionally, for posterity. Are you able to please add the commands and golang binary version used to update the go.* files in this pull request.

My go version was:

go version go1.20.3 darwin/amd64

I believe I ran go get k8s.io/api + go get k8s.io/apimachinery + go get k8s.io/client-go and then go mod tidy to update the dependencies.

Signed-off-by: Andrew Lavery <laverya@umich.edu>
@laverya
Copy link
Contributor Author

laverya commented May 9, 2023

@franknstyle could this be approved to run unit tests again?

@laverya
Copy link
Contributor Author

laverya commented May 9, 2023

--- FAIL: TestQuickLegacyFix (16.43s)

damn

@laverya
Copy link
Contributor Author

laverya commented May 9, 2023

I really have no context to this test failure, and I don't know how to debug it

@emosbaugh
Copy link

I see context deadline exceeded errors that happen very quickly.

2023-05-09T16:37:55.0943021Z === CONT  TestQuickLegacyFix
2023-05-09T16:37:55.0944315Z     sonobuoy_integration_test.go:116: Running "../../build/linux/amd64/sonobuoy version --short" with env: [SONOBUOY_ALL_FEATURES=true KUBECONFIG=/root/.kube/kubeconfig HOME=/tmp/sonobuoy_int_test_home_757898220]
2023-05-09T16:37:55.1362387Z     sonobuoy_integration_test.go:83: Running "../../kubectl apply -f /tmp/3068083558" with env: [SONOBUOY_ALL_FEATURES=true KUBECONFIG=/root/.kube/kubeconfig HOME=/tmp/sonobuoy_int_test_home_757898220]
2023-05-09T16:37:55.1701437Z === CONT  TestUseNamespaceFromManifest
2023-05-09T16:37:55.1705711Z     sonobuoy_integration_test.go:116: Running "../../build/linux/amd64/sonobuoy run --wait -f /tmp/gen.209536661.yaml" with env: [SONOBUOY_ALL_FEATURES=true KUBECONFIG=/root/.kube/kubeconfig HOME=/tmp/sonobuoy_int_test_home_757898220]
2023-05-09T16:37:55.7873300Z === CONT  TestQuickLegacyFix
2023-05-09T16:37:55.7874518Z     sonobuoy_integration_test.go:116: Running "../../build/linux/amd64/sonobuoy wait -n sonobuoy-testquicklegacyfix" with env: [SONOBUOY_ALL_FEATURES=true KUBECONFIG=/root/.kube/kubeconfig HOME=/tmp/sonobuoy_int_test_home_757898220]
2023-05-09T16:37:55.8725949Z     sonobuoy_integration_test.go:118: Expected "wait -n sonobuoy-testquicklegacyfix" to not error but got error: "exit status 1" with stdout: "" and stderr: "time=\"2023-05-09T16:37:55Z\" level=error msg=\"error attempting to run sonobuoy: waiting for run to finish: context deadline exceeded\"\n"
2023-05-09T16:37:55.8727248Z     sonobuoy_integration_test.go:83: Running "../../build/linux/amd64/sonobuoy logs -n sonobuoy-testquicklegacyfix" with env: [SONOBUOY_ALL_FEATURES=true KUBECONFIG=/root/.kube/kubeconfig HOME=/tmp/sonobuoy_int_test_home_757898220]
2023-05-09T16:37:55.9726733Z     sonobuoy_integration_test.go:123: Tried to get logs to help debug this problem but got another error: exit status 1
2023-05-09T16:37:55.9728070Z     sonobuoy_integration_test.go:83: Running "../../build/linux/amd64/sonobuoy delete -n sonobuoy-testquicklegacyfix --wait" with env: [SONOBUOY_ALL_FEATURES=true KUBECONFIG=/root/.kube/kubeconfig HOME=/tmp/sonobuoy_int_test_home_757898220]
2023-05-09T16:38:11.1438838Z     sonobuoy_integration_test.go:83: Running "../../kubectl get clusterroles sonobuoy-serviceaccount-sonobuoy-testquicklegacyfix -o yaml" with env: [SONOBUOY_ALL_FEATURES=true KUBECONFIG=/root/.kube/kubeconfig HOME=/tmp/sonobuoy_int_test_home_757898220]
2023-05-09T16:38:11.2930463Z     sonobuoy_integration_test.go:83: Running "../../kubectl get namespace sonobuoy-testquicklegacyfix -o yaml" with env: [SONOBUOY_ALL_FEATURES=true KUBECONFIG=/root/.kube/kubeconfig HOME=/tmp/sonobuoy_int_test_home_757898220]
2023-05-09T16:38:11.4239653Z     sonobuoy_integration_test.go:83: Running "../../kubectl get clusterrolebinding sonobuoy-serviceaccount-sonobuoy-testquicklegacyfix -o yaml" with env: [SONOBUOY_ALL_FEATURES=true KUBECONFIG=/root/.kube/kubeconfig HOME=/tmp/sonobuoy_int_test_home_757898220]
2023-05-09T16:38:11.5190116Z --- FAIL: TestQuickLegacyFix (16.43s)

Unfortunately I do not know what I am looking for in the test archives. The only mention of this test that i see are as follows:

E0509 16:38:01.440245       1 tokens_controller.go:262] error synchronizing serviceaccount sonobuoy-testquicklegacyfix/default: secrets "default-token-6vx6g" is forbidden: unable to create new content in namespace sonobuoy-testquicklegacyfix because it is being terminated
E0509 16:38:01.451069       1 tokens_controller.go:262] error synchronizing serviceaccount sonobuoy-testquicklegacyfix/sonobuoy-serviceaccount: secrets "sonobuoy-serviceaccount-token-rxjp8" is forbidden: unable to create new content in namespace sonobuoy-testquicklegacyfix because it is being terminated
I0509 16:38:11.612587       1 namespace_controller.go:185] Namespace has been deleted sonobuoy-testquicklegacyfix

Copy link

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

I think we need a help with : CI Test / integration-test-on-kind (pull_request)

@franknstyle franknstyle merged commit 681df08 into vmware-tanzu:main Jun 14, 2023
@franknstyle
Copy link
Collaborator

Thank you @laverya. I've tidied up these tests and updated kind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants