Skip to content

kickstart: add namespace selection to configure phase#2166

Open
bosesuneha wants to merge 2 commits into
Azure:kickstartfrom
bosesuneha:feat/kickstart-namespace-selection
Open

kickstart: add namespace selection to configure phase#2166
bosesuneha wants to merge 2 commits into
Azure:kickstartfrom
bosesuneha:feat/kickstart-namespace-selection

Conversation

@bosesuneha
Copy link
Copy Markdown
Member

Summary

Adds a Kubernetes namespace pick step to the kickstart configure phase, immediately after cluster selection. The selected namespace is threaded through prepare (manifest generation), deploy (kubectl context + next-step tips), and verify phases — replacing the previously hardcoded default.

Behavior

  • After picking a cluster, the user sees a QuickPick of existing namespaces on that cluster, fetched via the kubernetes-tools API.
  • System namespaces (kube-system, kube-public, kube-node-lease, kube-lease) are filtered out, but default is always offered.
  • The last-used namespace (persisted in kickstart.lastUsed) is promoted to the top with a (last used) hint.
  • Only existing namespaces are selectable — there is no manual-entry option, so the chosen namespace is guaranteed to already exist on the cluster.
  • If kubectl is unavailable or namespace listing fails, the phase errors out with a clear message (no silent fallback).

Plumbing

  • ConfigData.namespace added to src/chatParticipants/kickstart/state.ts and the webview contract (no webview UI changes — kept structurally for pushState typechecking).
  • KickstartConfiguration + LastUsedSelections in configure.ts carry the field.
  • prepare.ts passes config.namespace into generateManifestsStep and announces it in the stream.
  • steps/manifests.ts plumbs the namespace into buildK8sManifestUserPrompt, removing the hardcoded "default".
  • deploy.ts uses the namespace in the apply heading and the "Next Steps" kubectl commands; the AKS-Automatic note now names the target namespace.
  • verify.ts uses the namespace for pod/service queries and user-facing messages.
  • Configure-phase summary table gains a Namespace row.

Tests

  • phaseRunner.test.ts, state.test.ts, and the integration test were updated to include namespace: "default" in their fixtures.
  • tsc --noEmit and eslint are clean.

Out of scope

No webview UI changes (the webview is slated for removal).

Adds a namespace pick step after cluster selection. Lists existing
namespaces from the cluster via kubectl (filtering system namespaces
but always offering 'default'), promotes the last-used choice, and
threads the selected namespace through prepare (manifest generation),
deploy (kubectl context, next-step tips), and verify phases.

- Only existing cluster namespaces are selectable; no manual entry.
- Errors out early if kubectl is unavailable or listing fails.
- Updates summary table, integration/state tests, and webview contract.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Kubernetes namespace selection to the AKS Kickstart configure phase and threads the selected namespace through subsequent phases (prepare/deploy/verify), replacing the previous hardcoded default behavior.

Changes:

  • Added a namespace QuickPick step after cluster selection and persisted the last-used namespace in kickstart.lastUsed.
  • Plumbed namespace through Kickstart state/config + manifest generation prompt, and updated deploy/verify messaging/commands to use it.
  • Updated webview contract types and test fixtures to include namespace.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/webview-contract/webviewDefinitions/kickstart.ts Adds namespace to the webview ConfigData contract.
src/tests/suite/kickstart.integration.test.ts Updates integration test config fixture with namespace: "default".
src/commands/aksKickstart/configure.ts Implements namespace selection via kubernetes-tools API + last-used persistence.
src/chatParticipants/kickstart/steps/manifests.ts Passes selected namespace into the manifest user prompt (defaults to default).
src/chatParticipants/kickstart/state.ts Extends persisted kickstart ConfigData with namespace.
src/chatParticipants/kickstart/state.test.ts Updates state tests to include namespace in config fixtures.
src/chatParticipants/kickstart/phases/verify.ts Uses configured namespace for pod/service checks and user messaging.
src/chatParticipants/kickstart/phases/prepare.ts Announces and forwards namespace into manifest generation.
src/chatParticipants/kickstart/phases/deploy.ts Updates deploy messaging and next-step kubectl commands to use namespace.
src/chatParticipants/kickstart/phases/configure.ts Stores namespace in kickstart state + adds Namespace row to summary table.
src/chatParticipants/kickstart/phaseRunner.test.ts Updates prereq validation test fixtures with namespace: "default".

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

clusterSku: "Automatic" | "Standard";
acrName: string;
acrLoginServer: string;
namespace: string;
Comment on lines 49 to 52
const skuLabel = config.clusterSku === "Automatic" ? "AKS Automatic" : "AKS Standard";
stream.markdown(`Generating artifacts for **${skuLabel}** cluster...\n\n`);
stream.markdown(`Manifests will target namespace **\`${config.namespace}\`**.\n\n`);

Comment on lines +267 to +268
* Returns non-system namespace names, with "default" always first and the
* last-used namespace promoted to the top when present.
…-namespace-selection

# Conflicts:
#	src/chatParticipants/kickstart/steps/manifests.ts
#	src/commands/aksKickstart/configure.ts
#	src/webview-contract/webviewDefinitions/kickstart.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants