fix: manifest diff shows all resources as recreated (#672) (#673)

The manifests endpoint returns text/plain YAML, but fetchWithSafeDefaults
treats string responses as errors and returns the fallback value ([]).
Revert useGetReleaseManifest to use fetchWithDefaults which correctly
passes through text/plain responses.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Andrey Pokhilko
2026-03-27 14:01:00 +03:00
committed by GitHub
parent 0966354b7c
commit 81e982941d
2 changed files with 6 additions and 7 deletions

View File

@@ -65,15 +65,14 @@ export function useGetReleaseManifest({
}: {
namespace: string;
chartName: string;
options?: UseQueryOptions<ReleaseManifest[]>;
options?: UseQueryOptions<string>;
}) {
return useQuery<ReleaseManifest[]>({
return useQuery<string>({
queryKey: ["manifest", namespace, chartName],
queryFn: () =>
apiService.fetchWithSafeDefaults<ReleaseManifest[]>({
url: `/api/helm/releases/${namespace}/${chartName}/manifests`,
fallback: [],
}),
apiService.fetchWithDefaults<string>(
`/api/helm/releases/${namespace}/${chartName}/manifests`
),
...(options ?? {}),
});
}

View File

@@ -143,7 +143,7 @@ export const InstallReleaseChartModal = ({
} = useDiffData({
selectedRepo,
versionsError: versionsError as unknown as string, // TODO fix it
currentVerManifest: currentVerManifest as unknown as string, // TODO fix it
currentVerManifest: currentVerManifest ?? "",
selectedVerData,
chart: chartAddress,
});