Skip to content

Commit 79f1b12

Browse files
committed
fix: replaced offline with install config
1 parent 9599fc7 commit 79f1b12

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

registry/coder/modules/cmux/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,17 @@ module "cmux" {
7979
}
8080
```
8181

82-
### Offline Mode
82+
### Skip Install
8383

84-
Just run cmux in the background; do not install from the network (requires cmux to be pre-installed):
84+
Run without installing from the network (requires cmux to be pre-installed):
8585

8686
```tf
8787
module "cmux" {
8888
count = data.coder_workspace.me.start_count
8989
source = "registry.coder.com/coder/cmux/coder"
9090
version = "1.0.0"
9191
agent_id = coder_agent.example.id
92-
offline = true
92+
install = false
9393
}
9494
```
9595

@@ -100,5 +100,5 @@ module "cmux" {
100100
## Notes
101101

102102
- cmux is currently in preview and you may encounter bugs
103-
- Requires internet connectivity for agent operations (unless running in offline mode)
103+
- Requires internet connectivity for agent operations (unless `install` is set to false)
104104
- Installs `@coder/cmux` from npm by default (falls back to the npm tarball if npm is unavailable)

registry/coder/modules/cmux/cmux.tftest.hcl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ run "required_vars" {
66
}
77
}
88

9-
run "offline_and_use_cached_conflict" {
9+
run "install_false_and_use_cached_conflict" {
1010
command = plan
1111

1212
variables {
1313
agent_id = "foo"
1414
use_cached = true
15-
offline = true
15+
install = false
1616
}
1717

1818
expect_failures = [
@@ -43,13 +43,13 @@ run "custom_version" {
4343
}
4444
}
4545

46-
# offline-only should succeed
47-
run "offline_only_success" {
46+
# install=false should succeed
47+
run "install_false_only_success" {
4848
command = plan
4949

5050
variables {
5151
agent_id = "foo"
52-
offline = true
52+
install = false
5353
}
5454
}
5555

registry/coder/modules/cmux/main.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ variable "group" {
7272
default = null
7373
}
7474

75-
variable "offline" {
75+
variable "install" {
7676
type = bool
77-
description = "Just run cmux in the background; do not install from the network"
78-
default = false
77+
description = "Install cmux from the network (npm or tarball). If false, run without installing (requires a pre-installed cmux)."
78+
default = true
7979
}
8080

8181
variable "use_cached" {
@@ -116,15 +116,15 @@ resource "coder_script" "cmux" {
116116
PORT : var.port,
117117
LOG_PATH : var.log_path,
118118
INSTALL_PREFIX : var.install_prefix,
119-
OFFLINE : var.offline,
119+
OFFLINE : !var.install,
120120
USE_CACHED : var.use_cached,
121121
})
122122
run_on_start = true
123123

124124
lifecycle {
125125
precondition {
126-
condition = !var.offline || !var.use_cached
127-
error_message = "Offline and Use Cached can not be used together"
126+
condition = var.install || !var.use_cached
127+
error_message = "Cannot use 'use_cached' when 'install' is false"
128128
}
129129
}
130130
}

0 commit comments

Comments
 (0)