Skip to content

[plugins] Advise the cli-download role on a 403 from registry-packages-proxy - #452

Closed
Glitchy-Sheep wants to merge 1 commit into
mainfrom
fix/plugins-errdetect-cli-download-role
Closed

[plugins] Advise the cli-download role on a 403 from registry-packages-proxy#452
Glitchy-Sheep wants to merge 1 commit into
mainfrom
fix/plugins-errdetect-cli-download-role

Conversation

@Glitchy-Sheep

Copy link
Copy Markdown
Contributor

Summary

The 403 diagnostic for d8 dist plugins told users to bind the wrong ClusterRole. They bound it and still got 403.

Problem

  • Plugins are downloaded over /v1/images/
  • kube-rbac-proxy authorizes that whole prefix through the deployments/cli-binary subresource
  • That subresource is granted by d8:registry-packages-proxy:cli-download
  • The diagnostic named d8:registry-packages-proxy:packages-download, which covers /v1/packages/ and is never called by the CLI
  • So the advice led nowhere: bind the role, wait, get 403 again
  • The same block also said "authorization is cached ~5 min - after binding, retry with a fresh token". A denial is cached for about 30 seconds, and the old token keeps working, so both halves were wrong
  • The d8 dist copy of the diagnostic named the right role but carried the same wrong hint about the cache

Fix

  • Advise cli-download for plugins
  • Say that a denial is cached for about 30 seconds and the same token still works, in both copies of the diagnostic
  • Add a short comment next to the case so the role is not "corrected" back later

Before / After

Before: a 403 on d8 dist plugins install <name> sent the user to packages-download, which does not open the route.

After: the same 403 sends the user to cli-download, the role that actually grants /v1/images/.

Tests

  • TestDiagnose in internal/plugins/cmd/errdetect now pins cli-download in the 403 advice

Notes

  • Source of truth: modules/039-registry-packages-proxy/templates/deployment.yaml in deckhouse maps /v1/images/ to subresource cli-binary and /v1/packages/ to packages
  • Repo docs were already right (internal/plugins/README.md, internal/selfupdate/README.md); only the code lagged behind

…s-proxy

Plugins are downloaded over /v1/images/, and kube-rbac-proxy authorizes that
whole prefix through the deployments/cli-binary subresource, granted by the
ClusterRole d8:registry-packages-proxy:cli-download. The 403 diagnostic named
packages-download instead. That role covers /v1/packages/, which the CLI never
calls, so a user who followed the advice bound the role and still got 403.

The same suggestion told the user to wait about 5 minutes and retry with a
fresh token. kube-rbac-proxy caches a denial for about 30 seconds, and the
existing token keeps working, so both halves of that hint were wrong. The
d8 dist copy of the diagnostic carried the same wrong hint and is fixed too.

Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
@Glitchy-Sheep

Copy link
Copy Markdown
Contributor Author

Moved into #451 - the fix rides along with the mirror push change instead of a separate PR.

@Glitchy-Sheep
Glitchy-Sheep deleted the fix/plugins-errdetect-cli-download-role branch August 21, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant