refactor: set the registry url in image in case we have a registry asociated

This commit is contained in:
Mauricio Siu
2024-05-13 03:15:09 -06:00
parent c45017e204
commit d19dec8010
5 changed files with 21 additions and 4 deletions

View File

@@ -41,7 +41,7 @@ export const ShowCluster = () => {
{worker.Spec.Availability}
</span>
<span className="text-sm text-muted-foreground">
{worker.ManagerStatus.Reachability}
{worker?.ManagerStatus?.Reachability || "-"}
</span>
<span className="text-sm text-muted-foreground">
{worker?.Spec?.Role}

View File

@@ -12,8 +12,8 @@ export default function Custom404({ statusCode }: Props) {
<div className="container mx-auto h-screen items-center justify-center flex">
<div className="-mx-4 flex">
<div className="w-full px-4">
<div className="mx-auto max-w-[400px] text-center">
<h2 className="mb-2 text-[50px] font-bold leading-none text-white sm:text-[80px] md:text-[100px]">
<div className="mx-auto max-w-[700px] text-center">
<h2 className="mb-2 text-[50px] font-bold leading-none text-white sm:text-[80px]">
{statusCode
? `An error ${statusCode} occurred on server`
: "An error occurred on client"}

View File

@@ -64,6 +64,7 @@ export const registryRouter = createTRPCRouter({
return true;
} catch (error) {
console.log(error);
return false;
}
}),

View File

@@ -238,3 +238,4 @@ export const settingsRouter = createTRPCRouter({
return readConfigInPath(input.path);
}),
});
// apt-get install apache2-utils

View File

@@ -81,16 +81,31 @@ export const mechanizeDockerContainer = async (
cpuLimit,
cpuReservation,
});
const volumesMount = generateVolumeMounts(mounts);
const bindsMount = generateBindMounts(mounts);
const filesMount = generateFileMounts(appName, mounts);
const envVariables = prepareEnvironmentVariables(env);
const registry = application.registry;
const image =
sourceType === "docker"
? dockerImage!
: registry
? `${registry.registryUrl}/${appName}`
: `${appName}:latest`;
const settings: CreateServiceOptions = {
authconfig: {
password: registry?.password || "",
username: registry?.username || "",
serveraddress: registry?.registryUrl || "",
},
Name: appName,
TaskTemplate: {
ContainerSpec: {
Image: sourceType === "docker" ? dockerImage! : `${appName}:latest`,
Image: image,
Env: envVariables,
Mounts: [...volumesMount, ...bindsMount, ...filesMount],
...(command