fix(master): say why a pinned pick fails on a protocol 2 agent (#9)

This commit is contained in:
2026-10-13 08:25:21 +02:00
parent 2e87d98012
commit 92e7646221
5 changed files with 26 additions and 6 deletions
+12
View File
@@ -15,8 +15,20 @@ var (
// ErrAgentTooOld means the only agent that could run the job speaks a
// protocol version without jobs.
ErrAgentTooOld = errors.New("agent too old for updates")
// ErrAgentTooOldForPinned means the only agent that could run the job
// speaks protocol version 2, which cannot deploy a digest-pinned or
// tagless ref. errors.Is(err, ErrAgentTooOld) is true for it as well.
ErrAgentTooOldForPinned error = agentTooOldForPinned{}
)
type agentTooOldForPinned struct{}
func (agentTooOldForPinned) Error() string {
return "agent too old to deploy a pinned version (needs protocol 3)"
}
func (agentTooOldForPinned) Is(target error) bool { return target == ErrAgentTooOld }
// NotUpdatableError says why a service cannot be updated. Reason is shown
// in the UI as is.
type NotUpdatableError struct {