Skip to content

Commit

Permalink
fix service validation error (#4335)
Browse files Browse the repository at this point in the history
  • Loading branch information
Feroze Mohideen authored Feb 27, 2024
1 parent 4a7c824 commit 0f5f5a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,8 @@ const CreateApp: React.FC<CreateAppProps> = ({ history }) => {
// TODO: create a more unified way of parsing form/apply errors, unified with the logic in AppDataContainer
const errorKeys = Object.keys(errors);
if (errorKeys.length > 0) {
const stringifiedJson = JSON.stringify(errors);

let errorMessage = "App could not be deployed as defined.";
if (errorKeys.includes("app")) {
const appErrors = Object.keys(errors.app ?? {});
Expand All @@ -431,7 +433,7 @@ const CreateApp: React.FC<CreateAppProps> = ({ history }) => {

void updateAppStep({
step: "stack-launch-failure",
errorMessage: `Form validation error: ${errorMessage}`,
errorMessage: `Form validation error (visible to user): ${errorMessage}. Stringified JSON errors (invisible to user): ${stringifiedJson}`,
appName: name.value,
});

Expand Down
17 changes: 5 additions & 12 deletions dashboard/src/shared/ClusterResourcesContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const ClusterResourcesProvider = ({
}): JSX.Element => {
const { currentCluster, currentProject } = useContext(Context);

var {
const {
maxCPU,
maxRAM,
defaultCPU,
Expand All @@ -56,21 +56,14 @@ const ClusterResourcesProvider = ({
clusterStatus: currentCluster?.status,
});

if (currentProject?.sandbox_enabled) {
defaultCPU = 0.1
defaultRAM = 120
maxRAM = 250
maxCPU = 0.2
}

return (
<ClusterResourcesContext.Provider
value={{
currentClusterResources: {
maxCPU,
maxRAM,
defaultCPU,
defaultRAM,
maxCPU: currentProject?.sandbox_enabled ? 0.2 : maxCPU,
maxRAM: currentProject?.sandbox_enabled ? 250 : maxRAM,
defaultCPU: currentProject?.sandbox_enabled ? 0.1 : defaultCPU,
defaultRAM: currentProject?.sandbox_enabled ? 120 : defaultRAM,
maxGPU,
clusterContainsGPUNodes,
clusterIngressIp,
Expand Down

0 comments on commit 0f5f5a3

Please sign in to comment.