diff --git a/pkg/new-ui/v1beta1/frontend/src/app/pages/experiment-creation/trial-template/trial-template.component.html b/pkg/new-ui/v1beta1/frontend/src/app/pages/experiment-creation/trial-template/trial-template.component.html index d3d6588fc06..02e3ca1943b 100644 --- a/pkg/new-ui/v1beta1/frontend/src/app/pages/experiment-creation/trial-template/trial-template.component.html +++ b/pkg/new-ui/v1beta1/frontend/src/app/pages/experiment-creation/trial-template/trial-template.component.html @@ -37,7 +37,13 @@ Source Type - ConfigMap + + ConfigMap + YAML @@ -90,7 +96,7 @@ diff --git a/pkg/new-ui/v1beta1/frontend/src/app/pages/experiment-creation/trial-template/trial-template.component.ts b/pkg/new-ui/v1beta1/frontend/src/app/pages/experiment-creation/trial-template/trial-template.component.ts index 514cf405272..845d63339f1 100644 --- a/pkg/new-ui/v1beta1/frontend/src/app/pages/experiment-creation/trial-template/trial-template.component.ts +++ b/pkg/new-ui/v1beta1/frontend/src/app/pages/experiment-creation/trial-template/trial-template.component.ts @@ -18,7 +18,7 @@ export class FormTrialTemplateComponent implements OnInit, OnDestroy { public templates: ConfigMapResponse[] = []; public configmaps: ConfigMapBody[] = []; public paths: string[] = []; - public trialParameters: FormArray; + public trialParameters = new FormArray([]); private selectedConfigMap: ConfigMapBody; private subs = new Subscription(); private yamlPrv = ''; @@ -53,6 +53,12 @@ export class FormTrialTemplateComponent implements OnInit, OnDestroy { this.backend.getTrialTemplates('').subscribe(templates => { this.templates = templates.Data; this.formGroup.get('cmNamespace').setValue('kubeflow'); + + // Use the ConfigMap option if the TrialTemplates were successfully + // fetched + if (this.templates && this.templates.length) { + this.formGroup.get('type').setValue('configmap'); + } }), ); diff --git a/pkg/new-ui/v1beta1/frontend/src/app/services/experiment-form.service.ts b/pkg/new-ui/v1beta1/frontend/src/app/services/experiment-form.service.ts index cba2ee2d046..4c78ddede50 100644 --- a/pkg/new-ui/v1beta1/frontend/src/app/services/experiment-form.service.ts +++ b/pkg/new-ui/v1beta1/frontend/src/app/services/experiment-form.service.ts @@ -212,7 +212,7 @@ export class ExperimentFormService { createTrialTemplateForm(): FormGroup { return this.builder.group({ - type: 'configmap', + type: 'yaml', podLabels: this.builder.array([]), containerName: 'training-container', successCond: 'status.conditions.#(type=="Complete")#|#(status=="True")#',