-
Notifications
You must be signed in to change notification settings - Fork 558
normalizeazureregion added in scale, upgrade, and deploy #2764
Conversation
cmd/deploy.go
Outdated
@@ -83,6 +84,11 @@ func newDeployCmd() *cobra.Command { | |||
return deployCmd | |||
} | |||
|
|||
// NormalizeAzureRegion returns a normalized Azure region with whilte spaces removed and converted to lower case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo in the comment whilte
--> white
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could add this function to https://github.com/Azure/acs-engine/blob/master/pkg/helpers/helpers.go and re-use it here and in pkg/api
Codecov Report
@@ Coverage Diff @@
## master #2764 +/- ##
=========================================
- Coverage 46.82% 46.8% -0.02%
=========================================
Files 86 86
Lines 12773 12778 +5
=========================================
Hits 5981 5981
- Misses 6248 6253 +5
Partials 544 544
Continue to review full report at Codecov.
|
@@ -9,3 +9,32 @@ func TestPointerToBool(t *testing.T) { | |||
t.Fatalf("expected PointerToBool(true) to return *true, instead returned %#v", ret) | |||
} | |||
} | |||
|
|||
func TestIsRegionNormalized(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
pkg/helpers/helpers_test.go
Outdated
for _, c := range cases { | ||
result := NormalizeAzureRegion(c.input) | ||
if c.expectedResult != result { | ||
t.Fatalf("NormalizeAzureRegion returned unexpected result: expected %t but got %t", c.expectedResult, result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
%s
instead of %t
here since we're printing string types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
What this PR does / why we need it: It solves the issue outlined in: #2258
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #2258Special notes for your reviewer:
If applicable:
Release note: