···598 "error", msg.Error)
599}
600601-func truncateError(s string, maxLen int) string {
602- if len(s) <= maxLen {
603- return s
604- }
605- return s[:maxLen]
606-}
607-608// drainPendingJobs sends pending/timed-out jobs to a newly connected scanner.
609// Collects all pending rows first, closes cursor, then assigns and dispatches
610// to avoid holding a SELECT cursor open during UPDATEs (prevents SQLite BUSY).
···598 "error", msg.Error)
599}
6000000000601// drainPendingJobs sends pending/timed-out jobs to a newly connected scanner.
602// Collects all pending rows first, closes cursor, then assigns and dispatches
603// to avoid holding a SELECT cursor open during UPDATEs (prevents SQLite BUSY).
···24type TierConfig struct {
25 // Human-readable size limit, e.g. "5GB", "50GB", "1TB".
26 Quota string `yaml:"quota" comment:"Storage quota limit (e.g. \"5GB\", \"50GB\", \"1TB\")."`
27+28+ // Whether pushing triggers an immediate vulnerability scan.
29+ ScanOnPush bool `yaml:"scan_on_push" comment:"Trigger vulnerability scan immediately on push. When false, images are still scanned by background scheduling."`
30}
3132// DefaultsConfig represents default settings.
···166 return ""
167 }
168 return m.config.Defaults.NewCrewTier
169+}
170+171+// ScanOnPush returns whether scan-on-push is enabled for a tier.
172+// Follows the same fallback logic as GetTierLimit:
173+// 1. If quotas disabled → false (caller decides default)
174+// 2. If tierKey provided and found → that tier's ScanOnPush
175+// 3. If tierKey not found or empty → use defaults.new_crew_tier
176+// 4. If default tier not found → false
177+func (m *Manager) ScanOnPush(tierKey string) bool {
178+ if !m.IsEnabled() {
179+ return false
180+ }
181+182+ if tierKey != "" {
183+ if tier, ok := m.config.Tiers[tierKey]; ok {
184+ return tier.ScanOnPush
185+ }
186+ }
187+188+ // Fall back to default tier
189+ if m.config.Defaults.NewCrewTier != "" {
190+ if tier, ok := m.config.Tiers[m.config.Defaults.NewCrewTier]; ok {
191+ return tier.ScanOnPush
192+ }
193+ }
194+195+ return false
196}
197198// TierCount returns the number of configured tiers