|
@@ -30,9 +30,11 @@ type PorterYamlStatus =
|
|
|
*/
|
|
*/
|
|
|
export const usePorterYaml = ({
|
|
export const usePorterYaml = ({
|
|
|
source,
|
|
source,
|
|
|
|
|
+ appName = "",
|
|
|
useDefaults = true,
|
|
useDefaults = true,
|
|
|
}: {
|
|
}: {
|
|
|
source: (SourceOptions & { type: "github" }) | null;
|
|
source: (SourceOptions & { type: "github" }) | null;
|
|
|
|
|
+ appName?: string;
|
|
|
useDefaults?: boolean;
|
|
useDefaults?: boolean;
|
|
|
}): PorterYamlStatus => {
|
|
}): PorterYamlStatus => {
|
|
|
const { currentProject, currentCluster } = useContext(Context);
|
|
const { currentProject, currentCluster } = useContext(Context);
|
|
@@ -93,17 +95,19 @@ export const usePorterYaml = ({
|
|
|
const detectServices = useCallback(
|
|
const detectServices = useCallback(
|
|
|
async ({
|
|
async ({
|
|
|
b64Yaml,
|
|
b64Yaml,
|
|
|
|
|
+ appName,
|
|
|
projectId,
|
|
projectId,
|
|
|
clusterId,
|
|
clusterId,
|
|
|
}: {
|
|
}: {
|
|
|
b64Yaml: string;
|
|
b64Yaml: string;
|
|
|
|
|
+ appName: string;
|
|
|
projectId: number;
|
|
projectId: number;
|
|
|
clusterId: number;
|
|
clusterId: number;
|
|
|
}) => {
|
|
}) => {
|
|
|
try {
|
|
try {
|
|
|
const res = await api.parsePorterYaml(
|
|
const res = await api.parsePorterYaml(
|
|
|
"<token>",
|
|
"<token>",
|
|
|
- { b64_yaml: b64Yaml },
|
|
|
|
|
|
|
+ { b64_yaml: b64Yaml, app_name: appName},
|
|
|
{
|
|
{
|
|
|
project_id: projectId,
|
|
project_id: projectId,
|
|
|
cluster_id: clusterId,
|
|
cluster_id: clusterId,
|
|
@@ -147,6 +151,7 @@ export const usePorterYaml = ({
|
|
|
if (data) {
|
|
if (data) {
|
|
|
detectServices({
|
|
detectServices({
|
|
|
b64Yaml: data,
|
|
b64Yaml: data,
|
|
|
|
|
+ appName: appName,
|
|
|
projectId: currentProject.id,
|
|
projectId: currentProject.id,
|
|
|
clusterId: currentCluster.id,
|
|
clusterId: currentCluster.id,
|
|
|
});
|
|
});
|