Skip to content

Remove swft deploy environment#4874

Open
bennerv wants to merge 2 commits intomainfrom
bvesel/remove-swift-environment
Open

Remove swft deploy environment#4874
bennerv wants to merge 2 commits intomainfrom
bvesel/remove-swift-environment

Conversation

@bennerv
Copy link
Copy Markdown
Member

@bennerv bennerv commented Apr 14, 2026

What

Remove the dedicated swft deploy environment and make the demo script unconditionally create the Swift subnet and delegation.

Why

All pers clusters now have Swift V2 enabled by default, making the separate swft environment redundant.

Testing

  • cd config; make materialize passes validation and rendering
  • Helm fixture tests pass
  • No remaining references to DEPLOY_ENV=swft in the codebase

Special notes for your reviewer

Changes:

  • Removed swft environment definition from tooling/templatize/settings.yaml
  • Removed swft environment config section from config/config.yaml
  • Removed rendered config config/rendered/dev/swft/uksouth.yaml
  • Updated demo/02-customer-infra.sh to always create the Swift subnet (removed conditional swift argument)
  • Updated dev-infrastructure/swift/README.md to reflect that pers environments have Swift V2 enabled by default

Copilot AI review requested due to automatic review settings April 14, 2026 13:21
@openshift-ci openshift-ci bot requested review from geoberle and janboll April 14, 2026 13:21
@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 14, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bennerv

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

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

Note

Copilot was unable to run its full agentic suite in this review.

Removes the dedicated swft deploy environment and updates demo/dev-infra tooling so Swift V2 resources (integration subnet + delegation) are created unconditionally in personal environments.

Changes:

  • Removed swft environment configuration and its rendered output.
  • Updated demo scripts and Bicep templates to always provision a Swift integration subnet, supporting private Key Vault and explicit cluster/nodepool versions.
  • Updated Swift dev-infrastructure docs/env-vars to reflect the new default behavior in pers.

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
tooling/templatize/settings.yaml Removes swft environment definition from templatize settings.
config/config.yaml Removes the swft environment config block.
config/rendered/dev/swft/uksouth.yaml Deletes rendered config for the removed swft environment.
demo/02-customer-infra.sh Makes Swift subnet creation + delegation unconditional.
demo/env_vars Renames Swift subnet env var and bumps API version used by demo.
demo/deploy-hcp-bicep.sh Passes new parameters for integration subnet, KV visibility, and versions.
demo/bicep/customer-infra.bicep Adds integration subnet + KV private endpoint and outputs.
demo/bicep/cluster.bicep Adds integration subnet + KV visibility + cluster version; updates API version.
demo/bicep/nodepool.bicep Adds node pool version parameter; updates API version.
dev-infrastructure/swift/README.md Removes swft env instructions; updates demo steps.
dev-infrastructure/swift/swift_env_vars Switches subnet env var to the integration subnet name.

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

@bennerv bennerv force-pushed the bvesel/remove-swift-environment branch 2 times, most recently from 169d35f to 5be2403 Compare April 14, 2026 13:49
Copilot AI review requested due to automatic review settings April 14, 2026 13:49
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

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


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

