Skip to content

Commit

Permalink
Fix panic when ng.LaunchTemplate is nil
Browse files Browse the repository at this point in the history
When LaunchTemplate is nil at aws, but not nil at resource, this will
panic.
  • Loading branch information
july2993 committed Feb 1, 2023
1 parent bf40881 commit c351f80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/clients/eks/nodegroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func LateInitializeNodeGroup(in *manualv1alpha1.NodeGroupParameters, ng *ekstype
if ng.UpdateConfig != nil {
in.UpdateConfig.MaxUnavailable = awsclient.LateInitializeInt32Ptr(in.UpdateConfig.MaxUnavailable, ng.UpdateConfig.MaxUnavailable)
}
if in.LaunchTemplate != nil && ng.LaunchTemplate.Version != nil {
if in.LaunchTemplate != nil && ng.LaunchTemplate != nil && ng.LaunchTemplate.Version != nil {
in.LaunchTemplate.Version = awsclient.LateInitializeStringPtr(in.LaunchTemplate.Version, ng.LaunchTemplate.Version)
}
in.ReleaseVersion = awsclient.LateInitializeStringPtr(in.ReleaseVersion, ng.ReleaseVersion)
Expand Down

0 comments on commit c351f80

Please sign in to comment.