Skip to content

Commit 6ffe00b

Browse files
author
deepshekhardas
committed
fix: resolve collection of CLI and UI bugs (#3168, #3105, #3139)
1 parent 4536dfe commit 6ffe00b

File tree

2 files changed

+53
-49
lines changed

2 files changed

+53
-49
lines changed

apps/webapp/app/components/RuntimeIcon.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,10 @@ export function RuntimeIcon({
2929
}: RuntimeIconProps) {
3030
const parsedRuntime = parseRuntime(runtime);
3131

32-
// Default to Node.js if no runtime is specified
33-
const effectiveRuntime = parsedRuntime || {
34-
runtime: "node" as const,
35-
originalRuntime: "node",
36-
displayName: "Node.js",
37-
};
38-
39-
const icon = getIcon(effectiveRuntime.runtime, className);
40-
const formattedText = formatRuntimeWithVersion(effectiveRuntime.originalRuntime, runtimeVersion);
32+
const icon = parsedRuntime ? getIcon(parsedRuntime.runtime, className) : <span className="text-text-dimmed"></span>;
33+
const formattedText = parsedRuntime
34+
? formatRuntimeWithVersion(parsedRuntime.originalRuntime, runtimeVersion)
35+
: "Unknown";
4136

4237
if (withLabel) {
4338
return (

packages/cli-v3/src/deploy/buildImage.ts

Lines changed: 49 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -486,47 +486,57 @@ async function localBuildImage(options: SelfHostedBuildImageOptions): Promise<Bu
486486
};
487487
}
488488

489-
const [credentialsError, credentials] = await tryCatch(
490-
getDockerUsernameAndPassword(apiClient, deploymentId)
491-
);
489+
let credentials;
490+
if (cloudRegistryHost.endsWith("amazonaws.com")) {
491+
const [credentialsError, result] = await tryCatch(
492+
getDockerUsernameAndPassword(apiClient, deploymentId)
493+
);
492494

493-
if (credentialsError) {
494-
return {
495-
ok: false as const,
496-
error: `Failed to get docker credentials: ${credentialsError.message}`,
497-
logs: "",
498-
};
495+
if (credentialsError) {
496+
return {
497+
ok: false as const,
498+
error: `Failed to get docker credentials: ${credentialsError.message}`,
499+
logs: "",
500+
};
501+
}
502+
credentials = result;
499503
}
500504

501-
logger.debug(`Logging in to docker registry: ${cloudRegistryHost}`);
505+
if (credentials) {
506+
logger.debug(`Logging in to docker registry: ${cloudRegistryHost}`);
502507

503-
const loginProcess = x(
504-
"docker",
505-
["login", "--username", credentials.username, "--password-stdin", cloudRegistryHost],
506-
{
507-
nodeOptions: {
508-
cwd: options.cwd,
509-
},
510-
}
511-
);
508+
const loginProcess = x(
509+
"docker",
510+
["login", "--username", credentials.username, "--password-stdin", cloudRegistryHost],
511+
{
512+
nodeOptions: {
513+
cwd: options.cwd,
514+
},
515+
}
516+
);
512517

513-
loginProcess.process?.stdin?.write(credentials.password);
514-
loginProcess.process?.stdin?.end();
518+
loginProcess.process?.stdin?.write(credentials.password);
519+
loginProcess.process?.stdin?.end();
515520

516-
for await (const line of loginProcess) {
517-
errors.push(line);
518-
logger.debug(line);
519-
}
521+
for await (const line of loginProcess) {
522+
errors.push(line);
523+
logger.debug(line);
524+
}
520525

521-
if (loginProcess.exitCode !== 0) {
522-
return {
523-
ok: false as const,
524-
error: `Failed to login to registry: ${cloudRegistryHost}`,
525-
logs: extractLogs(errors),
526-
};
527-
}
526+
if (loginProcess.exitCode !== 0) {
527+
return {
528+
ok: false as const,
529+
error: `Failed to login to registry: ${cloudRegistryHost}`,
530+
logs: extractLogs(errors),
531+
};
532+
}
528533

529-
options.onLog?.(`Successfully logged in to the remote registry`);
534+
options.onLog?.(`Successfully logged in to the remote registry`);
535+
} else {
536+
logger.debug(
537+
`Skipping automatic registry login for ${cloudRegistryHost}. Please ensure you are logged in locally.`
538+
);
539+
}
530540
}
531541

532542
const projectCacheRef = getProjectCacheRefFromImageTag(imageTag);
@@ -550,13 +560,12 @@ async function localBuildImage(options: SelfHostedBuildImageOptions): Promise<Bu
550560
options.noCache ? "--no-cache" : undefined,
551561
...(useRegistryCache
552562
? [
553-
"--cache-to",
554-
`type=registry,mode=max,image-manifest=true,oci-mediatypes=true,ref=${projectCacheRef}${
555-
cacheCompression === "zstd" ? ",compression=zstd" : ""
556-
}`,
557-
"--cache-from",
558-
`type=registry,ref=${projectCacheRef}`,
559-
]
563+
"--cache-to",
564+
`type=registry,mode=max,image-manifest=true,oci-mediatypes=true,ref=${projectCacheRef}${cacheCompression === "zstd" ? ",compression=zstd" : ""
565+
}`,
566+
"--cache-from",
567+
`type=registry,ref=${projectCacheRef}`,
568+
]
560569
: []),
561570
"--output",
562571
outputOptions.join(","),

0 commit comments

Comments
 (0)