-
Notifications
You must be signed in to change notification settings - Fork 510
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
Add Load Balancer SKU name model config for Azure provider #10355
Conversation
78d092f
to
74a2899
Compare
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.
This looks great!
loadBalancerSkuName, ok := validated[configAttrLoadBalancerSkuName].(string) | ||
if ok { | ||
loadBalancerSkuNameTitle := strings.Title(loadBalancerSkuName) | ||
if loadBalancerSkuName != loadBalancerSkuNameTitle { |
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.
Nice.
provider/azure/environ.go
Outdated
@@ -495,6 +495,7 @@ func (env *azureEnviron) StartInstance(ctx context.ProviderCallContext, args env | |||
} | |||
if seriesOS == os.Windows { | |||
if instanceSpec.InstanceType.RootDisk < windowsMinRootDiskMB { | |||
// TODO(tsm) add log message that the spec has been changed |
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.
Do you still want to do this?
provider/azure/environ.go
Outdated
@@ -690,16 +689,20 @@ func (env *azureEnviron) createVirtualMachine( | |||
|
|||
publicIPAddressName := vmName + "-public-ip" | |||
publicIPAddressId := fmt.Sprintf(`[resourceId('Microsoft.Network/publicIPAddresses', '%s')]`, publicIPAddressName) | |||
publicIPAddressAllocationMethod := network.Static | |||
if strings.ToLower(env.config.loadBalancerSkuName) == "basic" { // preserve the settings that were used in Juju 2.4 and earlier |
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.
Since you're title-casing the setting when creating it, might make more sense to just compare to "Basic" here?
provider/vsphere/environ.go
Outdated
@@ -20,8 +20,6 @@ import ( | |||
"github.com/juju/juju/provider/common" | |||
) | |||
|
|||
// Note: This provider/environment does *not* implement storage. |
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.
Did you mean to remove this? It's still true - the root-disk-source setting is separate from the more general storage facilities.
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.
Yes I did, but I'll revert.
func (s *configSuite) TestValidateInvalidLoadBalancerSkuName(c *gc.C) { | ||
s.assertConfigInvalid( | ||
c, testing.Attrs{"load-balancer-sku-name": "premium"}, | ||
`invalid load balancer SKU name "Premium", expected one of: \["Basic" "Standard"\]`, |
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.
does the case matter to the Azure end? Can we be more forgiving of case here?
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 are. As you can see from the error message, we're transforming the input from "premium" to "Premium" on the user's behalf.
2a35fca
to
aa049a5
Compare
|
Juju 2.5 changed the default Azure Load Balancer SKU from Basic to Standard. Unfortunately, models created by Juju 2.4 get stuck when their controllers are upgraded.
This change introduces a model config parameter
load-balancer-sku-name
(name chosen to be consistent with the Azure SDK naming scheme) that allows for operators to select between Basic and Standard types. It also cleans up some of the internals of the Azure provider, which should make it friendlier to newcomers to the code.QA steps
(Assuming
juju
is this branch)Documentation changes
Required. We need to document the new model config parameter.
Bug reference