Skip to content

Commit fea10b7

Browse files
authored
Merge pull request #791 from skoeva/mns-preview
aks-desktop: Stop requiring ManagedNamespacePreview
2 parents c091694 + 75cae93 commit fea10b7

15 files changed

Lines changed: 2 additions & 378 deletions

File tree

Localize/locales/en/plugin-translation.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@
221221
"Creating the trigger issue for the Copilot coding agent.": "Creating the trigger issue for the Copilot coding agent.",
222222
"Creating...": "Creating...",
223223
"Current Replicas": "Current Replicas",
224-
"Current state": "Current state",
225224
"Degraded": "Degraded",
226225
"Delete project": "Delete project",
227226
"Delete Project": "Delete Project",
@@ -443,8 +442,6 @@
443442
"Login timeout. Please try again.": "Login timeout. Please try again.",
444443
"Managed Identity": "Managed Identity",
445444
"managed namespaces only": "managed namespaces only",
446-
"ManagedNamespacePreview feature registered successfully!": "ManagedNamespacePreview feature registered successfully!",
447-
"_ManagedNamespacePreview feature registered successfully!.comment": "{Locked=\"ManagedNamespacePreview\"}",
448445
"Manual": "Manual",
449446
"Manual Deploy": "Manual Deploy",
450447
"Manually configure settings": "Manually configure settings",
@@ -549,7 +546,6 @@
549546
"Pipeline": "Pipeline",
550547
"Pipeline configured": "Pipeline configured",
551548
"Please complete the authentication in your browser. This window will automatically redirect once login is complete.": "Please complete the authentication in your browser. This window will automatically redirect once login is complete.",
552-
"Please register it to continue.": "Please register it to continue.",
553549
"Please review all the settings before creating your AKS project": "Please review all the settings before creating your AKS project",
554550
"Please select a deployment to view metrics": "Please select a deployment to view metrics",
555551
"Please select a subscription first": "Please select a subscription first",
@@ -593,8 +589,6 @@
593589
"Refreshing": "Refreshing",
594590
"Register AKS Cluster": "Register AKS Cluster",
595591
"Register Cluster": "Register Cluster",
596-
"Register ManagedNamespacePreview Feature": "Register ManagedNamespacePreview Feature",
597-
"_Register ManagedNamespacePreview Feature.comment": "{Locked=\"ManagedNamespacePreview\"}",
598592
"Registering": "Registering",
599593
"Registering cluster": "Registering cluster",
600594
"Registry Name": "Registry Name",
@@ -732,8 +726,6 @@
732726
"The HTTP path to check for liveness (e.g., /healthz). The probe performs an HTTP GET request to this path.": "The HTTP path to check for liveness (e.g., /healthz). The probe performs an HTTP GET request to this path.",
733727
"The HTTP path to check for readiness (e.g., /ready). The probe performs an HTTP GET request to this path.": "The HTTP path to check for readiness (e.g., /ready). The probe performs an HTTP GET request to this path.",
734728
"The HTTP path to check for startup (e.g., /startup). The probe performs an HTTP GET request to this path.": "The HTTP path to check for startup (e.g., /startup). The probe performs an HTTP GET request to this path.",
735-
"The ManagedNamespacePreview feature must be registered to create managed namespaces.": "The ManagedNamespacePreview feature must be registered to create managed namespaces.",
736-
"_The ManagedNamespacePreview feature must be registered to create managed namespaces..comment": "{Locked=\"ManagedNamespacePreview\"}",
737729
"The maximum amount of CPU the container can use. If exceeded, the container will be throttled.": "The maximum amount of CPU the container can use. If exceeded, the container will be throttled.",
738730
"The maximum amount of memory the container can use. If exceeded, the container will be terminated (OOMKilled).": "The maximum amount of memory the container can use. If exceeded, the container will be terminated (OOMKilled).",
739731
"_The maximum amount of memory the container can use. If exceeded, the container will be terminated (OOMKilled)..comment": "{Locked=\"OOMKilled\"}",

plugins/aks-desktop/locales/en/translation.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,6 @@
8080
"Installing": "Installing",
8181
"Install Extension": "Install Extension",
8282
"AKS Preview Extension installed successfully!": "AKS Preview Extension installed successfully!",
83-
"The ManagedNamespacePreview feature must be registered to create managed namespaces.": "The ManagedNamespacePreview feature must be registered to create managed namespaces.",
84-
"Current state": "Current state",
85-
"Please register it to continue.": "Please register it to continue.",
86-
"Register ManagedNamespacePreview Feature": "Register ManagedNamespacePreview Feature",
87-
"ManagedNamespacePreview feature registered successfully!": "ManagedNamespacePreview feature registered successfully!",
8883
"Project Name": "Project Name",
8984
"Checking if another project exists with same name": "Checking if another project exists with same name",
9085
"Another project already exists with same name. Please choose a different name.": "Another project already exists with same name. Please choose a different name.",

