This is an automated email from the ASF dual-hosted git repository. hsluoyz pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/casbin-gateway.git
commit 009391277136cd477f186a578c3d81117dff7f00 Author: Yang Luo <[email protected]> AuthorDate: Fri Sep 4 22:15:24 2026 +0800 fix(agents): report an unpatchable agent as unsupported, not unknown --- agentpatch/patch.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/agentpatch/patch.go b/agentpatch/patch.go index 0170391..9ac831c 100644 --- a/agentpatch/patch.go +++ b/agentpatch/patch.go @@ -146,11 +146,10 @@ func patcherFor(target Target) (patcher, error) { if target.Path == "" { return nil, errors.New("path is required") } + // An installation with no patcher is one Gateway can discover but cannot + // monitor, which is what StatusOf and EnsurePatched already call it. patcher, ok := patchers[target.AgentId] - if !ok { - return nil, fmt.Errorf("unknown agent %q", target.AgentId) - } - if !patcher.Supported() { + if !ok || !patcher.Supported() { return nil, fmt.Errorf("%s: %w", target.AgentId, ErrNotSupported) } return patcher, nil --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
