Skip to content

Commit e82ebab

Browse files
authored
fix(instance): EoS warning: filter products list by offer_id (scaleway#4879)
1 parent 39f749f commit e82ebab

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

internal/namespaces/instance/v1/helpers_types.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,9 @@ func getEndOfServiceDate(
121121
}
122122

123123
for _, product := range products.Products {
124-
if strings.HasPrefix(product.Product, commercialType) {
125-
if product.Locality.Zone != nil && *product.Locality.Zone == zone {
126-
return product.EndOfLifeAt.Format(time.DateOnly), nil
127-
}
124+
if product.Properties != nil && product.Properties.Instance != nil &&
125+
product.Properties.Instance.OfferID == commercialType {
126+
return product.EndOfLifeAt.Format(time.DateOnly), nil
128127
}
129128
}
130129

0 commit comments

Comments
 (0)