Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

Add support for `nodebalancerIpv6` feature flag for NodeBalancer Dual Stack Support ([#12420](https://github.com/linode/manager/pull/12420))
1 change: 1 addition & 0 deletions packages/manager/src/dev-tools/FeatureFlagTool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const options: { flag: keyof Flags; label: string }[] = [
{ flag: 'linodeInterfaces', label: 'Linode Interfaces' },
{ flag: 'lkeEnterprise', label: 'LKE-Enterprise' },
{ flag: 'mtc2025', label: 'MTC 2025' },
{ flag: 'nodebalancerIpv6', label: 'NodeBalancer Dual Stack (IPv6)' },
{ flag: 'nodebalancerVpc', label: 'NodeBalancer-VPC Integration' },
{ flag: 'objMultiCluster', label: 'OBJ Multi-Cluster' },
{ flag: 'objectStorageGen2', label: 'OBJ Gen2' },
Expand Down
1 change: 1 addition & 0 deletions packages/manager/src/featureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export interface Flags {
marketplaceAppOverrides: MarketplaceAppOverride[];
metadata: boolean;
mtc2025: boolean;
nodebalancerIpv6: boolean;
nodebalancerVpc: boolean;
objectStorageGen2: BaseFeatureFlag;
objMultiCluster: boolean;
Expand Down
31 changes: 30 additions & 1 deletion packages/manager/src/features/NodeBalancers/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { renderHook, waitFor } from '@testing-library/react';

import { wrapWithTheme } from 'src/utilities/testHelpers';

import { useIsNodebalancerVPCEnabled } from './utils';
import {
useIsNodebalancerIpv6Enabled,
useIsNodebalancerVPCEnabled,
} from './utils';

describe('useIsNodebalancerVPCEnabled', () => {
it('returns true if the feature is enabled', async () => {
Expand All @@ -29,3 +32,29 @@ describe('useIsNodebalancerVPCEnabled', () => {
});
});
});

describe('useIsNodebalancerIpv6Enabled', () => {
it('returns true if the feature is enabled', async () => {
const options = { flags: { nodebalancerIpv6: true } };

const { result } = renderHook(() => useIsNodebalancerIpv6Enabled(), {
wrapper: (ui) => wrapWithTheme(ui, options),
});

await waitFor(() => {
expect(result.current.isNodebalancerIpv6Enabled).toBe(true);
});
});

it('returns false if the feature is NOT enabled', async () => {
const options = { flags: { nodebalancerIpv6: false } };

const { result } = renderHook(() => useIsNodebalancerIpv6Enabled(), {
wrapper: (ui) => wrapWithTheme(ui, options),
});

await waitFor(() => {
expect(result.current.isNodebalancerIpv6Enabled).toBe(false);
});
});
});
16 changes: 16 additions & 0 deletions packages/manager/src/features/NodeBalancers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,19 @@

return { isNodebalancerVPCEnabled: flags.nodebalancerVpc ?? false };
};

/**
* Returns whether or not features related to the NodeBalancer Dual Stack project
* should be enabled.
*
* Currently, this just uses the `nodebalancerIPv6` feature flag as a source of truth,
* but will eventually also look at account capabilities.
*/

export const useIsNodebalancerIpv6Enabled = () => {
const flags = useFlags();

// @TODO NB-IPv6: check for customer tag/account capability when it exists

Check warning on line 249 in packages/manager/src/features/NodeBalancers/utils.ts

View workflow job for this annotation

GitHub Actions / ESLint Review (manager)

[eslint] reported by reviewdog 🐢 Complete the task associated to this "TODO" comment. Raw Output: {"ruleId":"sonarjs/todo-tag","severity":1,"message":"Complete the task associated to this \"TODO\" comment.","line":249,"column":7,"nodeType":null,"messageId":"completeTODO","endLine":249,"endColumn":11}

return { isNodebalancerIpv6Enabled: flags.nodebalancerIpv6 ?? false };
};