refactor: use admin API for node discovery in kubeadm-deployer#91
refactor: use admin API for node discovery in kubeadm-deployer#91
Conversation
Replace wondersdk (user-level API) with direct admin API calls in the
kubeadm-deployer Go binary. The deployer now takes --admin-token and
--wonder-net-id flags instead of --api-key, and calls
GET /admin/api/v1/wonder-nets/{id}/nodes to discover mesh nodes.
This simplifies the demo flow by removing the API key creation step
from run-demo.sh, since the admin token is already available.
|
@codex PTAL |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
Pull request overview
This PR refactors the kubeadm-deployer example to use the Admin API directly instead of the wondersdk client library. This simplifies the authentication flow by using an admin token directly rather than requiring an intermediate API key creation step. The changes enable the deployer to discover nodes using admin privileges, which is appropriate for this administrative deployment use case.
Changes:
- Replaced wondersdk client with direct HTTP calls to the Admin API for node discovery
- Changed CLI authentication from
--api-keyto--admin-token+--wonder-net-id - Removed the API key creation step from the demo script, simplifying the setup process
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| examples/kubeadm-deployer/run-demo.sh | Removed API key creation logic and updated kubeadm-deployer invocation to use new flags |
| examples/kubeadm-deployer/main.go | Updated CLI flags from --api-key to --admin-token and --wonder-net-id, updated Config struct |
| examples/kubeadm-deployer/deployer/deployer.go | Replaced wondersdk client with http.Client, added direct admin API implementation for health checks and node listing, updated Node struct definition |
| examples/kubeadm-deployer/README.md | Updated documentation to reflect new API-based authentication flow and removed SDK usage examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@codex review please |
|
Codex Review: Didn't find any major issues. Bravo. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
wondersdk(user-level/api/v1/nodes) with direct admin API calls (/admin/api/v1/wonder-nets/{id}/nodes) in the kubeadm-deployer Go binary--api-keyto--admin-token+--wonder-net-idrun-demo.shsince admin token is already availableTest plan
go build ./examples/kubeadm-deployer/...passesgo vet ./examples/kubeadm-deployer/...passesrun-demo.she2e test passes — 3-node Kubernetes cluster bootstrapped successfully