feat(master): suggest newer version tags for third-party images (#11) (#31)
Docker Build / docker (push) Successful in 45s

This commit was merged in pull request #31.
This commit is contained in:
2026-10-13 10:18:53 +00:00
parent 850a670446
commit f6446be711
26 changed files with 1090 additions and 48 deletions
+13
View File
@@ -104,6 +104,19 @@ func (m *memStore) SetLastTagDigest(_ context.Context, id int64, digest string)
return nil
}
func (m *memStore) SetNewer(_ context.Context, id int64, ref string, at time.Time) error {
m.mu.Lock()
defer m.mu.Unlock()
svc, ok := m.svcRows[id]
if !ok {
return model.ErrNotFound
}
svc.NewerRef = ref
svc.NewerAt = &at
m.svcRows[id] = svc
return nil
}
// seedService adds a service row that jobs can be triggered for.
func (m *memStore) seedService(svc model.Service) {
m.mu.Lock()
+3
View File
@@ -34,6 +34,9 @@ func (f *fixedRegistry) Digest(_ context.Context, ref string) (string, error) {
return f.digests[ref], nil
}
// Tags lists no tags, so no newer tag is ever suggested.
func (f *fixedRegistry) Tags(context.Context, string) ([]string, error) { return nil, nil }
func TestPickPinnedVersion(t *testing.T) {
env := newJobEnv(t)
env.store.seedVersion(model.ImageVersion{ID: 5, Repo: slusk, Tag: "1.3.0", Digest: "sha256:old130", Source: model.SourceRunning})