Skip to content

Commit da55429

Browse files
authored
feat: remove kubefwd (#28)
just use it separately
1 parent ce037d5 commit da55429

10 files changed

Lines changed: 24 additions & 292 deletions

File tree

README.md

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
This tool manages a local Kubernetes stack and package workflow for Crossplane:
88

9-
- Installs and manages Colima and kubefwd
9+
- Installs and manages Colima
1010
- Starts a local k8s cluster with Crossplane installed via Helm
1111
- Installs the Kubernetes and Helm Crossplane providers
1212
- Deploys an in-cluster OCI registry (`crossplane-system/registry`)
@@ -48,10 +48,9 @@ See "Releases" for available versions and changenotes.
4848
- `kubectl`
4949
- `helm`
5050
- `up` (Upbound CLI, used by `up project build`)
51-
- `kubefwd` (used by `local start` / `local kubefwd start` for service forwarding)
5251
- `aws` CLI v2 (used by `local aws` to export profile credentials)
5352

54-
Note: `hops-cli local install` installs `colima` and `kubefwd` through Homebrew.
53+
Note: `hops-cli local install` installs `colima` through Homebrew.
5554

5655
## Build
5756

@@ -70,7 +69,6 @@ cargo build --features vendored
7069
```bash
7170
hops --help
7271
hops local --help
73-
hops local kubefwd --help
7472
hops config --help
7573
```
7674

@@ -85,7 +83,7 @@ cargo run -- config --help
8583
## Quick Start
8684

8785
```bash
88-
# 1) Install Colima + kubefwd (via Homebrew)
86+
# 1) Install Colima (via Homebrew)
8987
cargo run -- local install
9088

9189
# 2) Start local k8s + Crossplane + providers + local registry
@@ -119,31 +117,20 @@ cargo run -- config generate --path /path/to/project
119117
## Commands
120118

121119
- `local install`
122-
- Runs `brew install colima kubefwd`.
120+
- Runs `brew install colima`.
123121
- `local reset`
124-
- Stops the background `kubefwd` process started by `local start`
125122
- Runs `colima kubernetes reset`.
126123
- `local start`
127124
- Runs `colima start --kubernetes --cpu 8 --memory 16 --disk 60`
128125
- Installs Crossplane from `crossplane-stable/crossplane`
129126
- Applies manifests from `bootstrap/` for runtime config, providers, provider configs, and registry (embedded in the binary at build time)
130127
- Configures Docker in Colima for insecure pulls from `registry.crossplane-system.svc.cluster.local:5000`
131128
- Adds host mapping in Colima VM for the registry service DNS name
132-
- Starts `kubefwd services -A --resync-interval 30s` in the background (log: `~/.hops/local/kubefwd.log`)
133-
- `local kubefwd start`
134-
- Starts background `kubefwd` forwarding for all namespaces with a forced resync every 30s.
135-
- `local kubefwd stop`
136-
- Stops the background `kubefwd` process managed by this CLI.
137-
- `local kubefwd refresh`
138-
- Restarts background `kubefwd` immediately (stop + start).
139129
- `local stop`
140-
- Stops the background `kubefwd` process started by `local start`
141130
- Runs `colima stop`.
142131
- `local destroy`
143-
- Stops the background `kubefwd` process started by `local start`
144132
- Runs `colima delete --force`.
145133
- `local uninstall`
146-
- Stops the background `kubefwd` process started by `local start`
147134
- Prompts for confirmation, then runs `brew uninstall colima`.
148135
- `local config [--path <PATH>] [--reload]`
149136
- Runs `up project build` in `PATH` (defaults to current directory)

src/commands/local/destroy.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
use super::{run_cmd, stop_kubefwd};
1+
use super::run_cmd;
22
use std::error::Error;
33

44
pub fn run() -> Result<(), Box<dyn Error>> {
5-
if let Err(err) = stop_kubefwd() {
6-
log::warn!("Failed to stop kubefwd cleanly: {}", err);
7-
}
8-
95
log::info!("Destroying Colima VM...");
106
run_cmd("colima", &["delete", "--force"])?;
117
log::info!("Colima VM destroyed");

src/commands/local/github.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,8 @@ fn resolve_owner(
128128
let env_owner = std::env::var("GH_OWNER").ok();
129129
let env_github_owner = std::env::var("GITHUB_OWNER").ok();
130130

131-
if let Some(owner) = select_owner(
132-
cli_owner,
133-
env_owner.as_deref(),
134-
env_github_owner.as_deref(),
135-
) {
131+
if let Some(owner) = select_owner(cli_owner, env_owner.as_deref(), env_github_owner.as_deref())
132+
{
136133
return Ok(owner);
137134
}
138135

@@ -167,7 +164,10 @@ fn prompt_for_owner(default_owner: Option<&str>) -> Result<String, Box<dyn Error
167164
);
168165
}
169166

170-
let prompt = match default_owner.map(str::trim).filter(|owner| !owner.is_empty()) {
167+
let prompt = match default_owner
168+
.map(str::trim)
169+
.filter(|owner| !owner.is_empty())
170+
{
171171
Some(default) => format!("GitHub owner is not set. Enter GitHub owner [{default}]: "),
172172
None => "GitHub owner is not set. Enter GitHub owner: ".to_string(),
173173
};
@@ -183,7 +183,10 @@ fn prompt_for_owner(default_owner: Option<&str>) -> Result<String, Box<dyn Error
183183
return Ok(owner.to_string());
184184
}
185185

186-
if let Some(default) = default_owner.map(str::trim).filter(|owner| !owner.is_empty()) {
186+
if let Some(default) = default_owner
187+
.map(str::trim)
188+
.filter(|owner| !owner.is_empty())
189+
{
187190
return Ok(default.to_string());
188191
}
189192

@@ -363,7 +366,9 @@ mod tests {
363366
assert!(gh_login_required(
364367
"authentication failed; please run gh auth login"
365368
));
366-
assert!(!gh_login_required("gh exited with exit status: 1: unknown api endpoint"));
369+
assert!(!gh_login_required(
370+
"gh exited with exit status: 1: unknown api endpoint"
371+
));
367372
}
368373

369374
#[test]

src/commands/local/install.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use super::run_cmd;
22
use std::error::Error;
33

44
pub fn run() -> Result<(), Box<dyn Error>> {
5-
log::info!("Installing Colima and kubefwd via Homebrew...");
6-
run_cmd("brew", &["install", "colima", "kubefwd"])?;
7-
log::info!("Colima and kubefwd installed successfully");
5+
log::info!("Installing Colima via Homebrew...");
6+
run_cmd("brew", &["install", "colima"])?;
7+
log::info!("Colima installed successfully");
88
Ok(())
99
}

src/commands/local/kubefwd.rs

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)