mirror of
https://github.com/cloudnative-pg/plugin-barman-cloud.git
synced 2026-01-12 05:33:11 +01:00
chore: review
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
This commit is contained in:
parent
2fc15432ce
commit
10b9592fb8
@ -4,22 +4,6 @@ sidebar_position: 20
|
|||||||
|
|
||||||
# Installation
|
# 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
|
:::important
|
||||||
1. The plugin **must** be installed in the same namespace as the CloudNativePG
|
1. The plugin **must** be installed in the same namespace as the CloudNativePG
|
||||||
operator (typically `cnpg-system`).
|
operator (typically `cnpg-system`).
|
||||||
@ -70,6 +54,8 @@ Both checks are required before proceeding with the installation.
|
|||||||
|
|
||||||
## Installing the Barman Cloud Plugin
|
## Installing the Barman Cloud Plugin
|
||||||
|
|
||||||
|
import { InstallationSnippet } from '@site/src/components/Installation';
|
||||||
|
|
||||||
Install the plugin using `kubectl` by applying the manifest for the latest
|
Install the plugin using `kubectl` by applying the manifest for the latest
|
||||||
release:
|
release:
|
||||||
|
|
||||||
|
|||||||
16
web/src/components/Installation/index.tsx
Normal file
16
web/src/components/Installation/index.tsx
Normal 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>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@ -19,6 +19,7 @@ export function useLatestReleasedVersion() {
|
|||||||
const versioned = versions.filter(v => v.name !== 'current');
|
const versioned = versions.filter(v => v.name !== 'current');
|
||||||
|
|
||||||
// Assuming the latest is the first in the list after sorting by semantic version
|
// Assuming the latest is the first in the list after sorting by semantic version
|
||||||
|
// in descending order
|
||||||
const latestVersion = versioned.length > 0
|
const latestVersion = versioned.length > 0
|
||||||
? versioned.sort((a, b) => (b.name.localeCompare(a.name, undefined, {numeric: true, sensitivity: 'base'})))[0]
|
? versioned.sort((a, b) => (b.name.localeCompare(a.name, undefined, {numeric: true, sensitivity: 'base'})))[0]
|
||||||
: null;
|
: null;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user