fix(ui): Parameters tab should correctly show dry source parameters (#26179)

Signed-off-by: Jonathan Winters <wintersjonathan0@gmail.com>
Signed-off-by: jwinters01 <34199886+jwinters01@users.noreply.github.com>
Co-authored-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
This commit is contained in:
jwinters01
2026-02-10 13:38:23 -08:00
committed by GitHub
parent a76a8762e4
commit 971bf5769a
3 changed files with 21 additions and 3 deletions

View File

@@ -28,7 +28,7 @@ import {ImageTagFieldEditor} from './kustomize';
import * as kustomize from './kustomize-image';
import {VarsInputField} from './vars-input-field';
import {concatMaps} from '../../../shared/utils';
import {deleteSourceAction, getAppDefaultSource, helpTip} from '../utils';
import {deleteSourceAction, getAppDefaultSource, getAppDrySource, helpTip} from '../utils';
import * as jsYaml from 'js-yaml';
import {RevisionFormField} from '../revision-form-field/revision-form-field';
import classNames from 'classnames';
@@ -1091,9 +1091,9 @@ async function getSourceFromAppSources(aSource: models.ApplicationSource, name:
// Delete when source field is removed
async function getSingleSource(app: models.Application) {
if (app.spec.source || app.spec.sourceHydrator) {
const repoDetail = await services.repos.appDetails(getAppDefaultSource(app), app.metadata.name, app.spec.project, 0, 0).catch(() => ({
const repoDetail = await services.repos.appDetails(getAppDrySource(app), app.metadata.name, app.spec.project, 0, 0).catch(() => ({
type: 'Directory' as models.AppSourceType,
path: getAppDefaultSource(app).path
path: getAppDrySource(app).path
}));
return repoDetail;
}

View File

@@ -1453,6 +1453,16 @@ export function getAppDefaultSource(app?: appModels.Application) {
return getAppSpecDefaultSource(app.spec);
}
// getAppDrySource gets the dry source from the source hydrator
export function getAppDrySource(app?: appModels.Application): appModels.ApplicationSource | null {
if (!app) {
return null;
}
const {path, targetRevision, repoURL} = app.spec.sourceHydrator?.drySource || app.spec.source;
return {repoURL, targetRevision, path};
}
// getAppDefaultSyncRevision gets the first app revisions from `status.sync.revisions` or, if that list is missing or empty, the `revision`
// field.
export function getAppDefaultSyncRevision(app?: appModels.Application) {