From 5192ac1ead34901e0b6db64dd1c5b203bc5cb42f Mon Sep 17 00:00:00 2001 From: Lily Pan Date: Mon, 15 Jun 2026 11:36:38 -0700 Subject: [PATCH 1/4] fix: vhdbuilder phase 2.5 should still use hack --- e2e/vmss.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/e2e/vmss.go b/e2e/vmss.go index 6c0527da21b..214c93f8acb 100644 --- a/e2e/vmss.go +++ b/e2e/vmss.go @@ -376,6 +376,17 @@ func createVMSSModel(ctx context.Context, s *Scenario) armcompute.VirtualMachine } customData = func() string { + binaryURL, err := CachedCompileAndUploadAKSNodeController(ctx, s.VHD.Arch) + require.NoError(s.T, err, "failed to compile and upload aks-node-controller binary") + if s.Runtime.NBC.EnableScriptlessNBCCSECmd { + customData := nodeBootstrapping.CustomData + customData, err = CustomDataWithNBCCmdHack(s, customData, binaryURL) + require.NoError(s.T, err, "failed to generate custom data with NBC cmd hack") + return customData + } + data, err := CustomDataWithHack(s, binaryURL) + require.NoError(s.T, err, "failed to generate custom data from AKSNodeConfig with hack") + if config.Config.DisableScriptLessCompilation { var data string var err error @@ -387,16 +398,6 @@ func createVMSSModel(ctx context.Context, s *Scenario) armcompute.VirtualMachine require.NoError(s.T, err, "failed to generate custom data from AKSNodeConfig") return data } - binaryURL, err := CachedCompileAndUploadAKSNodeController(ctx, s.VHD.Arch) - require.NoError(s.T, err, "failed to compile and upload aks-node-controller binary") - if s.Runtime.NBC.EnableScriptlessNBCCSECmd { - customData := nodeBootstrapping.CustomData - customData, err = CustomDataWithNBCCmdHack(s, customData, binaryURL) - require.NoError(s.T, err, "failed to generate custom data with NBC cmd hack") - return customData - } - data, err := CustomDataWithHack(s, binaryURL) - require.NoError(s.T, err, "failed to generate custom data from AKSNodeConfig with hack") return data }() From 0142c5be87f6750bb07e2732781b661390e2b2bf Mon Sep 17 00:00:00 2001 From: Lily Pan Date: Mon, 15 Jun 2026 11:52:20 -0700 Subject: [PATCH 2/4] simplify --- e2e/vmss.go | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/e2e/vmss.go b/e2e/vmss.go index 214c93f8acb..43e4b66d4da 100644 --- a/e2e/vmss.go +++ b/e2e/vmss.go @@ -376,18 +376,7 @@ func createVMSSModel(ctx context.Context, s *Scenario) armcompute.VirtualMachine } customData = func() string { - binaryURL, err := CachedCompileAndUploadAKSNodeController(ctx, s.VHD.Arch) - require.NoError(s.T, err, "failed to compile and upload aks-node-controller binary") - if s.Runtime.NBC.EnableScriptlessNBCCSECmd { - customData := nodeBootstrapping.CustomData - customData, err = CustomDataWithNBCCmdHack(s, customData, binaryURL) - require.NoError(s.T, err, "failed to generate custom data with NBC cmd hack") - return customData - } - data, err := CustomDataWithHack(s, binaryURL) - require.NoError(s.T, err, "failed to generate custom data from AKSNodeConfig with hack") - - if config.Config.DisableScriptLessCompilation { + if config.Config.DisableScriptLessCompilation && !s.Runtime.NBC.EnableScriptlessNBCCSECmd { var data string var err error if s.VHD.Flatcar { @@ -398,6 +387,16 @@ func createVMSSModel(ctx context.Context, s *Scenario) armcompute.VirtualMachine require.NoError(s.T, err, "failed to generate custom data from AKSNodeConfig") return data } + binaryURL, err := CachedCompileAndUploadAKSNodeController(ctx, s.VHD.Arch) + require.NoError(s.T, err, "failed to compile and upload aks-node-controller binary") + if s.Runtime.NBC.EnableScriptlessNBCCSECmd { + customData := nodeBootstrapping.CustomData + customData, err = CustomDataWithNBCCmdHack(s, customData, binaryURL) + require.NoError(s.T, err, "failed to generate custom data with NBC cmd hack") + return customData + } + data, err := CustomDataWithHack(s, binaryURL) + require.NoError(s.T, err, "failed to generate custom data from AKSNodeConfig with hack") return data }() From 4e4f37191bc231f06135bd5579c51e595f74eb5d Mon Sep 17 00:00:00 2001 From: Lily Pan Date: Mon, 15 Jun 2026 14:04:41 -0700 Subject: [PATCH 3/4] fix --- e2e/validators.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/validators.go b/e2e/validators.go index 07774be2cb4..91ce83feec1 100644 --- a/e2e/validators.go +++ b/e2e/validators.go @@ -2670,7 +2670,7 @@ func ValidateScriptlessNBCCSECmd(ctx context.Context, s *Scenario) { nbc := s.Runtime.NBC if nbc != nil && nbc.EnableScriptlessNBCCSECmd && s.VHD.SupportsScriptless() { fileNameToCheck := "/opt/azure/containers/aks-node-controller-nbc-cmd.sh" - if !config.Config.DisableScriptLessCompilation && !s.Tags.NetworkIsolated { + if s.Runtime.AKSNodeConfig != nil || (!config.Config.DisableScriptLessCompilation && !s.Tags.NetworkIsolated) { fileNameToCheck = "/opt/azure/containers/aks-node-controller-nbc-cmd-hack.sh" } ValidateFileExists(ctx, s, fileNameToCheck) From 33afba89e957828b94d6a930f81549ab9d73f26c Mon Sep 17 00:00:00 2001 From: Lily Pan Date: Mon, 15 Jun 2026 16:28:18 -0700 Subject: [PATCH 4/4] use correct customdata --- e2e/validators.go | 2 +- e2e/vmss.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/e2e/validators.go b/e2e/validators.go index 91ce83feec1..07774be2cb4 100644 --- a/e2e/validators.go +++ b/e2e/validators.go @@ -2670,7 +2670,7 @@ func ValidateScriptlessNBCCSECmd(ctx context.Context, s *Scenario) { nbc := s.Runtime.NBC if nbc != nil && nbc.EnableScriptlessNBCCSECmd && s.VHD.SupportsScriptless() { fileNameToCheck := "/opt/azure/containers/aks-node-controller-nbc-cmd.sh" - if s.Runtime.AKSNodeConfig != nil || (!config.Config.DisableScriptLessCompilation && !s.Tags.NetworkIsolated) { + if !config.Config.DisableScriptLessCompilation && !s.Tags.NetworkIsolated { fileNameToCheck = "/opt/azure/containers/aks-node-controller-nbc-cmd-hack.sh" } ValidateFileExists(ctx, s, fileNameToCheck) diff --git a/e2e/vmss.go b/e2e/vmss.go index 43e4b66d4da..06301ece7dc 100644 --- a/e2e/vmss.go +++ b/e2e/vmss.go @@ -376,9 +376,12 @@ func createVMSSModel(ctx context.Context, s *Scenario) armcompute.VirtualMachine } customData = func() string { - if config.Config.DisableScriptLessCompilation && !s.Runtime.NBC.EnableScriptlessNBCCSECmd { + if config.Config.DisableScriptLessCompilation { var data string var err error + if s.Runtime.NBC.EnableScriptlessNBCCSECmd { + return nodeBootstrapping.CustomData + } if s.VHD.Flatcar { data, err = nodeconfigutils.CustomDataFlatcar(aksNodeConfig) } else {