Comment on lines +109 to +110
resource privateEndpoint 'Microsoft.Network/privateEndpoints@2023-09-01' = if (privateKeyVault) {
name: 'kv-private-endpoint'
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

The private endpoint, DNS zone group, and VNet link resource names are effectively constant. This can cause deployment conflicts when creating more than one Key Vault/private endpoint or linking multiple VNets in the same resource group (names collide). Consider making these names unique per deployment (e.g., include randomSuffix, customerKeyVaultName, and/or customerVnetName in the name/uniqueString inputs) to keep the demo idempotent and allow multiple runs/environments.

Copilot uses AI. Check for mistakes.
Comment on lines +128 to +129
resource privateEndpointDnsGroup 'Microsoft.Network/privateEndpoints/privateDnsZoneGroups@2023-09-01' = if (privateKeyVault) {
name: 'kv-private-ep-dns-group'
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

The private endpoint, DNS zone group, and VNet link resource names are effectively constant. This can cause deployment conflicts when creating more than one Key Vault/private endpoint or linking multiple VNets in the same resource group (names collide). Consider making these names unique per deployment (e.g., include randomSuffix, customerKeyVaultName, and/or customerVnetName in the name/uniqueString inputs) to keep the demo idempotent and allow multiple runs/environments.

Copilot uses AI. Check for mistakes.
…bled

The dedicated swft environment is no longer needed since pers already
has Swift V2 enabled by default. The demo script now unconditionally
creates the swift subnet and delegation.

Remove demo scripts that leverage local RP, instead we should use
test/e2e directory with makefile target to run a e2e test against one of
our scenarios
Remove references to deleted demo scripts from the swift README and
point to demo/README.md and test/ e2e tests instead. Add az resource
commands for common cluster operations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 14, 2026 16:08
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

Copilot reviewed 28 out of 28 changed files in this pull request and generated 6 comments.


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

export CUSTOMER_VNET_SUBNET1="customer-subnet-1"
export CUSTOMER_VNET_PODNETWORK1="customer-podnetwork-1"
export CUSTOMER_VNET_INTEGRATION_SUBNET="customer-vnet-integration-subnet"
export CUSTOMER_NSG="customer-nsg"
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

DEMO_ENV_NAME is no longer set in this file (the logic that initialized it was removed), but it’s still used to build CUSTOMER_KV_NAME. This will expand to an empty string and can lead to surprising names/collisions. Fix by reintroducing a default for DEMO_ENV_NAME (e.g., derived from ${DEPLOY_ENV:-pers}) or by removing DEMO_ENV_NAME from the Key Vault name construction and using a stable suffix.

Suggested change
export CUSTOMER_NSG="customer-nsg"
export CUSTOMER_NSG="customer-nsg"
if [ -z "${DEMO_ENV_NAME:-}" ]; then
export DEMO_ENV_NAME="${DEPLOY_ENV:-pers}"
fi

Copilot uses AI. Check for mistakes.
Comment on lines 73 to +77
clusterName="${CLUSTER_NAME}" \
managedResourceGroupName="${MANAGED_RESOURCE_GROUP}" \
keyVaultName="${KEYVAULT_NAME}"
keyVaultName="${KEYVAULT_NAME}" \
privateKeyVault=${PRIVATE_KEYVAULT} \
clusterVersion="${CLUSTER_VERSION}"
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

KEYVAULT_NAME is referenced but (based on the updated demo/env_vars) the variable appears to be CUSTOMER_KV_NAME. As written, this will pass an empty keyVaultName unless users export KEYVAULT_NAME manually. Recommend switching to the expected variable name (or defining KEYVAULT_NAME in env_vars to avoid breaking users).

Copilot uses AI. Check for mistakes.
source env_vars
# The ONLY supported region for ARO-HCP in INT is uksouth
LOCATION=${LOCATION:-uksouth}
SUBSCRIPTION=$(az account show --query 'name' -o tsv)
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

The script uses the subscription name from az account show for --subscription. Subscription names can contain spaces and are not guaranteed unique, which can make automation flaky. Prefer using the subscription id (az account show --query id -o tsv) to make the script deterministic.

Suggested change
SUBSCRIPTION=$(az account show --query 'name' -o tsv)
SUBSCRIPTION=$(az account show --query 'id' -o tsv)

Copilot uses AI. Check for mistakes.
Comment on lines 28 to 30
az group create \
--name "${CUSTOMER_RG_NAME}" \
--subscription "${SUBSCRIPTION}" \
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

The script uses the subscription name from az account show for --subscription. Subscription names can contain spaces and are not guaranteed unique, which can make automation flaky. Prefer using the subscription id (az account show --query id -o tsv) to make the script deterministic.

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +8
Basic instructions to get swift working in our dev environment. For this you will need access to our mock 1P app. The `login_fpa.sh` script will collect the certificate and log you in as the 1P app, its used to create/delete the service association link on the customer subnet.

NOTE: Yes when you start creating the SAL, PotNetwork etc you will get logged in and out of Azure becuase we're switching between the mock 1p and the dev sub
The sal_env_vars script stores some basic configuration that is specific to the dev environment (subscription). This would need to be modified for other environments such as INT
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

Two documentation issues: (1) grammar: “its used” should be “it’s used”; (2) the text references sal_env_vars, but the file in this directory is named swift_env_vars in this PR—update the name in the README to match the actual script users should edit/source.

Copilot uses AI. Check for mistakes.
```bash
CS_CLUSTER_ID=$(curl localhost:8001/api/aro_hcp/v1alpha1/clusters | jq .items[0].id -r)
kubectl get manifestwork -n local-cluster | grep ^${CS_CLUSTER_ID}
az resource invoke-action --ids "${CLUSTER_RESOURCE_ID}" --action requestAdminCredential
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

This command likely needs an explicit --api-version to work reliably with preview resources/actions (especially since the README states these commands use 2025-12-23-preview). Without it, az resource invoke-action may pick an API version that doesn’t expose requestAdminCredential. Recommend adding --api-version 2025-12-23-preview (or whatever version your Bicep/templates use) to the command.

Suggested change
az resource invoke-action --ids "${CLUSTER_RESOURCE_ID}" --action requestAdminCredential
az resource invoke-action --ids "${CLUSTER_RESOURCE_ID}" --action requestAdminCredential --api-version 2025-12-23-preview

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants