Skip to content

[apiserver] replace sample-apiserver and add integration coverage#86

Merged
dilyevsky merged 5 commits intomainfrom
codex/apiserver-tilt-worktree
Apr 20, 2026
Merged

[apiserver] replace sample-apiserver and add integration coverage#86
dilyevsky merged 5 commits intomainfrom
codex/apiserver-tilt-worktree

Conversation

@dilyevsky
Copy link
Copy Markdown
Contributor

Summary

  • replace the sample-apiserver startup path with a local Tilt-style server builder/start flow under pkg/apiserver/server
  • wire pkg/apiserver/manager.go and storage to the new server path, including configurable bind address/port and local readyz/client handling
  • add end-to-end pkg/apiserver integration tests for health, CRUD + sqlite persistence, simple auth, and defaulter/validator hooks

Review Guide

  1. pkg/apiserver/server/ for the new local apiserver builder/start implementation
  2. pkg/apiserver/manager.go for server boot, auth wiring, and the removal of the sample-apiserver command wrapper
  3. pkg/apiserver/storage.go for the Kine listener/metrics changes needed for repeatable in-process starts
  4. pkg/apiserver/integration_test.go for the new coverage

Details

  • preserves shared storage across versions and keeps status subresource wiring in the local builder
  • removes the old flag reset / command shim path from manager startup
  • fixes custom cert-path handling in start() by avoiding local variable shadowing
  • uses a unique Kine unix socket directory per process and wraps metric registration per instance so multiple in-process starts do not panic
  • makes the local client and readiness probe target the configured loopback host/port instead of hardcoding localhost:8443

Tests

  • go test ./pkg/apiserver -run TestAPIServerIntegration -count=1
  • go test ./pkg/apiserver/... -count=1
  • go build ./cmd/apiserver

Notes

  • the simple-auth path currently propagates the username reliably; anonymous fallback comes through as system:anonymous with system:unauthenticated, and the integration test asserts that current behavior
  • sqlite/Kine still emits dbstat warnings during startup in this environment; that is pre-existing runtime noise and not addressed here

@dilyevsky dilyevsky force-pushed the codex/apiserver-tilt-worktree branch from d04ae68 to a616a53 Compare April 16, 2026 20:45
dilyevsky and others added 4 commits April 17, 2026 10:56
- Reflectively register List-type conversions across all registered
  GroupKinds in the builder so a non-storage list round-trips through
  the singular converters (previously crashed with
  "unknown conversion" for *List pairs like v1alpha.BackendList <-> v1alpha2.BackendList).
- Use SingularNameProvider for SingularQualifiedResource rather than
  the plural resource name.
- Document why the configFn pass runs twice around ApplyTo — FeatureOptions.ApplyTo
  sets c.FlowControl whenever EnablePriorityAndFairness is true, and the second
  pass re-nils it.
- Drop unused ConnProvider scaffolding in server/apiserver/conn.go.
- Reflectively register List-type conversions across all registered
  GroupKinds in the builder so a non-storage list round-trips through
  the singular converters (previously crashed with
  "unknown conversion" for *List pairs like v1alpha.BackendList <-> v1alpha2.BackendList).
- Use SingularNameProvider for SingularQualifiedResource rather than
  the plural resource name.
- Document why the configFn pass runs twice around ApplyTo — FeatureOptions.ApplyTo
  sets c.FlowControl whenever EnablePriorityAndFairness is true, and the second
  pass re-nils it.
- Drop unused ConnProvider scaffolding in server/apiserver/conn.go.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Wrap the upstream EffectiveVersion so /version serves the actual apoxy
build info (BuildVersion/CommitHash/BuildDate injected via ldflags)
instead of the k8s component-base defaults, which are "v0.0.0-master+
\$Format:%H\$", "\$Format:%H\$", and "1970-01-01T00:00:00Z" in any
vendored build where git's keyword expansion never ran.

Binary/Emulation/MinCompatibility fields pass through unchanged so
kube-client version negotiation behaves normally; GitVersion keeps a
clean vMAJOR.MINOR prefix so utilversion.ParseGeneric still yields the
k8s compatibility version.
@dilyevsky dilyevsky marked this pull request as ready for review April 20, 2026 22:27
@dilyevsky dilyevsky changed the title apiserver: replace sample-apiserver and add integration coverage [apiserver] replace sample-apiserver and add integration coverage Apr 20, 2026
@dilyevsky dilyevsky merged commit 1c4ae63 into main Apr 20, 2026
1 check passed
@dilyevsky dilyevsky deleted the codex/apiserver-tilt-worktree branch April 20, 2026 22:28
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