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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

WillardHu
Copy link

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
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign moorezheng after the PR has been reviewed.
You can assign the PR to them by writing /assign @moorezheng 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

@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
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
Contributor

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
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
Contributor

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
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
Contributor

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
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
Contributor

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

@tangming1996
Copy link
Contributor

cc @MooreZheng

@tangming1996
Copy link
Contributor

tangming1996 commented Feb 8, 2025

/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. 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