diff --git a/Dockerfile b/Dockerfile index 39da5140..c3e16efa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Multi-stage build for minimal final image -FROM rust:1.89-alpine as builder +FROM rust:1.89-alpine AS builder # Install build dependencies RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static pkgconfig diff --git a/crates/redisctl/src/workflows/enterprise/init_cluster.rs b/crates/redisctl/src/workflows/enterprise/init_cluster.rs index c490a877..ff167ff8 100644 --- a/crates/redisctl/src/workflows/enterprise/init_cluster.rs +++ b/crates/redisctl/src/workflows/enterprise/init_cluster.rs @@ -62,12 +62,22 @@ impl Workflow for InitClusterWorkflow { .unwrap_or_else(|| "default-db".to_string()); let db_memory_gb = args.get_i64("database_memory_gb").unwrap_or(1); - // Create client - let client = context - .conn_mgr - .create_enterprise_client(context.profile_name.as_deref()) - .await - .context("Failed to create Enterprise client")?; + // Create unauthenticated client for bootstrap operations + // Bootstrap doesn't require auth, but we need the URL from the environment/profile + let base_url = std::env::var("REDIS_ENTERPRISE_URL") + .unwrap_or_else(|_| "https://localhost:9443".to_string()); + let insecure = std::env::var("REDIS_ENTERPRISE_INSECURE") + .unwrap_or_else(|_| "false".to_string()) + .parse::() + .unwrap_or(false); + + let client = redis_enterprise::EnterpriseClient::builder() + .base_url(base_url) + .username("") // Bootstrap doesn't require auth + .password("") // Bootstrap doesn't require auth + .insecure(insecure) + .build() + .context("Failed to create Enterprise client for bootstrap")?; // Step 1: Check if cluster is already initialized let needs_bootstrap = check_if_needs_bootstrap(&client).await?; diff --git a/docker-compose.yml b/docker-compose.yml index 1341446c..b1471d20 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,29 +21,36 @@ services: start_period: 10s # Auto-initialize Redis Enterprise cluster using our workflow - redis-enterprise-init: - image: joshrotenberg/redisctl:latest - container_name: redis-enterprise-init - depends_on: - redis-enterprise: - condition: service_healthy - networks: - - redisctl-network - environment: - REDIS_ENTERPRISE_URL: "https://redis-enterprise:9443" - REDIS_ENTERPRISE_INSECURE: "true" - command: - [ - "enterprise", - "workflow", - "init-cluster", - "--name", - "docker-cluster", - "--username", - "admin@redis.local", - "--password", - "Redis123!", - ] + # DISABLED UNTIL v0.5.1: The init-cluster workflow requires unauthenticated bootstrap fix + # which is not in v0.5.0. For now, manually initialize the cluster: + # + # docker exec redis-enterprise /opt/redislabs/bin/rladmin cluster create \ + # name docker-cluster username admin@redis.local password Redis123! + # + # Uncomment this block after v0.5.1 is released: + # redis-enterprise-init: + # image: joshrotenberg/redisctl:0.5.1 + # container_name: redis-enterprise-init + # depends_on: + # redis-enterprise: + # condition: service_healthy + # networks: + # - redisctl-network + # environment: + # REDIS_ENTERPRISE_URL: "https://redis-enterprise:9443" + # REDIS_ENTERPRISE_INSECURE: "true" + # command: + # [ + # "enterprise", + # "workflow", + # "init-cluster", + # "--name", + # "docker-cluster", + # "--username", + # "admin@redis.local", + # "--password", + # "Redis123!", + # ] networks: redisctl-network: