Skip to content

Commit

Permalink
cleanup utils conversion functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Cole committed Sep 20, 2023
1 parent 8dc56e5 commit 963af8c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
1 change: 1 addition & 0 deletions pkg/utils/nodeclass/nodeclass.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
13 changes: 5 additions & 8 deletions pkg/utils/nodetemplate/nodetemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}

Expand Down Expand Up @@ -145,7 +146,3 @@ func NewAMIs(amis []v1beta1.AMI) []v1alpha1.AMI {
}
})
}

func NewLicenses(licenses []string) []string {
return licenses
}

0 comments on commit 963af8c

Please sign in to comment.