diff --git a/control-plane/agents/src/bin/core/tests/controller/mod.rs b/control-plane/agents/src/bin/core/tests/controller/mod.rs index 099d0e807..446846937 100644 --- a/control-plane/agents/src/bin/core/tests/controller/mod.rs +++ b/control-plane/agents/src/bin/core/tests/controller/mod.rs @@ -83,14 +83,14 @@ async fn store_lease_lock() { let lease_ttl = std::time::Duration::from_secs(2); let _core_agent = Etcd::new_leased( - ["0.0.0.0:2379"], + ["[::]:2379"], ControlPlaneService::CoreAgent.to_string(), lease_ttl, ) .await .unwrap(); - let mut store = Client::connect(["0.0.0.0:2379"], None) + let mut store = Client::connect(["[::]:2379"], None) .await .expect("Failed to connect to etcd."); @@ -100,7 +100,7 @@ async fn store_lease_lock() { tokio::time::sleep(lease_ttl).await; - let mut etcd = Etcd::new("0.0.0.0:2379").await.unwrap(); + let mut etcd = Etcd::new("[::]:2379").await.unwrap(); let svc = ControlPlaneService::CoreAgent; let obj: StoreLeaseOwner = etcd .get_obj(&StoreLeaseOwnerKey::new(&svc)) @@ -114,7 +114,7 @@ async fn store_lease_lock() { ); let _core_agent2 = Etcd::new_leased( - ["0.0.0.0:2379"], + ["[::]:2379"], ControlPlaneService::CoreAgent.to_string(), lease_ttl, ) @@ -134,7 +134,7 @@ async fn core_agent_lease_lock() { .await .unwrap(); - let mut store = Client::connect(["0.0.0.0:2379"], None) + let mut store = Client::connect(["[::]:2379"], None) .await .expect("Failed to connect to etcd."); @@ -144,7 +144,7 @@ async fn core_agent_lease_lock() { tokio::time::sleep(lease_ttl).await; - let mut etcd = Etcd::new("0.0.0.0:2379").await.unwrap(); + let mut etcd = Etcd::new("[::]:2379").await.unwrap(); let svc = ControlPlaneService::CoreAgent; let obj: StoreLeaseOwner = etcd .get_obj(&StoreLeaseOwnerKey::new(&svc)) @@ -158,7 +158,7 @@ async fn core_agent_lease_lock() { ); let _core_agent2 = Etcd::new_leased( - ["0.0.0.0:2379"], + ["[::]:2379"], ControlPlaneService::CoreAgent.to_string(), lease_ttl, ) @@ -192,7 +192,7 @@ async fn core_agent_lease_lock() { tokio::time::sleep(lease_ttl_wait).await; let _core_agent2 = Etcd::new_leased( - ["0.0.0.0:2379"], + ["[::]:2379"], ControlPlaneService::CoreAgent.to_string(), lease_ttl, ) @@ -229,7 +229,7 @@ async fn etcd_pagination() { .await .unwrap(); - let mut etcd = Etcd::new("0.0.0.0:2379").await.unwrap(); + let mut etcd = Etcd::new("[::]:2379").await.unwrap(); let node_prefix = key_prefix_obj(StorableObjectType::NodeSpec, ApiVersion::V0); let volume_prefix = key_prefix_obj(StorableObjectType::VolumeSpec, ApiVersion::V0); diff --git a/control-plane/agents/src/bin/core/tests/pool/mod.rs b/control-plane/agents/src/bin/core/tests/pool/mod.rs index b72127a3f..0965978ca 100644 --- a/control-plane/agents/src/bin/core/tests/pool/mod.rs +++ b/control-plane/agents/src/bin/core/tests/pool/mod.rs @@ -951,7 +951,7 @@ async fn test_disown_missing_replica_owners() { // Modify the replica spec in the store so that the replica has a volume and nexus owner; // neither of which exist. - let mut etcd = Etcd::new("0.0.0.0:2379").await.unwrap(); + let mut etcd = Etcd::new("[::]:2379").await.unwrap(); let mut replica: ReplicaSpec = etcd .get_obj(&ReplicaSpecKey::from(&replica_id)) .await diff --git a/control-plane/agents/src/bin/core/tests/volume/hotspare.rs b/control-plane/agents/src/bin/core/tests/volume/hotspare.rs index 53df2602e..80279e3e4 100644 --- a/control-plane/agents/src/bin/core/tests/volume/hotspare.rs +++ b/control-plane/agents/src/bin/core/tests/volume/hotspare.rs @@ -297,7 +297,7 @@ async fn hotspare_replica_count_spread(cluster: &Cluster) { // by increasing the replica count from 1 to `replica_count` under the core agent cluster.composer().stop("core").await.unwrap(); - let mut store = Etcd::new("0.0.0.0:2379") + let mut store = Etcd::new("[::]:2379") .await .expect("Failed to connect to etcd."); @@ -463,7 +463,7 @@ async fn hotspare_nexus_replica_count(cluster: &Cluster) { .with_max_retries(10) .with_req_timeout(Duration::from_millis(500)) .with_timeout_backoff(Duration::from_millis(50)); - let mut store = Etcd::new("0.0.0.0:2379") + let mut store = Etcd::new("[::]:2379") .await .expect("Failed to connect to etcd."); diff --git a/control-plane/agents/src/bin/core/tests/volume/mod.rs b/control-plane/agents/src/bin/core/tests/volume/mod.rs index 977719236..4c1bf5450 100644 --- a/control-plane/agents/src/bin/core/tests/volume/mod.rs +++ b/control-plane/agents/src/bin/core/tests/volume/mod.rs @@ -146,7 +146,7 @@ async fn nexus_persistence_test_iteration( .await .unwrap(); - let mut store = Etcd::new("0.0.0.0:2379") + let mut store = Etcd::new("[::]:2379") .await .expect("Failed to connect to etcd."); let mut nexus_info: NexusInfo = store diff --git a/control-plane/agents/src/bin/core/tests/watch/mod.rs b/control-plane/agents/src/bin/core/tests/watch/mod.rs index f78dacfbd..c661462ef 100644 --- a/control-plane/agents/src/bin/core/tests/watch/mod.rs +++ b/control-plane/agents/src/bin/core/tests/watch/mod.rs @@ -83,7 +83,7 @@ async fn watch() { let watches = client.get_watch_volume(&volume.spec().uuid).await.unwrap(); assert!(watches.is_empty()); - let mut store = Etcd::new("0.0.0.0:2379") + let mut store = Etcd::new("[::]:2379") .await .expect("Failed to connect to etcd."); diff --git a/control-plane/csi-driver/src/bin/node/main_.rs b/control-plane/csi-driver/src/bin/node/main_.rs index f87ba68d3..cb245e768 100644 --- a/control-plane/csi-driver/src/bin/node/main_.rs +++ b/control-plane/csi-driver/src/bin/node/main_.rs @@ -133,7 +133,7 @@ pub(super) async fn main() -> anyhow::Result<()> { .long("grpc-endpoint") .value_name("ENDPOINT") .help("ip address where this instance runs, and optionally the gRPC port") - .default_value("0.0.0.0") + .default_value("[::]") .required(false) ) .arg( @@ -440,7 +440,7 @@ fn validate_endpoints( // sent in registration request. if registration_enabled && grpc_endpoint_url.ip().is_unspecified() { return Err(anyhow::format_err!( - "gRPC endpoint: `0.0.0.0` is not allowed if registration is enabled" + "gRPC endpoint: `[::]`/`0.0.0.0` is not allowed if registration is enabled" )); } Ok(grpc_endpoint_url) diff --git a/control-plane/csi-driver/src/bin/node/shutdown_event.rs b/control-plane/csi-driver/src/bin/node/shutdown_event.rs index 5ca9a9e64..6ea15a27b 100644 --- a/control-plane/csi-driver/src/bin/node/shutdown_event.rs +++ b/control-plane/csi-driver/src/bin/node/shutdown_event.rs @@ -90,7 +90,7 @@ mod tests { tokio::spawn(async move { if let Err(e) = Server::builder() .add_service(NodePluginServer::new(NodePluginSvc::new(first_sender))) - .serve_with_shutdown("0.0.0.0:50011".parse().unwrap(), wait(shutdown_receiver)) + .serve_with_shutdown("[::]:50011".parse().unwrap(), wait(shutdown_receiver)) .await { panic!("gRPC server failed with error: {e}"); @@ -98,7 +98,7 @@ mod tests { }); tokio::time::sleep(Duration::from_millis(250)).await; let channel = - tonic::transport::Endpoint::from(Uri::from_str("https://0.0.0.0:50011").unwrap()) + tonic::transport::Endpoint::from(Uri::from_str("https://[::]:50011").unwrap()) .connect() .await .unwrap(); diff --git a/control-plane/rest/service/src/main.rs b/control-plane/rest/service/src/main.rs index c07f3b485..cfd2da101 100644 --- a/control-plane/rest/service/src/main.rs +++ b/control-plane/rest/service/src/main.rs @@ -17,8 +17,8 @@ use utils::DEFAULT_GRPC_CLIENT_ADDR; #[structopt(name = utils::package_description!(), version = utils::version_info_str!())] pub(crate) struct CliArgs { /// The bind address for the REST interface (with HTTPS) - /// Default: 0.0.0.0:8080 - #[clap(long, default_value = "0.0.0.0:8080")] + /// Default: [::]:8080 + #[clap(long, default_value = "[::]:8080")] https: String, /// The bind address for the REST interface (with HTTP) #[clap(long)] diff --git a/deployer/src/infra/agents/ha/cluster.rs b/deployer/src/infra/agents/ha/cluster.rs index 239fcacea..5155c2499 100644 --- a/deployer/src/infra/agents/ha/cluster.rs +++ b/deployer/src/infra/agents/ha/cluster.rs @@ -12,7 +12,7 @@ impl ComponentAction for HaClusterAgent { fn configure(&self, options: &StartOptions, cfg: Builder) -> Result { let mut spec = ContainerSpec::from_binary( "agent-ha-cluster", - Binary::from_dbg("agent-ha-cluster").with_args(vec!["-g=0.0.0.0:11500"]), + Binary::from_dbg("agent-ha-cluster").with_args(vec!["-g=[::]:11500"]), ) .with_portmap("11500", "11500"); diff --git a/deployer/src/infra/etcd.rs b/deployer/src/infra/etcd.rs index 73ff3ebe3..74763c4d4 100644 --- a/deployer/src/infra/etcd.rs +++ b/deployer/src/infra/etcd.rs @@ -12,9 +12,9 @@ impl ComponentAction for Etcd { "--data-dir", "/tmp/etcd-data", "--advertise-client-urls", - "http://0.0.0.0:2379", + "http://[::]:2379", "--listen-client-urls", - "http://0.0.0.0:2379", + "http://[::]:2379", // these ensure fast startup since it's not a cluster anyway "--heartbeat-interval=1", "--election-timeout=5", @@ -38,7 +38,7 @@ impl ComponentAction for Etcd { } async fn wait_on(&self, options: &StartOptions, _cfg: &ComposeTest) -> Result<(), Error> { if !options.no_etcd { - let _store = EtcdStore::new("0.0.0.0:2379") + let _store = EtcdStore::new("[::]:2379") .await .expect("Failed to connect to etcd."); } diff --git a/tests/bdd/features/csi/node/test_parameters.py b/tests/bdd/features/csi/node/test_parameters.py index b5dfad116..461d505bd 100644 --- a/tests/bdd/features/csi/node/test_parameters.py +++ b/tests/bdd/features/csi/node/test_parameters.py @@ -138,7 +138,7 @@ def monitor(proc, result): "sudo", os.environ["WORKSPACE_ROOT"] + "/target/debug/csi-node", "--csi-socket=/var/tmp/csi-node.sock", - "--grpc-endpoint=0.0.0.0:50050", + "--grpc-endpoint=[::]:50050", "--node-name=msn-test", "--nvme-io-timeout=33s", f"--nvme-nr-io-queues={io_queues}", diff --git a/tests/bdd/features/ha/cluster-agent/test_cluster_agent.py b/tests/bdd/features/ha/cluster-agent/test_cluster_agent.py index 381dfc7ba..3963fbad0 100644 --- a/tests/bdd/features/ha/cluster-agent/test_cluster_agent.py +++ b/tests/bdd/features/ha/cluster-agent/test_cluster_agent.py @@ -59,7 +59,7 @@ def the_request_should_be_failed(context): def cluster_agent_rpc_handle(): - return ClusterAgentHandle("0.0.0.0:11500") + return ClusterAgentHandle("[::]:11500") @pytest.fixture(scope="module") @@ -77,7 +77,7 @@ def context(): @pytest.fixture def register_node_agent(context): hdl = cluster_agent_rpc_handle() - req = pb.HaNodeInfo(nodename="test", endpoint="0.0.0.0:1111") + req = pb.HaNodeInfo(nodename="test", endpoint="[::]:1111") context["attempt"] = hdl.api.RegisterNodeAgent(req) diff --git a/utils/deployer-cluster/src/lib.rs b/utils/deployer-cluster/src/lib.rs index 1a275a7f6..c5b0f4abb 100644 --- a/utils/deployer-cluster/src/lib.rs +++ b/utils/deployer-cluster/src/lib.rs @@ -393,7 +393,7 @@ impl Cluster { /// remove etcd store lock for `name` instance pub async fn remove_store_lock(&self, name: ControlPlaneService) { - let mut store = etcd_client::Client::connect(["0.0.0.0:2379"], None) + let mut store = etcd_client::Client::connect(["[::]:2379"], None) .await .expect("Failed to connect to etcd."); store diff --git a/utils/pstor-usage/src/simulation.rs b/utils/pstor-usage/src/simulation.rs index a5c4b145e..a44c9ba8e 100644 --- a/utils/pstor-usage/src/simulation.rs +++ b/utils/pstor-usage/src/simulation.rs @@ -165,7 +165,7 @@ impl Simulation { }; let cleanup = cluster.is_none() || self.total_stats; - let etcd = Etcd::new(Url::parse("http://0.0.0.0:2379")?).await?; + let etcd = Etcd::new(Url::parse("http://[::]:2379")?).await?; // create some pools as backing for the volumes let four_mb = 4096 * 1024; diff --git a/utils/pstor/src/tests/etcd.rs b/utils/pstor/src/tests/etcd.rs index 3a1dab799..025964459 100644 --- a/utils/pstor/src/tests/etcd.rs +++ b/utils/pstor/src/tests/etcd.rs @@ -10,7 +10,7 @@ use std::{ }; use tokio::task::JoinHandle; -static ETCD_ENDPOINT: &str = "0.0.0.0:2379"; +static ETCD_ENDPOINT: &str = "[::]:2379"; #[derive(Serialize, Deserialize, Debug, PartialEq)] struct TestStruct { @@ -30,9 +30,9 @@ async fn etcd() { "--data-dir", "/tmp/etcd-data", "--advertise-client-urls", - "http://0.0.0.0:2379", + "http://[::]:2379", "--listen-client-urls", - "http://0.0.0.0:2379", + "http://[::]:2379", ]), ) .with_portmap("2379", "2379") diff --git a/utils/utils-lib/src/constants.rs b/utils/utils-lib/src/constants.rs index 42c063c32..1f0ff6a70 100644 --- a/utils/utils-lib/src/constants.rs +++ b/utils/utils-lib/src/constants.rs @@ -83,13 +83,13 @@ pub const LOKI_LABEL: &str = "app=loki"; pub const LOKI_PORT: &str = "http-metrics"; /// The default value to be assigned as GRPC server addr if not overridden. -pub const DEFAULT_GRPC_SERVER_ADDR: &str = "0.0.0.0:50051"; +pub const DEFAULT_GRPC_SERVER_ADDR: &str = "[::]:50051"; /// The default value to be assigned as GRPC client addr if not overridden. pub const DEFAULT_GRPC_CLIENT_ADDR: &str = "https://core:50051"; /// The default value to be assigned as JSON GRPC server addr if not overridden. -pub const DEFAULT_JSON_GRPC_SERVER_ADDR: &str = "0.0.0.0:50052"; +pub const DEFAULT_JSON_GRPC_SERVER_ADDR: &str = "[::]:50052"; /// The default value to be assigned as JSON GRPC client addr if not overridden. pub const DEFAULT_JSON_GRPC_CLIENT_ADDR: &str = "https://jsongrpc:50052"; @@ -98,13 +98,13 @@ pub const DEFAULT_JSON_GRPC_CLIENT_ADDR: &str = "https://jsongrpc:50052"; pub const DEFAULT_GRPC_CLIENT_CONCURRENCY: usize = 25; /// The default value to be assigned as cluster agent GRPC server addr if not overridden. -pub const DEFAULT_CLUSTER_AGENT_SERVER_ADDR: &str = "0.0.0.0:11500"; +pub const DEFAULT_CLUSTER_AGENT_SERVER_ADDR: &str = "[::]:11500"; /// The default value to be assigned as cluster agent GRPC client addr if not overridden. pub const DEFAULT_CLUSTER_AGENT_CLIENT_ADDR: &str = "https://agent-ha-cluster:11500"; /// The default value to be assigned as node-agent GRPC server addr if not overridden. -pub const DEFAULT_NODE_AGENT_SERVER_ADDR: &str = "0.0.0.0:11600"; +pub const DEFAULT_NODE_AGENT_SERVER_ADDR: &str = "[::]:11600"; /// The default worker threads cap for the api-rest service. pub const DEFAULT_REST_MAX_WORKER_THREADS: &str = "8";