Skip to content

Commit d540255

Browse files
committed
fix(#347): warn if manual_eol is set but the product exists
1 parent 92f0c7c commit d540255

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

cmd/check.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,34 @@ func getStackTableRows(stack []stackItem, today time.Time) ([]stackTableRow, boo
6565

6666
// Handle items with manual_eol set (product not in eol.date API)
6767
if item.ManualEol != "" {
68+
// Check if product exists in the API cache
69+
productsPath, err := utilities.GetProductsPath()
70+
if err == nil {
71+
products, err := utilities.GetProductsWithCacheRefresh(nil, productsPath)
72+
if err == nil {
73+
prod := item.IdEol
74+
found := false
75+
for name, aliases := range products.Products {
76+
if strings.EqualFold(prod, name) {
77+
found = true
78+
break
79+
}
80+
for _, alias := range aliases {
81+
if strings.EqualFold(prod, alias) {
82+
found = true
83+
break
84+
}
85+
}
86+
if found {
87+
break
88+
}
89+
}
90+
if found {
91+
log.Warn().Msgf("Product %s is available in eol.date API but has manual_eol set. Consider removing manual_eol to use official EOL data", item.Name)
92+
}
93+
}
94+
}
95+
6896
log.Info().Msgf("Using manual EOL date for %s %s: %s (product not available in eol.date API)", item.Name, item.Version, item.ManualEol)
6997
eolDate := item.ManualEol
7098
var status string

0 commit comments

Comments
 (0)