@@ -195,8 +195,9 @@ func Test_AzureLinuxV2_SecureTLSBootstrapping_BootstrapToken_Fallback(t *testing
195195 VHD : config .VHDAzureLinuxV2Gen2 ,
196196 BootstrapConfigMutator : func (nbc * datamodel.NodeBootstrappingConfiguration ) {
197197 nbc .SecureTLSBootstrappingConfig = & datamodel.SecureTLSBootstrappingConfig {
198- Enabled : true ,
199- Deadline : (30 * time .Second ).String (),
198+ Enabled : true ,
199+ Deadline : (30 * time .Second ).String (),
200+ AADResource : "https://management.azure.com/" , // use an unexpected AAD resource to force a secure TLS bootstrapping failure
200201 }
201202 },
202203 },
@@ -899,12 +900,6 @@ func Test_Ubuntu2204_AirGap(t *testing.T) {
899900// TODO: refactor NonAnonymous tests to use the same cluster as Anonymous airgap
900901// or deprecate anonymous ACR airgap tests once it is unsupported
901902func Test_Ubuntu2204_AirGap_NonAnonymousACR (t * testing.T ) {
902- location := config .Config .DefaultLocation
903-
904- ctx := newTestCtx (t )
905- identity , err := config .Azure .UserAssignedIdentities .Get (ctx , config .ResourceGroupName (location ), config .VMIdentityName , nil )
906- require .NoError (t , err )
907-
908903 RunScenario (t , & Scenario {
909904 Description : "Tests that a node using the Ubuntu 2204 VHD and is airgap can be properly bootstrapped" ,
910905 Tags : Tags {
@@ -915,9 +910,6 @@ func Test_Ubuntu2204_AirGap_NonAnonymousACR(t *testing.T) {
915910 Cluster : ClusterKubenetAirgapNonAnon ,
916911 VHD : config .VHDUbuntu2204Gen2Containerd ,
917912 BootstrapConfigMutator : func (nbc * datamodel.NodeBootstrappingConfiguration ) {
918- nbc .TenantID = * identity .Properties .TenantID
919- nbc .UserAssignedIdentityClientID = * identity .Properties .ClientID
920-
921913 nbc .OutboundType = datamodel .OutboundTypeBlock
922914 nbc .ContainerService .Properties .SecurityProfile = & datamodel.SecurityProfile {
923915 PrivateEgress : & datamodel.PrivateEgress {
@@ -971,10 +963,6 @@ func Test_Ubuntu2204Gen2_ContainerdAirgappedK8sNotCached(t *testing.T) {
971963}
972964
973965func Test_Ubuntu2204Gen2_ContainerdAirgappedNonAnonymousK8sNotCached (t * testing.T ) {
974- location := config .Config .DefaultLocation
975- ctx := newTestCtx (t )
976- identity , err := config .Azure .UserAssignedIdentities .Get (ctx , config .ResourceGroupName (location ), config .VMIdentityName , nil )
977- require .NoError (t , err )
978966 RunScenario (t , & Scenario {
979967 Description : "Tests that a node using the Ubuntu 2204 VHD without k8s binary and is airgap can be properly bootstrapped" ,
980968 Tags : Tags {
@@ -985,13 +973,11 @@ func Test_Ubuntu2204Gen2_ContainerdAirgappedNonAnonymousK8sNotCached(t *testing.
985973 Cluster : ClusterKubenetAirgapNonAnon ,
986974 VHD : config .VHDUbuntu2204Gen2ContainerdAirgappedK8sNotCached ,
987975 BootstrapConfigMutator : func (nbc * datamodel.NodeBootstrappingConfiguration ) {
988- nbc .TenantID = * identity .Properties .TenantID
989- nbc .UserAssignedIdentityClientID = * identity .Properties .ClientID
990976 nbc .OutboundType = datamodel .OutboundTypeBlock
991977 nbc .ContainerService .Properties .SecurityProfile = & datamodel.SecurityProfile {
992978 PrivateEgress : & datamodel.PrivateEgress {
993979 Enabled : true ,
994- ContainerRegistryServer : fmt .Sprintf ("%s.azurecr.io" , config .PrivateACRNameNotAnon (location )),
980+ ContainerRegistryServer : fmt .Sprintf ("%s.azurecr.io" , config .PrivateACRNameNotAnon (config . Config . DefaultLocation )),
995981 },
996982 }
997983 nbc .AgentPoolProfile .LocalDNSProfile = nil
@@ -1000,7 +986,7 @@ func Test_Ubuntu2204Gen2_ContainerdAirgappedNonAnonymousK8sNotCached(t *testing.
1000986 // intentionally using private acr url to get kube binaries
1001987 nbc .AgentPoolProfile .KubernetesConfig .CustomKubeBinaryURL = fmt .Sprintf (
1002988 "%s.azurecr.io/oss/binaries/kubernetes/kubernetes-node:v%s-linux-amd64" ,
1003- config .PrivateACRNameNotAnon (location ),
989+ config .PrivateACRNameNotAnon (config . Config . DefaultLocation ),
1004990 nbc .ContainerService .Properties .OrchestratorProfile .OrchestratorVersion )
1005991 nbc .K8sComponents .LinuxCredentialProviderURL = fmt .Sprintf (
1006992 "https://packages.aks.azure.com/cloud-provider-azure/v%s/binaries/azure-acr-credential-provider-linux-amd64-v%s.tar.gz" ,
@@ -1910,8 +1896,9 @@ func Test_Ubuntu2404Gen2_SecureTLSBootstrapping_BootstrapToken_Fallback(t *testi
19101896 VHD : config .VHDUbuntu2404Gen2Containerd ,
19111897 BootstrapConfigMutator : func (nbc * datamodel.NodeBootstrappingConfiguration ) {
19121898 nbc .SecureTLSBootstrappingConfig = & datamodel.SecureTLSBootstrappingConfig {
1913- Enabled : true ,
1914- Deadline : (30 * time .Second ).String (),
1899+ Enabled : true ,
1900+ Deadline : (30 * time .Second ).String (),
1901+ AADResource : "https://management.azure.com/" , // use an unexpected AAD resource to force a secure TLS bootstrapping failure
19151902 }
19161903 },
19171904 },
@@ -2118,10 +2105,6 @@ func Test_Ubuntu2204_PMC_Install(t *testing.T) {
21182105}
21192106
21202107func Test_Ubuntu2204Gen2_ContainerdAirgappedNonAnonymousK8sNotCached_InstallPackage (t * testing.T ) {
2121- location := config .Config .DefaultLocation
2122- ctx := newTestCtx (t )
2123- identity , err := config .Azure .UserAssignedIdentities .Get (ctx , config .ResourceGroupName (location ), config .VMIdentityName , nil )
2124- require .NoError (t , err )
21252108 RunScenario (t , & Scenario {
21262109 Description : "Tests that a node using the Ubuntu 2204 VHD without k8s binary and is airgap can be properly bootstrapped" ,
21272110 Tags : Tags {
@@ -2132,13 +2115,11 @@ func Test_Ubuntu2204Gen2_ContainerdAirgappedNonAnonymousK8sNotCached_InstallPack
21322115 Cluster : ClusterKubenetAirgapNonAnon ,
21332116 VHD : config .VHDUbuntu2204Gen2ContainerdAirgappedK8sNotCached ,
21342117 BootstrapConfigMutator : func (nbc * datamodel.NodeBootstrappingConfiguration ) {
2135- nbc .TenantID = * identity .Properties .TenantID
2136- nbc .UserAssignedIdentityClientID = * identity .Properties .ClientID
21372118 nbc .OutboundType = datamodel .OutboundTypeBlock
21382119 nbc .ContainerService .Properties .SecurityProfile = & datamodel.SecurityProfile {
21392120 PrivateEgress : & datamodel.PrivateEgress {
21402121 Enabled : true ,
2141- ContainerRegistryServer : fmt .Sprintf ("%s.azurecr.io" , config .PrivateACRNameNotAnon (location )),
2122+ ContainerRegistryServer : fmt .Sprintf ("%s.azurecr.io" , config .PrivateACRNameNotAnon (config . Config . DefaultLocation )),
21422123 },
21432124 }
21442125 nbc .AgentPoolProfile .LocalDNSProfile = nil
@@ -2147,7 +2128,7 @@ func Test_Ubuntu2204Gen2_ContainerdAirgappedNonAnonymousK8sNotCached_InstallPack
21472128 // intentionally using private acr url to get kube binaries
21482129 nbc .AgentPoolProfile .KubernetesConfig .CustomKubeBinaryURL = fmt .Sprintf (
21492130 "%s.azurecr.io/oss/binaries/kubernetes/kubernetes-node:v%s-linux-amd64" ,
2150- config .PrivateACRNameNotAnon (location ),
2131+ config .PrivateACRNameNotAnon (config . Config . DefaultLocation ),
21512132 nbc .ContainerService .Properties .OrchestratorProfile .OrchestratorVersion )
21522133 nbc .K8sComponents .LinuxCredentialProviderURL = fmt .Sprintf (
21532134 "https://packages.aks.azure.com/cloud-provider-azure/v%s/binaries/azure-acr-credential-provider-linux-amd64-v%s.tar.gz" ,
0 commit comments