Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
test
  • Loading branch information
fseldow committed Mar 9, 2026
commit 013e2b266aecfb5e36180994201b2724d036483c
18 changes: 18 additions & 0 deletions e2e/scenario_win_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/Azure/agentbaker/e2e/components"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Masterminds/semver"
"github.com/stretchr/testify/require"

"github.com/Azure/agentbaker/e2e/config"
Expand Down Expand Up @@ -513,12 +514,29 @@ func Test_NetworkIsolatedCluster_Windows_WithEgress(t *testing.T) {
Cluster: ClusterAzureBootstrapProfileCache,
VHD: config.VHDWindows2025Gen2,
BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) {
Windows2025BootstrapConfigMutator(t, nbc)
nbc.ContainerService.Properties.SecurityProfile = &datamodel.SecurityProfile{
PrivateEgress: &datamodel.PrivateEgress{
Enabled: true,
ContainerRegistryServer: fmt.Sprintf("%s.azurecr.io/aks-managed-repository", config.PrivateACRNameNotAnon(config.Config.DefaultLocation)),
},
}
nbc.ContainerService.Properties.OrchestratorProfile.KubernetesConfig.UseManagedIdentity = true
nbc.AgentPoolProfile.KubernetesConfig.UseManagedIdentity = true
nbc.KubeletConfig["--image-credential-provider-config"] = "c:\\k\\credential-provider-config.yaml"
nbc.KubeletConfig["--image-credential-provider-bin-dir"] = "c:\\var\\lib\\kubelet\\credential-provider"
orchestratorVersion, _ := semver.NewVersion(nbc.ContainerService.Properties.OrchestratorProfile.OrchestratorVersion)
if orchestratorVersion.LessThan(semver.MustParse("1.32.0")) {
nbc.K8sComponents.WindowsCredentialProviderURL = fmt.Sprintf(
"https://packages.aks.azure.com/cloud-provider-azure/v%s/binaries/azure-acr-credential-provider-windows-amd64-v%s.tar.gz",
nbc.ContainerService.Properties.OrchestratorProfile.OrchestratorVersion,
nbc.ContainerService.Properties.OrchestratorProfile.OrchestratorVersion)
} else {
nbc.K8sComponents.WindowsCredentialProviderURL = fmt.Sprintf(
"https://packages.aks.azure.com/dalec-packages/azure-acr-credential-provider/%s/windows/amd64/azure-acr-credential-provider_%s-1_amd64.zip",
nbc.ContainerService.Properties.OrchestratorProfile.OrchestratorVersion,
nbc.ContainerService.Properties.OrchestratorProfile.OrchestratorVersion)
}
},
Validator: func(ctx context.Context, s *Scenario) {
// Verify mcr.microsoft.com host config exist
Expand Down
23 changes: 23 additions & 0 deletions staging/cse/windows/networkisolatedclusterfunc.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,26 @@ Describe "Invoke-OrasLogin" {
Assert-MockCalled -CommandName 'Start-Sleep' -Times 2
}
}

Describe "Get-BootstrapRegistryDomainName" {
It "should return default mcr domain when no overrides are set" {
$global:MCRRepositoryBase = ""
$global:BootstrapProfileContainerRegistryServer = ""

Get-BootstrapRegistryDomainName | Should -Be "mcr.microsoft.com"
}

It "should use MCRRepositoryBase and trim trailing slash" {
$global:MCRRepositoryBase = "example.registry.io/"
$global:BootstrapProfileContainerRegistryServer = ""

Get-BootstrapRegistryDomainName | Should -Be "example.registry.io"
}

It "should prefer bootstrap profile registry host when provided" {
$global:MCRRepositoryBase = "example.registry.io/"
$global:BootstrapProfileContainerRegistryServer = "mybootstrap.azurecr.io/repo/path"

Get-BootstrapRegistryDomainName | Should -Be "mybootstrap.azurecr.io"
}
}