mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
feat(oci): oci helm support [r8s-361] (#787)
This commit is contained in:
parent
b6a6ce9aaf
commit
2697d6c5d7
80 changed files with 4264 additions and 812 deletions
|
@ -39,11 +39,6 @@ export function ChartActions({
|
|||
release={release}
|
||||
updateRelease={updateRelease}
|
||||
/>
|
||||
<UninstallButton
|
||||
environmentId={environmentId}
|
||||
releaseName={releaseName}
|
||||
namespace={namespace}
|
||||
/>
|
||||
{showRollbackButton && (
|
||||
<RollbackButton
|
||||
latestRevision={latestRevision}
|
||||
|
@ -53,6 +48,11 @@ export function ChartActions({
|
|||
namespace={namespace}
|
||||
/>
|
||||
)}
|
||||
<UninstallButton
|
||||
environmentId={environmentId}
|
||||
releaseName={releaseName}
|
||||
namespace={namespace}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -25,8 +25,8 @@ vi.mock('@/portainer/services/notifications', () => ({
|
|||
notifySuccess: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock('../../queries/useHelmRegistries', () => ({
|
||||
useHelmRegistries: vi.fn(() => ({
|
||||
vi.mock('../../queries/useHelmRepositories', () => ({
|
||||
useUserHelmRepositories: vi.fn(() => ({
|
||||
data: ['repo1', 'repo2'],
|
||||
isInitialLoading: false,
|
||||
isError: false,
|
||||
|
@ -146,7 +146,7 @@ describe('UpgradeButton', () => {
|
|||
|
||||
renderButton();
|
||||
|
||||
expect(screen.getByText('No versions available')).toBeInTheDocument();
|
||||
expect(screen.getByText(/No versions available/)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('should open upgrade modal when clicked', async () => {
|
||||
|
|
|
@ -15,7 +15,7 @@ import { HelmRelease, UpdateHelmReleasePayload } from '../../types';
|
|||
import { useUpdateHelmReleaseMutation } from '../../queries/useUpdateHelmReleaseMutation';
|
||||
import { useHelmRepoVersions } from '../../queries/useHelmRepoVersions';
|
||||
import { useHelmRelease } from '../queries/useHelmRelease';
|
||||
import { useHelmRegistries } from '../../queries/useHelmRegistries';
|
||||
import { useUserHelmRepositories } from '../../queries/useHelmRepositories';
|
||||
|
||||
import { openUpgradeHelmModal } from './UpgradeHelmModal';
|
||||
|
||||
|
@ -36,19 +36,22 @@ export function UpgradeButton({
|
|||
const [useCache, setUseCache] = useState(true);
|
||||
const updateHelmReleaseMutation = useUpdateHelmReleaseMutation(environmentId);
|
||||
|
||||
const registriesQuery = useHelmRegistries();
|
||||
const userRepositoriesQuery = useUserHelmRepositories();
|
||||
const helmRepoVersionsQuery = useHelmRepoVersions(
|
||||
release?.chart.metadata?.name || '',
|
||||
60 * 60 * 1000, // 1 hour
|
||||
registriesQuery.data,
|
||||
userRepositoriesQuery.data?.map((repo) => ({
|
||||
repo,
|
||||
})),
|
||||
useCache
|
||||
);
|
||||
const versions = helmRepoVersionsQuery.data;
|
||||
|
||||
// Combined loading state
|
||||
const isLoading =
|
||||
registriesQuery.isInitialLoading || helmRepoVersionsQuery.isFetching; // use 'isFetching' for helmRepoVersionsQuery because we want to show when it's refetching
|
||||
const isError = registriesQuery.isError || helmRepoVersionsQuery.isError;
|
||||
userRepositoriesQuery.isInitialLoading || helmRepoVersionsQuery.isFetching; // use 'isFetching' for helmRepoVersionsQuery because we want to show when it's refetching
|
||||
const isError =
|
||||
userRepositoriesQuery.isError || helmRepoVersionsQuery.isError;
|
||||
const latestVersionQuery = useHelmRelease(
|
||||
environmentId,
|
||||
releaseName,
|
||||
|
@ -101,7 +104,7 @@ export function UpgradeButton({
|
|||
icon={ArrowUp}
|
||||
size="medium"
|
||||
>
|
||||
Upgrade
|
||||
Edit/Upgrade
|
||||
</LoadingButton>
|
||||
{isLoading && (
|
||||
<InlineLoader
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue