Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions packages/api-v4/src/object-storage/buckets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,6 @@ export const getBuckets = (params?: Params, filters?: Filter) =>
setURL(`${API_ROOT}/object-storage/buckets`),
);

/**
* getBucketsInCluster
*
* Gets a list of a user's Object Storage Buckets in the specified cluster.
*/
export const getBucketsInCluster = (
clusterId: string,
params?: Params,
filters?: Filter,
) =>
Request<Page<ObjectStorageBucket>>(
setMethod('GET'),
setParams(params),
setXFilter(filters),
setURL(
`${API_ROOT}/object-storage/buckets/${encodeURIComponent(clusterId)}`,
),
);

/**
* getBucketsInRegion
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import {
accountFactory,
accountSettingsFactory,
objectStorageClusterFactory,

Check failure on line 8 in packages/manager/cypress/e2e/core/objectStorage/enable-object-storage.spec.ts

View workflow job for this annotation

GitHub Actions / lint (linode-manager)

Remove this unused import of 'objectStorageClusterFactory'
objectStorageKeyFactory,
} from '@src/factories';
import {
Expand All @@ -19,7 +19,6 @@
mockCreateAccessKey,
mockGetAccessKeys,
mockGetBuckets,
mockGetClusters,
mockGetObjectStorageTypes,
} from 'support/intercepts/object-storage';
import { mockGetProfile } from 'support/intercepts/profile';
Expand All @@ -29,8 +28,8 @@

import type {
AccountSettings,
ObjectStorageCluster,

Check failure on line 31 in packages/manager/cypress/e2e/core/objectStorage/enable-object-storage.spec.ts

View workflow job for this annotation

GitHub Actions / lint (linode-manager)

Remove this unused import of 'ObjectStorageCluster'
ObjectStorageClusterID,

Check failure on line 32 in packages/manager/cypress/e2e/core/objectStorage/enable-object-storage.spec.ts

View workflow job for this annotation

GitHub Actions / lint (linode-manager)

Remove this unused import of 'ObjectStorageClusterID'
PriceType,
Region,
} from '@linode/api-v4';
Expand Down Expand Up @@ -101,29 +100,6 @@
}),
];

// Clusters with special pricing are currently hardcoded rather than
// retrieved via API, so we have to mock the cluster API request to correspond
// with that hardcoded data.
//
// Because the IDs used in the mocks don't correspond with any actual clusters,
// we have to cast them as `ObjectStorageClusterID` to satisfy TypeScript.
const mockClusters: ObjectStorageCluster[] = [
// Regions with special pricing.
objectStorageClusterFactory.build({
id: 'br-gru-0' as ObjectStorageClusterID,
region: 'br-gru',
}),
objectStorageClusterFactory.build({
id: 'id-cgk-1' as ObjectStorageClusterID,
region: 'id-cgk',
}),
// A region that does not have special pricing.
objectStorageClusterFactory.build({
id: 'us-east-1',
region: 'us-east',
}),
];

const mockPrices: PriceType[] = [
{
id: 'distributed_network_transfer',
Expand Down Expand Up @@ -209,15 +185,13 @@
'getObjectStorageTypes'
);
mockGetAccountSettings(mockAccountSettings).as('getAccountSettings');
mockGetClusters(mockClusters).as('getClusters');
mockGetBuckets([]).as('getBuckets');
mockGetRegions(mockRegions).as('getRegions');
mockGetAccessKeys([]);

cy.visitWithLogin('/object-storage/buckets');
cy.wait([
'@getAccountSettings',
'@getClusters',
'@getBuckets',
'@getRegions',
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
mockGetAccount(accountFactory.build({ capabilities: ['Object Storage'] }));
mockAppendFeatureFlags({
gecko2: false,
objMultiCluster: false,
objMultiCluster: true,
objectStorageGen2: { enabled: false },
}).as('getFeatureFlags');

Expand Down Expand Up @@ -179,22 +179,22 @@
*/
it('can delete object storage bucket - smoke', () => {
const bucketLabel = randomLabel();
const bucketCluster = 'us-southeast-1';
const region = 'us-southeast';
const bucketMock = objectStorageBucketFactory.build({
cluster: bucketCluster,
hostname: `${bucketLabel}.${bucketCluster}.linodeobjects.com`,
region: region,

Check warning on line 184 in packages/manager/cypress/e2e/core/objectStorage/object-storage.smoke.spec.ts

View workflow job for this annotation

GitHub Actions / ESLint Review (manager)

[eslint] reported by reviewdog 🐶 Expected property shorthand. Raw Output: {"ruleId":"object-shorthand","severity":1,"message":"Expected property shorthand.","line":184,"column":7,"nodeType":"Property","messageId":"expectedPropertyShorthand","endLine":184,"endColumn":21,"fix":{"range":[6104,6118],"text":"region"}}
hostname: `${bucketLabel}.${region}.linodeobjects.com`,
label: bucketLabel,
objects: 0,
});

mockGetAccount(accountFactory.build({ capabilities: ['Object Storage'] }));
mockAppendFeatureFlags({
objMultiCluster: false,
objMultiCluster: true,
objectStorageGen2: { enabled: false },
});

mockGetBuckets([bucketMock]).as('getBuckets');
mockDeleteBucket(bucketLabel, bucketCluster).as('deleteBucket');
mockDeleteBucket(bucketLabel, region).as('deleteBucket');

cy.visitWithLogin('/object-storage/buckets');
cy.wait('@getBuckets');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import * as React from 'react';

import { CopyTooltip } from 'src/components/CopyTooltip/CopyTooltip';
import { Link } from 'src/components/Link';
import { useIsObjectStorageGen2Enabled } from 'src/features/ObjectStorage/hooks/useIsObjectStorageGen2Enabled';
import { useObjectStorageBuckets } from 'src/queries/object-storage/queries';
import { formatDate } from 'src/utilities/formatDate';

Expand Down Expand Up @@ -40,9 +39,8 @@ export const ObjectDetailsDrawer = React.memo(
let formattedLastModified;

const { data: profile } = useProfile();
const { isObjectStorageGen2Enabled } = useIsObjectStorageGen2Enabled();
const { data: bucketsData, isLoading: isLoadingEndpointData } =
useObjectStorageBuckets(isObjectStorageGen2Enabled);
useObjectStorageBuckets();

const isLoadingEndpoint = isLoadingEndpointData || !bucketsData;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { SafeTabPanel } from 'src/components/Tabs/SafeTabPanel';
import { TabPanels } from 'src/components/Tabs/TabPanels';
import { Tabs } from 'src/components/Tabs/Tabs';
import { TanStackTabLinkList } from 'src/components/Tabs/TanStackTabLinkList';
import { useIsObjectStorageGen2Enabled } from 'src/features/ObjectStorage/hooks/useIsObjectStorageGen2Enabled';
import { useFlags } from 'src/hooks/useFlags';
import { useTabs } from 'src/hooks/useTabs';
import { useCloudPulseServiceByServiceType } from 'src/queries/cloudpulse/services';
Expand Down Expand Up @@ -48,7 +47,6 @@ export const BucketDetailLanding = React.memo(() => {
});

const { aclpServices, objectStorageContextualMetrics } = useFlags();
const { isObjectStorageGen2Enabled } = useIsObjectStorageGen2Enabled();
const { isError: aclpServiceError, isLoading: aclServiceLoading } =
useCloudPulseServiceByServiceType('objectstorage', true);

Expand All @@ -57,7 +55,7 @@ export const BucketDetailLanding = React.memo(() => {
isLoading,
error,
isPending,
} = useObjectStorageBuckets(isObjectStorageGen2Enabled);
} = useObjectStorageBuckets();

const bucket = bucketsData?.buckets.find(({ label }) => label === bucketName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ describe('BucketDetailsDrawer: Legacy UI', () => {
selectedBucket={bucket}
/>
),
options: {
flags: { objMultiCluster: false },
},
});

expect(screen.getByText(bucket.label)).toBeInTheDocument();
Expand All @@ -122,9 +119,6 @@ describe('BucketDetailsDrawer: Legacy UI', () => {
selectedBucket={bucket}
/>
),
options: {
flags: { objMultiCluster: false },
},
});

expect(screen.queryByText(bucket.label)).not.toBeInTheDocument();
Expand All @@ -139,9 +133,6 @@ describe('BucketDetailsDrawer: Legacy UI', () => {
selectedBucket={bucket}
/>
),
options: {
flags: { objMultiCluster: false },
},
});

expect(screen.getByTestId('cluster')).toHaveTextContent(region.id);
Expand All @@ -156,9 +147,6 @@ describe('BucketDetailsDrawer: Legacy UI', () => {
selectedBucket={undefined}
/>
),
options: {
flags: { objMultiCluster: false },
},
});

expect(screen.getByText('Bucket Detail')).toBeInTheDocument();
Expand All @@ -176,7 +164,7 @@ describe('BucketDetailsDrawer: Legacy UI', () => {
/>
),
options: {
flags: { objMultiCluster: false },
flags: { objectStorageGen2: { enabled: true } },
},
});

Expand All @@ -198,7 +186,7 @@ describe('BucketDetailsDrawer: Legacy UI', () => {
/>
),
options: {
flags: { objMultiCluster: false },
flags: { objectStorageGen2: { enabled: true } },
},
});

Expand Down Expand Up @@ -227,7 +215,7 @@ describe('BucketDetailDrawer: Gen2 UI', () => {
/>
),
options: {
flags: { objMultiCluster: false, objectStorageGen2: { enabled: true } },
flags: { objectStorageGen2: { enabled: true } },
},
});

Expand All @@ -254,7 +242,7 @@ describe('BucketDetailDrawer: Gen2 UI', () => {
/>
),
options: {
flags: { objMultiCluster: false, objectStorageGen2: { enabled: true } },
flags: { objectStorageGen2: { enabled: true } },
},
});

Expand Down
Loading
Loading