Skip to content

Commit dc1ac6e

Browse files
committed
update
1 parent 012404f commit dc1ac6e

File tree

4 files changed

+5
-18
lines changed

4 files changed

+5
-18
lines changed

pkg/apis/v1alpha1/ecsnodeclass.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -304,26 +304,13 @@ const (
304304
func (in *ECSNodeClass) Hash() string {
305305
return fmt.Sprint(lo.Must(hashstructure.Hash([]interface{}{
306306
in.Spec,
307-
in.ImageFamily(),
308307
}, hashstructure.FormatV2, &hashstructure.HashOptions{
309308
SlicesAsSets: true,
310309
IgnoreZeroValue: true,
311310
ZeroNil: true,
312311
})))
313312
}
314313

315-
// ImageFamily returns the family for a NodePool based on the following items, in order of precdence:
316-
// - ecsnodeclass.spec.imageFamily
317-
// - ecsnodeclass.spec.imageSelectorTerms[].alias
318-
//
319-
// If an alias is specified, ecsnodeclass.spec.imageFamily must match that alias, or be 'Custom' (enforced via validation).
320-
func (in *ECSNodeClass) ImageFamily() string {
321-
if alias := in.Alias(); alias != nil {
322-
return alias.Family
323-
}
324-
return ImageFamilyCustom
325-
}
326-
327314
func (in *ECSNodeClass) Alias() *Alias {
328315
term, ok := lo.Find(in.Spec.ImageSelectorTerms, func(term ImageSelectorTerm) bool {
329316
return term.Alias != ""

pkg/providers/cluster/ackmanaged.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ func (a *ACKManaged) GetSupportedImages(k8sVersion string) ([]Image, error) {
130130
ImageID: tea.StringValue(item.ImageId),
131131
ImageName: tea.StringValue(item.ImageName),
132132
Platform: tea.StringValue(item.Platform),
133-
OsVersion: tea.StringValue(item.OsVersion),
133+
OSVersion: tea.StringValue(item.OsVersion),
134134
ImageType: tea.StringValue(item.ImageType),
135-
OsType: tea.StringValue(item.OsType),
135+
OSType: tea.StringValue(item.OsType),
136136
Architecture: tea.StringValue(item.Architecture),
137137
}
138138
}), nil

pkg/providers/cluster/types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ type Image struct {
4444
ImageID string
4545
ImageName string
4646
Platform string
47-
OsVersion string
47+
OSVersion string
4848
ImageType string
49-
OsType string
49+
OSType string
5050
Architecture string
5151
}
5252

pkg/providers/imagefamily/image.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func (p *DefaultProvider) getImages(ctx context.Context, nodeClass *v1alpha1.ECS
101101
var err error
102102
if selectorTerm.Alias != "" {
103103
alias := v1alpha1.NewAlias(selectorTerm.Alias)
104-
imageFamily := GetImageFamily(selectorTerm.Alias, nil)
104+
imageFamily := GetImageFamily(alias.Family, nil)
105105
if imageFamily == nil {
106106
return nil, fmt.Errorf("unsupported image family %s", selectorTerm.Alias)
107107
}

0 commit comments

Comments
 (0)