plugins/aks-desktop/src/components/CreateAKSProject/CreateAKSProject.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,10 @@ function CreateAKSProject() {
4545
loadingClusters={wizard.azureResources.loadingClusters}
4646
clusterError={wizard.azureResources.clusterError}
4747
extensionStatus={wizard.extensionStatus}
48-
featureStatus={wizard.featureStatus}
4948
namespaceStatus={wizard.namespaceCheck}
5049
clusterCapabilities={wizard.clusterCapabilities.capabilities}
5150
capabilitiesLoading={wizard.clusterCapabilities.loading}
5251
onInstallExtension={wizard.extensionStatus.installExtension}
53-
onRegisterFeature={wizard.featureStatus.registerFeature}
5452
onRetrySubscriptions={async () => {
5553
await wizard.azureResources.fetchSubscriptions();
5654
}}

plugins/aks-desktop/src/components/CreateAKSProject/components/BasicsStep.stories.tsx

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,10 @@ const BASE_PROPS: BasicsStepProps = {
7676
clusterError: null,
7777
totalClusterCount: null,
7878
extensionStatus: { installed: true, installing: false, error: null, showSuccess: false },
79-
featureStatus: {
80-
registered: true,
81-
state: 'Registered',
82-
registering: false,
83-
error: null,
84-
showSuccess: false,
85-
},
8679
namespaceStatus: { exists: null, checking: false, error: null },
8780
clusterCapabilities: null,
8881
capabilitiesLoading: false,
8982
onInstallExtension: async () => {},
90-
onRegisterFeature: async () => {},
9183
onRetrySubscriptions: async () => {},
9284
onRetryClusters: async () => {},
9385
onRefreshCapabilities: () => {},
@@ -203,40 +195,6 @@ ExtensionInstallSuccess.args = {
203195
extensionStatus: { installed: true, installing: false, error: null, showSuccess: true },
204196
};
205197

206-
/**
207-
* The `ManagedNamespacePreview` feature flag is not yet registered.
208-
* Shows the red error panel with the "Register Feature" button.
209-
*/
210-
export const FeatureNotRegistered = Template.bind({});
211-
FeatureNotRegistered.args = {
212-
...BASE_PROPS,
213-
formData: { ...BASE_FORM_DATA, subscription: 'sub-123' },
214-
featureStatus: {
215-
registered: false,
216-
state: 'NotRegistered',
217-
registering: false,
218-
error: null,
219-
showSuccess: false,
220-
},
221-
};
222-
223-
/**
224-
* Feature registration is in progress.
225-
* The "Register Feature" button shows a spinner and is disabled.
226-
*/
227-
export const FeatureRegistering = Template.bind({});
228-
FeatureRegistering.args = {
229-
...BASE_PROPS,
230-
formData: { ...BASE_FORM_DATA, subscription: 'sub-123' },
231-
featureStatus: {
232-
registered: false,
233-
state: 'Registering',
234-
registering: true,
235-
error: null,
236-
showSuccess: false,
237-
},
238-
};
239-
240198
/**
241199
* Project name collides with an existing namespace.
242200
* The Project Name field shows an error state and a "name taken" message.

plugins/aks-desktop/src/components/CreateAKSProject/components/BasicsStep.tsx

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ function RegisterCluster({ cluster, resourceGroup, subscription, tenantId }: Reg
117117
*
118118
* Collects the project name, description, Azure subscription, and AKS cluster.
119119
* Also surfaces pre-flight warnings and errors for the AKS Preview extension,
120-
* the ManagedNamespacePreview feature flag, cluster readiness, cluster
121-
* capabilities, and namespace name availability.
120+
* cluster readiness, cluster capabilities, and namespace name availability.
122121
*
123122
* All stateful logic (focus management, auto-select, option mapping, cluster
124123
* state derivation) lives in {@link useBasicsStep}. The `RegisterCluster`
@@ -134,12 +133,10 @@ export const BasicsStep: React.FC<BasicsStepProps> = props => {
134133
loadingClusters,
135134
clusterError,
136135
extensionStatus,
137-
featureStatus,
138136
namespaceStatus,
139137
clusterCapabilities,
140138
capabilitiesLoading,
141139
onInstallExtension,
142-
onRegisterFeature,
143140
onRetrySubscriptions,
144141
onRetryClusters,
145142
onRefreshCapabilities,
@@ -214,60 +211,6 @@ export const BasicsStep: React.FC<BasicsStepProps> = props => {
214211
/>
215212
)}
216213

217-
{/* ManagedNamespacePreview feature flag check */}
218-
{featureStatus.registered === false && (
219-
<ValidationAlert
220-
type="error"
221-
message={
222-
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
223-
<Typography variant="h6" component="div">
224-
Feature Flag Required
225-
</Typography>
226-
<Typography variant="body2">
227-
{t(
228-
'The ManagedNamespacePreview feature must be registered to create managed namespaces.'
229-
)}
230-
</Typography>
231-
{featureStatus.state && (
232-
<Typography variant="body2">
233-
{t('Current state')}: <strong>{featureStatus.state}</strong>
234-
</Typography>
235-
)}
236-
<Typography variant="body2">{t('Please register it to continue.')}</Typography>
237-
{featureStatus.error && (
238-
<Typography variant="caption" color="error" sx={{ display: 'block' }}>
239-
{featureStatus.error}
240-
</Typography>
241-
)}
242-
<Button
243-
variant="contained"
244-
onClick={onRegisterFeature}
245-
disabled={featureStatus.registering}
246-
sx={{ alignSelf: 'flex-start' }}
247-
size="large"
248-
aria-busy={featureStatus.registering || undefined}
249-
>
250-
{featureStatus.registering ? (
251-
<Box display="flex" alignItems="center" gap={1}>
252-
<CircularProgress size={16} color="inherit" aria-hidden="true" />
253-
{t('Registering')}...
254-
</Box>
255-
) : (
256-
t('Register ManagedNamespacePreview Feature')
257-
)}
258-
</Button>
259-
</Box>
260-
}
261-
/>
262-
)}
263-
264-
{featureStatus.showSuccess && (
265-
<ValidationAlert
266-
type="success"
267-
message={'✓ ' + t('ManagedNamespacePreview feature registered successfully!')}
268-
/>
269-
)}
270-
271214
<Box sx={{ display: 'flex', gap: 3, flexDirection: 'column' }}>
272215
{/* Project Name */}
273216
<FormControl fullWidth variant="outlined">

plugins/aks-desktop/src/components/CreateAKSProject/hooks/useBasicsStep.test.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,18 +86,10 @@ function makeProps(overrides: Partial<BasicsStepProps> = {}): BasicsStepProps {
8686
clusterError: null,
8787
totalClusterCount: null,
8888
extensionStatus: { installed: true, installing: false, error: null, showSuccess: false },
89-
featureStatus: {
90-
registered: true,
91-
state: 'Registered',
92-
registering: false,
93-
error: null,
94-
showSuccess: false,
95-
},
9689
namespaceStatus: { exists: null, checking: false, error: null },
9790
clusterCapabilities: null,
9891
capabilitiesLoading: false,
9992
onInstallExtension: vi.fn(),
100-
onRegisterFeature: vi.fn(),
10193
onRetrySubscriptions: vi.fn(),
10294
onRetryClusters: vi.fn(),
10395
onRefreshCapabilities: vi.fn(),

plugins/aks-desktop/src/components/CreateAKSProject/hooks/useCreateAKSProjectWizard.test.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,6 @@ vi.mock('./useExtensionCheck', () => ({
8989
}),
9090
}));
9191

