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

Upgrade K8s and Go versions #462

Merged
merged 6 commits into from
Feb 13, 2025
Merged

Conversation

WillardHu
Copy link
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

Update the versions of k8s and golang to keep consistent with the latest version of kubeedge.

Which issue(s) this PR fixes:

Fixes #

@kubeedge-bot kubeedge-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 16, 2025
@kubeedge-bot kubeedge-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jan 16, 2025
@WillardHu WillardHu changed the title Upgrade K8s and Go versions [WIP]Upgrade K8s and Go versions Jan 16, 2025
@kubeedge-bot kubeedge-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 16, 2025
@WillardHu WillardHu force-pushed the upgrade-k8s-and-go branch 14 times, most recently from c378985 to bf1f3de Compare January 17, 2025 02:30
@WillardHu WillardHu changed the title [WIP]Upgrade K8s and Go versions Upgrade K8s and Go versions Jan 17, 2025
@kubeedge-bot kubeedge-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 17, 2025
Signed-off-by: WillardHu <[email protected]>
Signed-off-by: WillardHu <[email protected]>
@WillardHu WillardHu force-pushed the upgrade-k8s-and-go branch 2 times, most recently from a499d11 to 8d8d949 Compare January 17, 2025 02:58
@WillardHu
Copy link
Contributor Author

WillardHu commented Jan 17, 2025

I split the changes into 5 commits for easier review.

  • Upgrade K8s and Go versions - Modified go.mod and go.sum.
  • Update go vendors - Automatically updated contents in the vendor directory after the update-vendor.sh script is executed.
  • Update vendor licenses - Automatically updated contents in the LICENSES directory after the update-vendor-licenses.sh script is executed.
  • Update client generation tools, remove k8s dependency, fix lint issues - Some file modifications caused by updating go and K8s versions (Need to focus on).
  • Solved the vendor check to fail - Solved the problem that git does not recognize uppercase and lowercase letters in file names, causing vendor check to fail.

@tangming1996
Copy link
Collaborator

Could you also help change the version of the controller-gen tool in the Makefile to v0.15.0 to keep it consistent with Kubeedge?

@WillardHu
Copy link
Contributor Author

Could you also help change the version of the controller-gen tool in the Makefile to v0.15.0 to keep it consistent with Kubeedge?

Done

Copy link
Collaborator

Choose a reason for hiding this comment

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

Why was golint removed and revive introduced in the linters?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

golint is no longer supported in golangci-lint


# Check if Sedna home is different from the standard directory where GO projects are located
if ! [[ "${GOPATH}/src/${SEDNA_GO_PACKAGE}/" -ef "${SEDNA_ROOT}/" ]]; then
# Copy generated code into SEDNA_ROOT
Copy link
Collaborator

Choose a reason for hiding this comment

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

Was the following if logic removed because Sedna uses Go modules, thus eliminating the need for GOPATH?

if ! [[ "${GOPATH}/src/${SEDNA_GO_PACKAGE}/" -ef "${SEDNA_ROOT}/" ]]; then
    # Copy generated code into SEDNA_ROOT
    echo "Warning: ${SEDNA_ROOT} not included in $GOPATH which is required by code-gen"
    echo "Moving generated code from ${GOPATH}/src/${SEDNA_GO_PACKAGE}/pkg/ to ${SEDNA_ROOT}/"
    rsync -a ${GOPATH}/src/${SEDNA_GO_PACKAGE}/pkg/{client,apis} ${SEDNA_ROOT}/pkg
    if [ $? -eq 0 ]; then
        echo "Copy successful!"
        rm -rf ${GOPATH}/src/${SEDNA_GO_PACKAGE}/pkg/{client,apis}
    else
        echo "Error during copy of the generated code!" >&2
    fi
fi

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The new versions of client-gen, lister-gen and informer-gen tools can specify the output directory through the --output-dir flag.

@tangming1996
Copy link
Collaborator

Thank you very much for your contribution. After the above issues are resolved, I'll give an "LGTM".

@tangming1996
Copy link
Collaborator

cc @MooreZheng

@tangming1996
Copy link
Collaborator

tangming1996 commented Feb 8, 2025

/lgtm

1 similar comment
@MooreZheng
Copy link
Collaborator

/lgtm

@kubeedge-bot kubeedge-bot added the lgtm Indicates that a PR is ready to be merged. label Feb 13, 2025
@MooreZheng
Copy link
Collaborator

/approve

@kubeedge-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MooreZheng

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

@kubeedge-bot kubeedge-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 13, 2025
@kubeedge-bot kubeedge-bot merged commit b9f4d9d into kubeedge:main Feb 13, 2025
11 checks passed
@WillardHu WillardHu deleted the upgrade-k8s-and-go branch February 27, 2025 07:23
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. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. 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.

4 participants