Skip to content

Commit

Permalink
pipe in correct env vars when creating app from docker img (#4013)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianedwards authored Nov 22, 2023
1 parent c0b33d7 commit 3a178b9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions dashboard/src/main/home/app-dashboard/create-app/CreateApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const CreateApp: React.FC<CreateAppProps> = ({ history }) => {
React.useState<PorterApp | null>(null);
const [isDeploying, setIsDeploying] = React.useState(false);
const [deployError, setDeployError] = React.useState("");
const [{ variables, secrets }, setFinalizedAppEnv] = React.useState<{
const [appEnv, setFinalizedAppEnv] = React.useState<{
variables: Record<string, string>;
secrets: Record<string, string>;
}>({
Expand Down Expand Up @@ -254,11 +254,15 @@ const CreateApp: React.FC<CreateAppProps> = ({ history }) => {
projectID,
clusterID,
deploymentTargetID,
variables,
secrets,
}: {
app: PorterApp;
projectID: number;
clusterID: number;
deploymentTargetID: string;
variables: Record<string, string>;
secrets: Record<string, string>;
}): Promise<void> => {
await api.createApp(
"<token>",
Expand Down Expand Up @@ -346,6 +350,8 @@ const CreateApp: React.FC<CreateAppProps> = ({ history }) => {
projectID: currentProject.id,
clusterID: currentCluster.id,
deploymentTargetID: deploymentTarget.deployment_target_id,
variables,
secrets,
});
}

Expand Down Expand Up @@ -786,8 +792,8 @@ const CreateApp: React.FC<CreateAppProps> = ({ history }) => {
await createAndApply({
app: validatedAppProto,
source,
variables,
secrets,
variables: appEnv.variables,
secrets: appEnv.secrets,
})
}
deploymentError={deployError}
Expand Down

0 comments on commit 3a178b9

Please sign in to comment.