92-
vi.mock('./useFeatureCheck', () => ({
93-
useFeatureCheck: () => ({
94-
registered: true,
95-
state: null,
96-
registering: false,
97-
error: null,
98-
showSuccess: false,
99-
registerFeature: vi.fn(),
100-
checkFeature: vi.fn(),
101-
clearError: vi.fn(),
102-
}),
103-
}));
104-
10592
vi.mock('./useNamespaceCheck', () => ({
10693
useNamespaceCheck: () => ({
10794
exists: false,

plugins/aks-desktop/src/components/CreateAKSProject/hooks/useCreateAKSProjectWizard.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import { STEPS } from '../types';
2020
import { useAzureResources } from './useAzureResources';
2121
import { useClusterCapabilities } from './useClusterCapabilities';
2222
import { useExtensionCheck } from './useExtensionCheck';
23-
import { useFeatureCheck } from './useFeatureCheck';
2423
import { useFormData } from './useFormData';
2524
import { useNamespaceCheck } from './useNamespaceCheck';
2625
import { useValidation } from './useValidation';
@@ -102,8 +101,6 @@ export interface UseCreateAKSProjectWizardResult {
102101
azureResources: ReturnType<typeof useAzureResources>;
103102
/** Extension install status and action for the aks-preview CLI extension. */
104103
extensionStatus: ReturnType<typeof useExtensionCheck>;
105-
/** Feature registration status and action for the required AKS feature flag. */
106-
featureStatus: ReturnType<typeof useFeatureCheck>;
107104
/** Namespace existence check state and action. */
108105
namespaceCheck: ReturnType<typeof useNamespaceCheck>;
109106
/** Cluster capability flags (SKU, network policy, add-on status). */
@@ -155,7 +152,6 @@ export function useCreateAKSProjectWizard(): UseCreateAKSProjectWizardResult {
155152
const azureResources = useAzureResources();
156153
const clusterCapabilities = useClusterCapabilities();
157154
const extensionStatus = useExtensionCheck();
158-
const featureStatus = useFeatureCheck({ subscription: formData.subscription });
159155
const namespaceCheck = useNamespaceCheck();
160156

161157
const clustersConf = K8s.useClustersConf();
@@ -169,7 +165,6 @@ export function useCreateAKSProjectWizard(): UseCreateAKSProjectWizardResult {
169165
activeStep,
170166
formData,
171167
extensionStatus,
172-
featureStatus,
173168
namespaceCheck,
174169
isClusterMissing,
175170
clusterCapabilities.capabilities
@@ -606,7 +601,6 @@ export function useCreateAKSProjectWizard(): UseCreateAKSProjectWizardResult {
606601
updateFormData,
607602
azureResources,
608603
extensionStatus,
609-
featureStatus,
610604
namespaceCheck,
611605
clusterCapabilities,
612606
validation,

0 commit comments

Comments
 (0)