Skip to content

Commit

Permalink
Use generated nodegroup template types (#2658)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbeaumont authored Sep 21, 2020
1 parent 72c293d commit 0ddda62
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ require (
github.com/vektra/mockery v0.0.0-20181123154057-e78b021dcbb5
github.com/voxelbrain/goptions v0.0.0-20180630082107-58cddc247ea2 // indirect
// Fork from errordeveloper/goformation, rebased on awslabs/goformation/v4
github.com/weaveworks/goformation/v4 v4.10.2-0.20200818093538-2bbc8360f17e
github.com/weaveworks/goformation/v4 v4.10.2-0.20200921152539-d988cd847e74
github.com/weaveworks/launcher v0.0.2-0.20200715141516-1ca323f1de15
github.com/whilp/git-urls v0.0.0-20191001220047-6db9661140c0
golang.org/x/tools v0.0.0-20200502202811-ed308ab3e770
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -960,8 +960,8 @@ github.com/vmware/govmomi v0.20.1 h1:7b/SeTUB3tER8ZLGLLLH3xcnB2xeuLULXmfPFqPSRZA
github.com/vmware/govmomi v0.20.1/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU=
github.com/voxelbrain/goptions v0.0.0-20180630082107-58cddc247ea2 h1:txplJASvd6b/hrE0s/Ixfpp2cuwH9IO9oZBAN9iYa4A=
github.com/voxelbrain/goptions v0.0.0-20180630082107-58cddc247ea2/go.mod h1:DGCIhurYgnLz8J9ga1fMV/fbLDyUvTyrWXVWUIyJon4=
github.com/weaveworks/goformation/v4 v4.10.2-0.20200818093538-2bbc8360f17e h1:51eBi0xt21FzC6egZJrVZBz/vTrg8vgfQ16JEvtNsd8=
github.com/weaveworks/goformation/v4 v4.10.2-0.20200818093538-2bbc8360f17e/go.mod h1:v5eVVfemt/w9XiVfD/Zmwic31dGfwIsVEHp5XhJ0qFU=
github.com/weaveworks/goformation/v4 v4.10.2-0.20200921152539-d988cd847e74 h1:sG07hBbJf/fJ3JPjMJrIpTXX6ig/8TPjufejsWkrYcY=
github.com/weaveworks/goformation/v4 v4.10.2-0.20200921152539-d988cd847e74/go.mod h1:v5eVVfemt/w9XiVfD/Zmwic31dGfwIsVEHp5XhJ0qFU=
github.com/weaveworks/launcher v0.0.2-0.20200715141516-1ca323f1de15 h1:i/RhLevywqC6cuUWtGdoaNrsJd+/zWh3PXbkXZIyZsU=
github.com/weaveworks/launcher v0.0.2-0.20200715141516-1ca323f1de15/go.mod h1:w9Z1vnQmPobkEZ0F3oyiqRYP+62qDqTGnK6t5uhe1kg=
github.com/weaveworks/mesh v0.0.0-20170419100114-1f158d31de55/go.mod h1:mcON9Ws1aW0crSErpXWp7U1ErCDEKliDX2OhVlbWRKk=
Expand Down
10 changes: 5 additions & 5 deletions pkg/cfn/builder/managed_nodegroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (m *ManagedNodeGroupResourceSet) AddAllResources() error {
Tags: m.nodeGroup.Tags,
}

var launchTemplate *gfneks.Nodegroup_LaunchTemplate
var launchTemplate *gfneks.Nodegroup_LaunchTemplateSpecification

if m.nodeGroup.LaunchTemplate != nil {
launchTemplateData, err := m.launchTemplateFetcher.Fetch(m.nodeGroup.LaunchTemplate)
Expand All @@ -94,8 +94,8 @@ func (m *ManagedNodeGroupResourceSet) AddAllResources() error {
return err
}

launchTemplate = &gfneks.Nodegroup_LaunchTemplate{
ID: gfnt.NewString(m.nodeGroup.LaunchTemplate.ID),
launchTemplate = &gfneks.Nodegroup_LaunchTemplateSpecification{
Id: gfnt.NewString(m.nodeGroup.LaunchTemplate.ID),
}
if version := m.nodeGroup.LaunchTemplate.Version; version != nil {
launchTemplate.Version = gfnt.NewString(*version)
Expand All @@ -117,8 +117,8 @@ func (m *ManagedNodeGroupResourceSet) AddAllResources() error {
LaunchTemplateName: gfnt.MakeFnSubString(fmt.Sprintf("${%s}", gfnt.StackName)),
LaunchTemplateData: launchTemplateData,
})
launchTemplate = &gfneks.Nodegroup_LaunchTemplate{
ID: ltRef,
launchTemplate = &gfneks.Nodegroup_LaunchTemplateSpecification{
Id: ltRef,
}
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/managed/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func (m *Service) UpgradeNodeGroup(options UpgradeOptions) error {
if len(ltResources) == 1 {
return errors.New("launch-template-version is only valid if a nodegroup is using an explicit launch template")
}
if ngResource.LaunchTemplate == nil || ngResource.LaunchTemplate.ID == nil {
if ngResource.LaunchTemplate == nil || ngResource.LaunchTemplate.Id == nil {
return errors.New("nodegroup does not use a launch template")
}
}
Expand Down Expand Up @@ -289,12 +289,12 @@ func (m *Service) usesCustomAMI(ltResources map[string]*gfnec2.LaunchTemplate, n
return lt.LaunchTemplateData.ImageId != nil, nil
}

if ng.LaunchTemplate == nil || ng.LaunchTemplate.ID == nil {
if ng.LaunchTemplate == nil || ng.LaunchTemplate.Id == nil {
return false, nil
}

lt := &api.LaunchTemplate{
ID: ng.LaunchTemplate.ID.String(),
ID: ng.LaunchTemplate.Id.String(),
}
if version := ng.LaunchTemplate.Version; version != nil {
lt.Version = aws.String(version.String())
Expand Down

0 comments on commit 0ddda62

Please sign in to comment.