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

improved Go version check #445

Merged

Conversation

droot
Copy link
Contributor

@droot droot commented Oct 15, 2018

Highlights:

  • Go version doesn't follow semver style from syntax perspective, so
    use semver pkg wasn't helpful
  • re-implemented go version check without using the semver pkg.

fixes #412 #439

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 15, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: droot

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 Oct 15, 2018
@droot droot force-pushed the bugfix/go-version-check-fix branch from 80bf75f to 37c064d Compare October 15, 2018 22:35
return fmt.Errorf("invalid version string")
}

major, err := strconv.ParseInt(m[1], 10, 64)
Copy link
Member

Choose a reason for hiding this comment

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

nit: I guess using strcov.Atoi is OK and easier to understand.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

{"go1.10", false},
{"go1.10rc", false},
{"go1.10.1", false},
{"go1.11rc2", false},
Copy link
Member

Choose a reason for hiding this comment

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

This seems to be a valid RC version, right?

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 flag is inverted :)

@droot droot force-pushed the bugfix/go-version-check-fix branch from 37c064d to b4bc772 Compare October 16, 2018 20:33
Highlights:
 - Go version doesn't follow semver style from syntax perspective, so
 use semver pkg wasn't helpful
 - re-implemented go version check without using the semver pkg.
@droot droot force-pushed the bugfix/go-version-check-fix branch from b4bc772 to 7b138f1 Compare October 16, 2018 20:38
@droot
Copy link
Contributor Author

droot commented Oct 16, 2018

@mengqiy PTAL.

Copy link
Member

@mengqiy mengqiy left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 16, 2018
@k8s-ci-robot k8s-ci-robot merged commit f15ca68 into kubernetes-sigs:master Oct 16, 2018
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't run kubebuilder init with a non-official go release
3 participants