You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -219,6 +219,50 @@ coder ssh admin/<workspace> -- 'for p in $(ls /proc/ | grep "^[0-9]*$"); do fd=$
219
219
```
220
220
See Coder docs on [wildcard access URL](https://coder.com/docs/admin/setup#wildcard-access-url) for setup with your DNS/ingress.
221
221
222
+
### Kubernetes Provider Identity Tracking Bug
223
+
224
+
The `hashicorp/kubernetes` provider v2.37.0+ has a bug where `ResourceIdentity` values are written as all-nulls to Terraform state when pod creation is slow. On the next plan/apply, the provider reads actual values, detects a mismatch, and errors with `Unexpected Identity Change`.
225
+
226
+
**Affected versions:**
227
+
- v2.37.0: identity tracking on `kubernetes_config_map_v1`
228
+
- v2.38.0: identity tracking on ALL SDKv2 resources (including `kubernetes_pod_v1`) + added `sub_path_expr`
229
+
- v3.0.x: also affected (GitHub #2779)
230
+
231
+
**Why we can't downgrade:** v2.38.0 added `sub_path_expr` to the schema. Any workspace state written by v2.38.0 contains this attribute and can't be decoded by older versions. The templates stay on `~> 2.37` (resolves to v2.38.0).
232
+
233
+
**Fix for stuck workspaces:**
234
+
```bash
235
+
# 1. Pull the workspace state
236
+
coder state pull admin/<workspace> /tmp/workspace.tfstate
237
+
238
+
# 2. Fix the null identity values
239
+
python3 << 'EOF'
240
+
import json
241
+
with open('/tmp/workspace.tfstate') as f:
242
+
state = json.load(f)
243
+
for r in state.get('resources', []):
244
+
if r.get('type') == 'kubernetes_pod_v1':
245
+
for inst in r.get('instances', []):
246
+
identity = inst.get('identity')
247
+
if identity and all(v is None for v in identity.values()):
248
+
meta = inst['attributes']['metadata'][0]
249
+
inst['identity'] = {
250
+
'api_version': 'v1',
251
+
'kind': 'Pod',
252
+
'name': meta['name'],
253
+
'namespace': meta['namespace'],
254
+
}
255
+
print(f"Fixed: {meta['name']}")
256
+
with open('/tmp/workspace-fixed.tfstate', 'w') as f:
257
+
json.dump(state, f, indent=2)
258
+
EOF
259
+
260
+
# 3. Push fixed state (--no-build skips terraform validation)
261
+
coder state push --no-build admin/<workspace> /tmp/workspace-fixed.tfstate
262
+
263
+
# 4. Workspace can now be stopped/started/deleted normally
0 commit comments