diff --git a/web/src/components/Installation/index.tsx b/web/src/components/Installation/index.tsx index 064a0ea..9bf8fca 100644 --- a/web/src/components/Installation/index.tsx +++ b/web/src/components/Installation/index.tsx @@ -5,7 +5,7 @@ import {useCurrentVersion} from '@site/src/hooks/versions'; // InstallationSnippet is the kubectl incantation to install the lastest // available version of the Barman Cloud Plugin. export function InstallationSnippet(): ReactElement { - const latest = useCurrentVersion('latestReleased'); + const latest = useCurrentVersion('latest'); return ( {`kubectl apply -f \\ @@ -13,4 +13,3 @@ export function InstallationSnippet(): ReactElement { ); } - diff --git a/web/src/hooks/versions.ts b/web/src/hooks/versions.ts index 785cc2f..463e0f5 100644 --- a/web/src/hooks/versions.ts +++ b/web/src/hooks/versions.ts @@ -7,7 +7,10 @@ export function useCurrentVersion(fallback: 'latest' | 'latestReleased' = 'lates return useLatestReleasedVersion(); case 'latest': { const version = useActiveVersion('default'); - return version?.name ?? useLatestVersion('default')?.name; + if (version && version.name !== 'current') { + return version.name; + } + return useLatestReleasedVersion(); } default: // The following line ensures that if `fallback` is not 'latest' or 'latestReleased',