From 963af8c6cc7ddbf47443b6069dbd8ed4f476e51d Mon Sep 17 00:00:00 2001 From: Sebastian Cole Date: Wed, 20 Sep 2023 11:47:01 +1000 Subject: [PATCH] cleanup utils conversion functions --- pkg/utils/nodeclass/nodeclass.go | 1 + pkg/utils/nodetemplate/nodetemplate.go | 13 +++++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/pkg/utils/nodeclass/nodeclass.go b/pkg/utils/nodeclass/nodeclass.go index 7afac2df0bc9..18b2df808216 100644 --- a/pkg/utils/nodeclass/nodeclass.go +++ b/pkg/utils/nodeclass/nodeclass.go @@ -65,6 +65,7 @@ func New(nodeTemplate *v1alpha1.AWSNodeTemplate) *v1beta1.EC2NodeClass { AMIs: NewAMIs(nodeTemplate.Status.AMIs), Licenses: nodeTemplate.Status.Licenses, HostResourceGroup: NewHostResourceGroup(nodeTemplate.Status.HostResourceGroups), + PlacementGroups: nodeTemplate.Status.PlacementGroups, }, IsNodeTemplate: true, } diff --git a/pkg/utils/nodetemplate/nodetemplate.go b/pkg/utils/nodetemplate/nodetemplate.go index 7fc38850e530..00ce02c8b963 100644 --- a/pkg/utils/nodetemplate/nodetemplate.go +++ b/pkg/utils/nodetemplate/nodetemplate.go @@ -49,16 +49,17 @@ func New(nodeClass *v1beta1.EC2NodeClass) *v1alpha1.AWSNodeTemplate { Subnets: NewSubnets(nodeClass.Status.Subnets), SecurityGroups: NewSecurityGroups(nodeClass.Status.SecurityGroups), AMIs: NewAMIs(nodeClass.Status.AMIs), - Licenses: NewLicenses(nodeClass.Status.Licenses), + Licenses: nodeClass.Status.Licenses, HostResourceGroups: NewHostResourceGroups(nodeClass.Status.HostResourceGroup), + PlacementGroups: nodeClass.Status.PlacementGroups, }, } } func NewHostResourceGroups(hrg *v1beta1.HostResourceGroup) []string { - if hrg == nil { - return nil - } + if hrg == nil { + return nil + } return []string{hrg.ARN} } @@ -145,7 +146,3 @@ func NewAMIs(amis []v1beta1.AMI) []v1alpha1.AMI { } }) } - -func NewLicenses(licenses []string) []string { - return licenses -}