mirror of https://github.com/kubernetes/kops.git
aws: Skip WarmPool checks when it's not enabled
This commit is contained in:
parent
349de70cda
commit
771a3fb256
|
|
@ -246,9 +246,12 @@ func (c *NodeUpCommand) Run(out io.Writer) error {
|
||||||
}
|
}
|
||||||
modelContext.InstanceID = string(instanceIDBytes)
|
modelContext.InstanceID = string(instanceIDBytes)
|
||||||
|
|
||||||
modelContext.ConfigurationMode, err = getAWSConfigurationMode(ctx, modelContext)
|
// Check if WarmPool is enabled first, to avoid additional API calls
|
||||||
if err != nil {
|
if len(modelContext.NodeupConfig.WarmPoolImages) > 0 {
|
||||||
return err
|
modelContext.ConfigurationMode, err = getAWSConfigurationMode(ctx, modelContext)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
modelContext.MachineType, err = getMachineType()
|
modelContext.MachineType, err = getMachineType()
|
||||||
|
|
@ -713,6 +716,11 @@ func getNodeConfigFromServers(ctx context.Context, bootConfig *nodeup.BootConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
func getAWSConfigurationMode(ctx context.Context, c *model.NodeupModelContext) (string, error) {
|
func getAWSConfigurationMode(ctx context.Context, c *model.NodeupModelContext) (string, error) {
|
||||||
|
// Check if WarmPool is enabled first, to avoid additional API calls
|
||||||
|
if len(c.NodeupConfig.WarmPoolImages) == 0 {
|
||||||
|
return "", nil
|
||||||
|
}
|
||||||
|
|
||||||
// Only worker nodes and apiservers can actually autoscale.
|
// Only worker nodes and apiservers can actually autoscale.
|
||||||
// We are not adding describe permissions to the other roles
|
// We are not adding describe permissions to the other roles
|
||||||
role := c.BootConfig.InstanceGroupRole
|
role := c.BootConfig.InstanceGroupRole
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue