private handleLaunchDraftWorkflow()

in src/panels/draft/DraftDeploymentPanel.ts [308:337]


    private handleLaunchDraftWorkflow(params: LaunchDraftWorkflowParams) {
        const dockerfilePath = path.join(params.deploymentLocation, "Dockerfile");
        const dockerfileExists = fs.existsSync(path.join(this.workspaceFolder.uri.fsPath, dockerfilePath));
        const existingFiles = getExistingFiles(this.workspaceFolder, params.deploymentLocation, this.deploymentFiles);
        const helmChartYamlFilePath = existingFiles.helm.find((f) => path.basename(f) === "Chart.yaml");
        const helmChartPath = helmChartYamlFilePath ? path.dirname(helmChartYamlFilePath) : undefined;
        const helmValuesYamlPath = existingFiles.helm.find((f) => path.basename(f) === "values.yaml");
        launchDraftCommand("aks.draftWorkflow", {
            workspaceFolder: this.workspaceFolder,
            initialSelection: {
                subscriptionId: params.initialSubscriptionId || undefined,
                acrResourceGroup: params.initialAcrResourceGroup || undefined,
                acrName: params.initialAcrName || undefined,
                acrRepository: params.initialAcrRepository || undefined,
                clusterResourceGroup: params.initialClusterResourceGroup || undefined,
                clusterName: params.initialClusterName || undefined,
                clusterNamespace: params.initialClusterNamespace || undefined,
                dockerfileBuildContextPath: dockerfileExists ? params.deploymentLocation : undefined,
                dockerfilePath: dockerfileExists ? dockerfilePath : undefined,
                deploymentSpecType:
                    // Only helm and manifests are supported for now
                    params.initialDeploymentSpecType === "manifests" || params.initialDeploymentSpecType === "helm"
                        ? params.initialDeploymentSpecType
                        : undefined,
                helmChartPath,
                helmValuesYamlPath,
                manifestFilePaths: existingFiles.manifests,
            },
        });
    }