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

Added scale check to ensure initial NSG is not for jumpbox #2781

Merged
merged 2 commits into from
May 1, 2018
Merged

Added scale check to ensure initial NSG is not for jumpbox #2781

merged 2 commits into from
May 1, 2018

Conversation

marrobi
Copy link
Contributor

@marrobi marrobi commented Apr 26, 2018

What this PR does / why we need it:

Fixes issue where deployments with a jumpbox do not scale due to two NSGs being present.

Which issue this PR fixes *

fixes #2616

Notes*
Added check to ensure the NSG is not for a jumpbox. Tested scale up using repo details in issue.

@ghost ghost assigned marrobi Apr 26, 2018
@ghost ghost added the in progress label Apr 26, 2018
@codecov
Copy link

codecov bot commented Apr 26, 2018

Codecov Report

Merging #2781 into master will decrease coverage by 0.12%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2781      +/-   ##
==========================================
- Coverage   46.95%   46.82%   -0.13%     
==========================================
  Files          86       86              
  Lines       12781    12775       -6     
==========================================
- Hits         6001     5982      -19     
- Misses       6226     6249      +23     
+ Partials      554      544      -10
Impacted Files Coverage Δ
pkg/acsengine/transform/transform.go 60% <50%> (+0.18%) ⬆️
pkg/api/vlabs/validate.go 40.73% <0%> (-2.5%) ⬇️
pkg/api/convertertoagentpoolonlyapi.go 28.11% <0%> (-0.37%) ⬇️
pkg/acsengine/engine.go 62.72% <0%> (-0.11%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1b7cef8...b9e6b3c. Read the comment docs.

Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

lgtm

@CecileRobertMichon
Copy link
Contributor

CecileRobertMichon commented Apr 26, 2018

@@ -114,7 +114,8 @@ func (t *Transformer) NormalizeForK8sVMASScalingUp(logger *logrus.Entry, templat

resourceType, ok := resourceMap[typeFieldName].(string)
if ok && resourceType == nsgResourceType {
if nsgIndex != -1 {
resourceName := resourceMap[nameFieldName].(string)
if nsgIndex != -1 && !strings.Contains(resourceName, "variables('jumpboxNetworkSecurityGroupName')") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Thinking about this a bit more, I think the && !strings.Contains(resourceName, "variables('jumpboxNetworkSecurityGroupName')" should be on line 116. If the nsg belongs to the jumpbox, we don't want to set the nsgIndex to its index. Otherwise, if the non-jumpbox nsg comes later in the for loop, this will fail (the nsgIndex won't be -1 and it won't belong to the jumpbox).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are correct. I hadn't followed why nsgIndex was set, but get it now. Have made the change.

@CecileRobertMichon CecileRobertMichon added the cse-sync-week Triage for issues that would be good for CSE sync week, April 24-27th 2018 label May 1, 2018
Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

lgtm

@CecileRobertMichon CecileRobertMichon merged commit 4e73838 into Azure:master May 1, 2018
@ghost ghost removed the in progress label May 1, 2018
@CecileRobertMichon CecileRobertMichon changed the title Added check to ensure initial NSG is not for jumpbox Added scale check to ensure initial NSG is not for jumpbox May 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cse-sync-week Triage for issues that would be good for CSE sync week, April 24-27th 2018
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot scale a private cluster
2 participants