Skip to content

Commit

Permalink
fix(aws): Fixing NPE while retrieving imageId in launch templates (#5003
Browse files Browse the repository at this point in the history
)

- updated to get image id from launch template data
- made lookup null-safe
  • Loading branch information
jeyrschabu committed Oct 9, 2020
1 parent 0d51499 commit 225fdca
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -95,7 +95,8 @@ class AmazonClusterProvider implements ClusterProvider<AmazonCluster>, ServerGro
String launchTemplateKey = Keys.getLaunchTemplateKey(launchTemplateName, account, region)
CacheData launchTemplate = cacheView.get(LAUNCH_TEMPLATES.ns, launchTemplateKey)
updateServerGroupLaunchSettings(serverGroupById, [launchTemplate])
imageId = serverGroup.launchTemplate["launchTemplateData"]["imageId"]
def launchTemplateData = (launchTemplate?.attributes?.get("latestVersion") as Map)?.get("launchTemplateData")
imageId = (launchTemplateData as Map)?.get("imageId")
} else {
String launchConfigKey = Keys.getLaunchConfigKey(serverGroupData?.attributes['launchConfigName'] as String, account, region)
CacheData launchConfigs = cacheView.get(LAUNCH_CONFIGS.ns, launchConfigKey)
Expand Down

0 comments on commit 225fdca

Please sign in to comment.