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

Fix go1.19 linting errors #3623

Merged

Conversation

tobiasgiese
Copy link
Member

@tobiasgiese tobiasgiese commented Jul 27, 2022

What type of PR is this?

What this PR does / why we need it:

With kubernetes/test-infra#26920 our test image has been changed to go1.19-rc2. Therefore, we have to fix some linters and deprecations to make the linter happy again (analogues to kubernetes/kubernetes#111254).

Failed test as example: https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api-provider-aws/3609/pull-cluster-api-provider-aws-test/1552246150055071744

Regarding the ioutil deprecation, please see go-critic/go-critic#1019

❯ docker run -ti --entrypoint bash gcr.io/k8s-staging-test-infra/kubekins-e2e:v20220726-61b7bafca6-master
[...]
root@a4f4d8285e82:/workspace# go version
go version go1.19rc2 linux/amd64

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Replaced all boilderplates with

grep -rl 'http://www.apache.org/licenses/LICENSE-2.0' | grep -E '\.go$' | while read file; do
  sed -ri 's#^    (http://www.apache.org/licenses/LICENSE-2.0)#\t\1#' $file
done

Checklist:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

Tobias Giese tobias.giese@mercedes-benz.com, Mercedes-Benz Tech Innovation GmbH, legal info/Impressum

Signed-off-by: Tobias Giese <tobias.giese@mercedes-benz.com>
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jul 27, 2022
@k8s-ci-robot
Copy link
Contributor

@tobiasgiese: This issue is currently awaiting triage.

If CAPA/CAPI contributors determines 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jul 27, 2022
@sedefsavas
Copy link
Contributor

I see that even the generated files needed to change, let's see if make verify will pass.

@tobiasgiese
Copy link
Member Author

I see that even the generated files needed to change, let's see if make verify will pass.

You are right, I have to replace the hack/boilerplate/boilerplate.go.txt as well! Good catch 🙂

@tobiasgiese
Copy link
Member Author

/kind bug

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 27, 2022
@tobiasgiese tobiasgiese force-pushed the tobiasgiese/fix-go119-tests branch 2 times, most recently from 556d3e3 to 8ac7c1d Compare July 27, 2022 13:32
Signed-off-by: Tobias Giese <tobias.giese@mercedes-benz.com>
@richardcase
Copy link
Member

Why are we changing all the licence headers as part of this?

@richardcase
Copy link
Member

Why are we changing all the licence headers as part of this?

I should've read the slack thread, doh.

@richardcase
Copy link
Member

Thanks @tobiasgiese, I wish we'd followed the gofmt formatting rules earlier 🤣

From my side:

/lgtm

For approval:

/assign sedefsavas

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 27, 2022
@sedefsavas
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sedefsavas

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

The pull request process is described 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 27, 2022
@k8s-ci-robot k8s-ci-robot merged commit 3b32ca0 into kubernetes-sigs:main Jul 27, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.x milestone Jul 27, 2022
@tobiasgiese tobiasgiese deleted the tobiasgiese/fix-go119-tests branch July 27, 2022 15:03
@sedefsavas
Copy link
Contributor

/cherry-pick release-1.5

@k8s-infra-cherrypick-robot

@sedefsavas: #3623 failed to apply on top of branch "release-1.5":

Applying: Remove deprecated ioutil and use io instead
Applying: Make boilderplate go1.19 ready
Using index info to reconstruct a base tree...
M	bootstrap/eks/controllers/eksconfig_controller_reconciler_test.go
M	cmd/clusterawsadm/cloudformation/bootstrap/csi.go
M	cmd/clusterawsadm/cloudformation/bootstrap/template_test.go
M	controlplane/eks/api/v1alpha3/conversion.go
M	controlplane/eks/api/v1alpha3/zz_generated.conversion.go
M	controlplane/eks/api/v1alpha4/conversion.go
M	controlplane/eks/api/v1alpha4/zz_generated.conversion.go
M	controlplane/eks/api/v1beta1/awsmanagedcontrolplane_types.go
M	controlplane/eks/api/v1beta1/zz_generated.deepcopy.go
M	controlplane/eks/controllers/awsmanagedcontrolplane_controller.go
M	exp/api/v1beta1/awsmanagedmachinepool_webhook.go
M	pkg/cloud/scope/awsnode.go
M	pkg/cloud/scope/managedcontrolplane.go
M	pkg/cloud/services/awsnode/cni.go
M	pkg/cloud/services/network/subnets.go
M	pkg/cloud/services/network/subnets_test.go
M	test/e2e/suites/conformance/conformance_test.go
A	test/e2e/suites/managed/aws_node_env.go
M	test/e2e/suites/managed/eks_test.go
M	test/e2e/suites/managed/helpers.go
M	test/e2e/suites/managed/machine_pool.go
Falling back to patching base and 3-way merge...
Auto-merging test/e2e/suites/managed/machine_pool.go
Auto-merging test/e2e/suites/managed/helpers.go
Auto-merging test/e2e/suites/managed/eks_test.go
CONFLICT (modify/delete): test/e2e/suites/managed/aws_node_env.go deleted in HEAD and modified in Make boilderplate go1.19 ready. Version Make boilderplate go1.19 ready of test/e2e/suites/managed/aws_node_env.go left in tree.
Auto-merging test/e2e/suites/conformance/conformance_test.go
Auto-merging pkg/cloud/services/network/subnets_test.go
Auto-merging pkg/cloud/services/network/subnets.go
Auto-merging pkg/cloud/services/awsnode/cni.go
Auto-merging pkg/cloud/scope/managedcontrolplane.go
Auto-merging pkg/cloud/scope/awsnode.go
Auto-merging exp/api/v1beta1/awsmanagedmachinepool_webhook.go
Auto-merging controlplane/eks/controllers/awsmanagedcontrolplane_controller.go
Auto-merging controlplane/eks/api/v1beta1/zz_generated.deepcopy.go
Auto-merging controlplane/eks/api/v1beta1/awsmanagedcontrolplane_types.go
Auto-merging controlplane/eks/api/v1alpha4/zz_generated.conversion.go
Auto-merging controlplane/eks/api/v1alpha4/conversion.go
Auto-merging controlplane/eks/api/v1alpha3/zz_generated.conversion.go
Auto-merging controlplane/eks/api/v1alpha3/conversion.go
Auto-merging cmd/clusterawsadm/cloudformation/bootstrap/template_test.go
Auto-merging cmd/clusterawsadm/cloudformation/bootstrap/csi.go
Auto-merging bootstrap/eks/controllers/eksconfig_controller_reconciler_test.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0002 Make boilderplate go1.19 ready
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.5

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 added a commit that referenced this pull request Jul 30, 2022
[release-1.5] Manual cherry pick of linter fixes (#3617 and #3623)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. 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

5 participants