hackerrun 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/lib/cluster.ts +6 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hackerrun",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "CLI tool to create and manage VMs using Ubicloud API",
5
5
  "type": "module",
6
6
  "bin": {
@@ -366,12 +366,6 @@ export class ClusterManager {
366
366
  const setupScript = `#!/bin/bash
367
367
  set -e
368
368
 
369
- # Install jq if not present (needed to merge Docker config)
370
- if ! command -v jq &> /dev/null; then
371
- apt-get update -qq
372
- apt-get install -y -qq jq
373
- fi
374
-
375
369
  # Step 1: Add IPv6 support to Docker daemon config
376
370
  DAEMON_JSON='/etc/docker/daemon.json'
377
371
  if [ -f "$DAEMON_JSON" ]; then
@@ -412,13 +406,11 @@ systemctl restart docker
412
406
  sleep 3
413
407
 
414
408
  # Step 4: Recreate uncloud network with IPv6 enabled
415
- # Must stop containers first - can't remove network while containers are attached
416
409
  CONTAINERS=$(docker ps -aq --filter network=uncloud 2>/dev/null || true)
417
410
 
418
- if [ -n "$CONTAINERS" ]; then
419
- echo "Stopping containers on uncloud network..."
420
- docker stop $CONTAINERS 2>/dev/null || true
421
- fi
411
+ for container in $CONTAINERS; do
412
+ docker network disconnect uncloud "$container" 2>/dev/null || true
413
+ done
422
414
 
423
415
  docker network rm uncloud 2>/dev/null || true
424
416
  docker network create --driver bridge \
@@ -426,10 +418,9 @@ docker network create --driver bridge \
426
418
  --ipv6 --subnet fd00:a10:210::/64 --gateway fd00:a10:210::1 \
427
419
  uncloud
428
420
 
429
- if [ -n "$CONTAINERS" ]; then
430
- echo "Restarting containers..."
431
- docker start $CONTAINERS 2>/dev/null || true
432
- fi
421
+ for container in $CONTAINERS; do
422
+ docker network connect uncloud "$container" 2>/dev/null || true
423
+ done
433
424
 
434
425
  # Step 5: Start the iptables service
435
426
  systemctl start docker-ipv6-nat64