chore: review

Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
This commit is contained in:
Leonardo Cecchi 2025-05-14 11:36:52 +02:00
parent 2fc15432ce
commit 10b9592fb8
3 changed files with 19 additions and 16 deletions

View File

@ -4,22 +4,6 @@ sidebar_position: 20
# Installation
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
import { react } from 'react';
import CodeBlock from '@theme/CodeBlock';
import { useCurrentVersion } from '@site/src/hooks/versions';
export function InstallationSnippet() {
const latest = useCurrentVersion('latestReleased');
return(
<CodeBlock language="sh" >
{`kubectl apply -f \\
https://github.com/cloudnative-pg/plugin-barman-cloud/releases/download/v${latest}/manifest.yaml`}
</CodeBlock>
);
}
:::important
1. The plugin **must** be installed in the same namespace as the CloudNativePG
operator (typically `cnpg-system`).
@ -70,6 +54,8 @@ Both checks are required before proceeding with the installation.
## Installing the Barman Cloud Plugin
import { InstallationSnippet } from '@site/src/components/Installation';
Install the plugin using `kubectl` by applying the manifest for the latest
release:

View File

@ -0,0 +1,16 @@
import { react } from 'react';
import CodeBlock from '@theme/CodeBlock';
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() {
const latest = useCurrentVersion('latestReleased');
return(
<CodeBlock language="sh" >
{`kubectl apply -f \\
https://github.com/cloudnative-pg/plugin-barman-cloud/releases/download/v${latest}/manifest.yaml`}
</CodeBlock>
);
}

View File

@ -19,6 +19,7 @@ export function useLatestReleasedVersion() {
const versioned = versions.filter(v => v.name !== 'current');
// Assuming the latest is the first in the list after sorting by semantic version
// in descending order
const latestVersion = versioned.length > 0
? versioned.sort((a, b) => (b.name.localeCompare(a.name, undefined, {numeric: true, sensitivity: 'base'})))[0]
: null;