Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Make vendor semver package #3184

Merged
merged 3 commits into from
Jun 7, 2018

Conversation

CecileRobertMichon
Copy link
Contributor

@CecileRobertMichon CecileRobertMichon commented Jun 6, 2018

What this PR does / why we need it: The Masterminds semver package has a bug when comparing pre-release versions, use github.com/blang/semver instead.

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

Special notes for your reviewer:

If applicable:

  • documentation
  • unit tests
  • tested backward compatibility (ie. deploy with previous version, upgrade with this branch)

Release note:

replace Masterminds/semver by blang/semver

update vendor

replace semver in validate

fix bug in LT and GT functions

fix prelease UT

fix false unit test expectations

remove hardcoded test

fix lint
@codecov
Copy link

codecov bot commented Jun 6, 2018

Codecov Report

Merging #3184 into master will increase coverage by 0.05%.
The diff coverage is 50%.

@@            Coverage Diff             @@
##           master    #3184      +/-   ##
==========================================
+ Coverage   52.31%   52.36%   +0.05%     
==========================================
  Files         103      103              
  Lines       15458    15426      -32     
==========================================
- Hits         8087     8078       -9     
+ Misses       6643     6621      -22     
+ Partials      728      727       -1

pkg/api/types.go Outdated
@@ -859,8 +859,8 @@ func (o *OrchestratorProfile) GetAPIServerEtcdAPIVersion() string {
ret := "etcd3"
Copy link
Member

Choose a reason for hiding this comment

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

Let's change this entire function to:

etcdversion, _ := semver.Make(o.KubernetesConfig.EtcdVersion)
return "etcd" + etcdversion.Major

@@ -149,17 +149,15 @@ func (o *OrchestratorProfile) Validate(isUpdate, HasWindows bool) error {
return err
}
minVersion := "1.7.0"
cons, _ := semver.Make(minVersion)
Copy link
Member

Choose a reason for hiding this comment

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

Change these two lines to:

minVersion, _ := semver.Make("1.7.0")

Copy link
Member

Choose a reason for hiding this comment

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

And then use minVersion below in place of cons

Copy link
Member

Choose a reason for hiding this comment

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

Also return errors when it's practical

@jackfrancis
Copy link
Member

/approve
/lgtm

@acs-bot
Copy link

acs-bot commented Jun 7, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CecileRobertMichon, jackfrancis

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:
  • OWNERS [CecileRobertMichon,jackfrancis]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jackfrancis jackfrancis merged commit 5a52dcc into Azure:master Jun 7, 2018
@ghost ghost removed the in progress label Jun 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants