fix(pvc): explicitly use RWX

This commit is contained in:
2026-08-09 15:32:55 +07:00 Unverified
parent a0abaf05b9
commit ed7ee7a113
+10 -7
View File
@@ -54,9 +54,7 @@ function toPortNumber(value: number | string | undefined): number | undefined {
function toReplicaCount(service: Service): number {
return (
toPortNumber(service.scale) ??
toPortNumber(service.deploy?.replicas) ??
1
toPortNumber(service.scale) ?? toPortNumber(service.deploy?.replicas) ?? 1
);
}
@@ -193,7 +191,9 @@ function toMount(
: `${entry.type}-${toKubeName(entry.source) || index}`
: `${entry.type}-${index}`,
kind:
entry.type === "bind" && entry.source && isConfigFileSource(entry.source, cwd)
entry.type === "bind" &&
entry.source &&
isConfigFileSource(entry.source, cwd)
? "config-file"
: entry.type,
source: entry.source,
@@ -356,7 +356,9 @@ function toPorts(service: Service): NormalizedPort[] {
);
}
function toContainerPorts(ports: NormalizedPort[]): V1ContainerPort[] | undefined {
function toContainerPorts(
ports: NormalizedPort[],
): V1ContainerPort[] | undefined {
if (ports.length === 0) return;
return ports.map((port) => ({
@@ -612,7 +614,7 @@ export function volumesToPvc(
labels: LABELS,
},
spec: {
accessModes: ["ReadWriteOnce"],
accessModes: ["ReadWriteMany"],
resources: {
requests: {
storage: "1Gi",
@@ -633,7 +635,8 @@ export function volumesToConfigMaps(
const configMaps = new Map<string, V1ConfigMap>();
for (const mount of toMounts(service, cwd)) {
if (mount.kind !== "config-file" || !mount.source || !mount.configKey) continue;
if (mount.kind !== "config-file" || !mount.source || !mount.configKey)
continue;
const sourcePath = resolveSourcePath(mount.source, cwd);
configMaps.set(mount.name, {