Skip to content
Open
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
25 changes: 25 additions & 0 deletions e2e/scenario_win_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,31 @@ func Test_Windows2022_VHDCaching(t *testing.T) {
})
}

// Test_Windows2022_VHDCaching_LegacyTLSBootstrap exercises Windows PIS /
// VHD-cached provisioning with secure TLS bootstrap disabled, forcing kubelet
// to use the legacy bootstrap-token path. Catches regressions in the two-stage
// CSE flow that only surface when no secure-tls-bootstrap client is around to
// overwrite the temporary kubeconfig.
func Test_Windows2022_VHDCaching_LegacyTLSBootstrap(t *testing.T) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we already have the bootstrap token fallback scenarios which are designed to test a similar path - could we just add another one for the VHDCaching case instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

VHDCaching: true

RunScenario(t, &Scenario{
Description: "VHD Caching with secure TLS bootstrap disabled",
Config: Config{
Cluster: ClusterAzureNetwork,
VHD: config.VHDWindows2022Containerd,
VHDCaching: true,
VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) {
vmss.SKU.Capacity = to.Ptr[int64](2)
},
BootstrapConfigMutator: func(_ *Cluster, nbc *datamodel.NodeBootstrappingConfiguration) {
if nbc.SecureTLSBootstrappingConfig == nil {
nbc.SecureTLSBootstrappingConfig = &datamodel.SecureTLSBootstrappingConfig{}
}
nbc.SecureTLSBootstrappingConfig.Enabled = false
},
},
})
}

func Test_Windows2022Gen2_k8s_133(t *testing.T) {
RunScenario(t, &Scenario{
Description: "Windows Server 2022 with Containerd 2- hyperv gen 2",
Expand Down
6 changes: 5 additions & 1 deletion parts/windows/kuberneteswindowssetup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,6 @@ function BasePrep {
PREPROVISION_EXTENSION
Adjust-DynamicPortRange
Register-LogsCleanupScriptTask
Register-NodeResetScriptTask

Update-DefenderPreferences

Expand Down Expand Up @@ -579,6 +578,11 @@ function NodePrep {
Remove-Item $kubeConfigFile
}

# Register AFTER temp kubeconfig removal: the -AtStartup trigger would
# otherwise race PIS-baked VHD first boot and bring kubelet up with the
# embedded "nodeclient" cert instead of doing TLS bootstrap.
Register-NodeResetScriptTask
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we have a test for this - that the registration happens in nodeprop not baseprep?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added a validator. But I don't really like it.

I don't like testing "X doesn't supposed to happen". They are infinite amount of things that doesn't suppose to happen ...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Replaced it with a proper e2e. BootstrapTLS enabled vs disabled


Start-InstallGPUDriver -EnableInstall $global:ConfigGPUDriverIfNeeded -GpuDriverURL $global:GpuDriverURL

if (Test-Path $CacheDir)
Expand Down
Loading