Skip to content

Controller cleanup#92

Merged
creydr merged 7 commits into
functions-dev:mainfrom
creydr:refactor-controller-2
Apr 27, 2026
Merged

Controller cleanup#92
creydr merged 7 commits into
functions-dev:mainfrom
creydr:refactor-controller-2

Conversation

@creydr
Copy link
Copy Markdown
Collaborator

@creydr creydr commented Apr 24, 2026

No description provided.

creydr added 7 commits April 24, 2026 11:23
Extract middleware state checking into checkMiddlewareState, which
returns a sum type (middlewareUpToDate | middlewareOutdated) so that
handleMiddlewareUpdate becomes a flat type-switch orchestrator.

This eliminates the redundant Describe and GetMiddlewareVersion calls,
and removes the now-unused isMiddlewareLatest method.
Move pipeline RBAC setup (setupPipelineRBAC, ensureDeployFunctionRole,
ensureDeployFunctionRoleBinding) to function_rbac.go and deploy mechanics
(deploy, persistRegistryAuthSecret) to function_deploy.go, so the main
controller file focuses on reconciliation flow.
Move removeFuncAnnotations from the top-level Reconcile method into
reconcile(), grouping it with the other reconciliation steps. This
keeps Reconcile focused on status tracking and error handling while
reconcile() owns the full business logic sequence.
@creydr creydr changed the title [WIP] Controller cleanup Controller cleanup Apr 27, 2026
@creydr creydr added this pull request to the merge queue Apr 27, 2026
Merged via the queue into functions-dev:main with commit 2709924 Apr 27, 2026
11 checks passed
@creydr creydr deleted the refactor-controller-2 branch April 27, 2026 10:15
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