Skip to content

Commit 572df9a

Browse files
committed
valkey changes for correct service config
1 parent 9462a20 commit 572df9a

File tree

5 files changed

+25
-17
lines changed

5 files changed

+25
-17
lines changed

src/Compose/ProductionBuilder/Service/Valkey.php

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,30 @@ public function getServiceName(): string
5050
* @inheritDoc
5151
*/
5252
public function getConfig(Config $config): array
53-
{
54-
return $this->serviceFactory->create(
55-
$this->getServiceName(),
56-
$config->getServiceVersion($this->getServiceName()),
57-
[
53+
{
54+
$configArray = $this->serviceFactory->create(
55+
$this->getServiceName(),
56+
$config->getServiceVersion($this->getServiceName()),
57+
[
5858
BuilderInterface::SERVICE_HEALTHCHECK => [
59-
'test' => 'valkey-cli ping || exit 1',
60-
'interval' => '30s',
61-
'timeout' => '30s',
62-
'retries' => 3
59+
'test' => 'valkey-cli ping || exit 1',
60+
'interval' => '30s',
61+
'timeout' => '30s',
62+
'retries' => 3
6363
]
64-
],
65-
$config->getServiceImage($this->getServiceName()),
66-
$config->getCustomRegistry()
64+
],
65+
$config->getServiceImage($this->getServiceName()),
66+
$config->getCustomRegistry()
6767
);
68-
}
68+
69+
// Set both 'cache' and 'valkey.magento2.docker' as aliases unconditionally
70+
$configArray['networks'][BuilderInterface::NETWORK_MAGENTO]['aliases'] = [
71+
'cache',
72+
'valkey.magento2.docker'
73+
];
74+
75+
return $configArray;
76+
}
6977

7078
/**
7179
* @inheritDoc

src/Config/Relationship.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class Relationship
5757
],
5858
'valkey' => [
5959
[
60-
'host' => 'valkey',
60+
'host' => 'cache',
6161
'port' => '6379'
6262
]
6363
],

src/Config/Source/CliSource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class CliSource implements SourceInterface
2727
public const OPTION_EXPOSE_DB_QUOTE_PORT = 'expose-db-quote-port';
2828
public const OPTION_EXPOSE_DB_SALES_PORT = 'expose-db-sales-port';
2929
public const OPTION_REDIS = 'redis';
30-
public const OPTION_VALKEY = 'cache';
30+
public const OPTION_VALKEY = 'valkey';
3131
public const OPTION_ES = 'es';
3232
public const OPTION_OS = 'os';
3333
public const OPTION_RABBIT_MQ = 'rmq';

src/Config/Source/CloudSource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class CloudSource implements SourceInterface
4747
ServiceInterface::SERVICE_ELASTICSEARCH => ['elasticsearch', 'es'],
4848
ServiceInterface::SERVICE_OPENSEARCH => ['opensearch', 'os'],
4949
ServiceInterface::SERVICE_REDIS => ['redis'],
50-
ServiceInterface::SERVICE_VALKEY => ['cache'],
50+
ServiceInterface::SERVICE_VALKEY => ['cache','valkey'],
5151
ServiceInterface::SERVICE_RABBITMQ => ['rmq', 'rabbitmq']
5252
];
5353

src/Service/ServiceInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ interface ServiceInterface
2323
public const SERVICE_DB_SALES = 'mysql-sales';
2424
public const SERVICE_NGINX = 'nginx';
2525
public const SERVICE_REDIS = 'redis';
26-
public const SERVICE_VALKEY = 'cache';
26+
public const SERVICE_VALKEY = 'valkey';
2727
public const SERVICE_ELASTICSEARCH = 'elasticsearch';
2828
public const SERVICE_OPENSEARCH = 'opensearch';
2929
public const SERVICE_RABBITMQ = 'rabbitmq';

0 commit comments

Comments
 (0)