Skip to content

Commit 6f758fb

Browse files
Merge pull request #3740 from Azure/mvacula/aro-22958
DiskStorageAccountType node pool field default validation
2 parents 0ceedcc + 86dbe3f commit 6f758fb

8 files changed

+61
-7
lines changed

test/e2e/complete_cluster_create.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var _ = Describe("Customer", func() {
3535
// do nothing. per test initialization usually ages better than shared.
3636
})
3737

38-
It("should be able to create an HCP cluster using bicep templates",
38+
It("should be able to create an HCP cluster",
3939
labels.RequireNothing,
4040
labels.Critical,
4141
labels.Positive,
@@ -115,6 +115,16 @@ var _ = Describe("Customer", func() {
115115
45*time.Minute,
116116
)
117117
Expect(err).NotTo(HaveOccurred())
118+
119+
By("verifying nodepool DiskStorageAccountType matches framework default")
120+
err = framework.ValidateNodePoolDiskStorageAccountType(ctx,
121+
tc.Get20240610ClientFactoryOrDie(ctx).NewNodePoolsClient(),
122+
*resourceGroup.Name,
123+
customerClusterName,
124+
customerNodePoolName,
125+
)
126+
Expect(err).NotTo(HaveOccurred())
127+
118128
By("verifying a simple web app can run")
119129
err = verifiers.VerifySimpleWebApp().Verify(ctx, adminRESTConfig)
120130
Expect(err).NotTo(HaveOccurred())

test/testdata/zz_fixture_TestMainListSuitesForEachSuite_dev_cd_check_paralleldev_cd_check_parallel.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Customer should be able to create a HCP cluster without CNI
66
Customer should be able to list HCP clusters without node pools at both subscription and resource group levels
77
Update HCPOpenShiftCluster Positive creates a cluster and updates tags with a PATCH request
88
Customer should be able to create several HCP clusters in their customer resource group, but not in the same managed resource group
9-
Customer should be able to create an HCP cluster using bicep templates
9+
Customer should be able to create an HCP cluster
1010
Customer should be able to lifecycle and confirm external auth on a cluster
1111
Customer should be able to create an HCP cluster with Image Registry not present
1212
Engineering should be able to retrieve kusto logs for a cluster and services

test/testdata/zz_fixture_TestMainListSuitesForEachSuite_integration_parallelintegration_parallel.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Customer should create an HCP cluster and validate TLS certificates
1313
Update HCPOpenShiftCluster Negative creates a cluster and fails to update its name with a PATCH request
1414
Update HCPOpenShiftCluster Positive creates a cluster and updates tags with a PATCH request
1515
Customer should be able to create several HCP clusters in their customer resource group, but not in the same managed resource group
16-
Customer should be able to create an HCP cluster using bicep templates
16+
Customer should be able to create an HCP cluster
1717
Customer should be able to create a cluster with an external auth config and get the external auth config
1818
Customer should be able to lifecycle and confirm external auth on a cluster
1919
HCP Nodepools GPU instances creates and deletes vm type NC6sv3 in a single cluster

test/testdata/zz_fixture_TestMainListSuitesForEachSuite_prod_parallelprod_parallel.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Customer should create an HCP cluster and validate TLS certificates
1212
Update HCPOpenShiftCluster Negative creates a cluster and fails to update its name with a PATCH request
1313
Update HCPOpenShiftCluster Positive creates a cluster and updates tags with a PATCH request
1414
Customer should be able to create several HCP clusters in their customer resource group, but not in the same managed resource group
15-
Customer should be able to create an HCP cluster using bicep templates
15+
Customer should be able to create an HCP cluster
1616
Customer should be able to create a cluster with an external auth config and get the external auth config
1717
Customer should be able to lifecycle and confirm external auth on a cluster
1818
Customer should be able to create an HCP cluster with Image Registry not present

test/testdata/zz_fixture_TestMainListSuitesForEachSuite_rp_api_compat_all_parallel_01rp_api_compat_all_parallel_development.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Customer should not be able to deploy 2 identically named clusters within the sa
99
Customer should not be able to reuse subnets and NSGs between clusters
1010
Update HCPOpenShiftCluster Positive creates a cluster and updates tags with a PATCH request
1111
Customer should be able to create several HCP clusters in their customer resource group, but not in the same managed resource group
12-
Customer should be able to create an HCP cluster using bicep templates
12+
Customer should be able to create an HCP cluster
1313
Customer should be able to lifecycle and confirm external auth on a cluster
1414
Customer should be able to create an HCP cluster with Image Registry not present
1515
Engineering should be able to retrieve kusto logs for a cluster and services

test/testdata/zz_fixture_TestMainListSuitesForEachSuite_rp_api_compat_all_parallelrp_api_compat_all_parallel.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Customer should not be able to deploy 2 identically named clusters within the sa
99
Customer should not be able to reuse subnets and NSGs between clusters
1010
Update HCPOpenShiftCluster Positive creates a cluster and updates tags with a PATCH request
1111
Customer should be able to create several HCP clusters in their customer resource group, but not in the same managed resource group
12-
Customer should be able to create an HCP cluster using bicep templates
12+
Customer should be able to create an HCP cluster
1313
Customer should be able to lifecycle and confirm external auth on a cluster
1414
Customer should be able to create an HCP cluster with Image Registry not present
1515
Customer should be able to create a cluster with default autoscaling and a nodepool with autoscaling enabled

test/testdata/zz_fixture_TestMainListSuitesForEachSuite_stage_parallelstage_parallel.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Customer should create an HCP cluster and validate TLS certificates
1212
Update HCPOpenShiftCluster Negative creates a cluster and fails to update its name with a PATCH request
1313
Update HCPOpenShiftCluster Positive creates a cluster and updates tags with a PATCH request
1414
Customer should be able to create several HCP clusters in their customer resource group, but not in the same managed resource group
15-
Customer should be able to create an HCP cluster using bicep templates
15+
Customer should be able to create an HCP cluster
1616
Customer should be able to create a cluster with an external auth config and get the external auth config
1717
Customer should be able to lifecycle and confirm external auth on a cluster
1818
Customer should be able to create an HCP cluster with Image Registry not present

test/util/framework/hcp_helper.go

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,3 +843,47 @@ func GenerateKubeconfig(restConfig *rest.Config) (string, error) {
843843

844844
return string(kubeconfigBytes), nil
845845
}
846+
847+
// Verifies that a nodepool created using framework has DiskStorageAccountType set to the framework default "StandardSSD_LRS"
848+
func ValidateNodePoolDiskStorageAccountType(
849+
ctx context.Context,
850+
nodePoolsClient *hcpsdk20240610preview.NodePoolsClient,
851+
resourceGroupName string,
852+
hcpClusterName string,
853+
nodePoolName string,
854+
) error {
855+
nodePoolResp, err := GetNodePool(ctx, nodePoolsClient, resourceGroupName, hcpClusterName, nodePoolName)
856+
if err != nil {
857+
return fmt.Errorf("failed to get nodepool %s: %w", nodePoolName, err)
858+
}
859+
860+
nodePool := nodePoolResp.NodePool
861+
862+
// Verify the nodepool exists and has the expected structure
863+
if nodePool.Properties == nil {
864+
return fmt.Errorf("nodepool %s has no properties", nodePoolName)
865+
}
866+
867+
if nodePool.Properties.Platform == nil {
868+
return fmt.Errorf("nodepool %s has no platform configuration", nodePoolName)
869+
}
870+
871+
if nodePool.Properties.Platform.OSDisk == nil {
872+
return fmt.Errorf("nodepool %s has no OS disk configuration", nodePoolName)
873+
}
874+
875+
if nodePool.Properties.Platform.OSDisk.DiskStorageAccountType == nil {
876+
return fmt.Errorf("nodepool %s has no DiskStorageAccountType set", nodePoolName)
877+
}
878+
879+
// Verify the framework default (StandardSSD_LRS) overrode the API default (Premium_LRS)
880+
expectedDiskType := "StandardSSD_LRS"
881+
actualDiskType := string(*nodePool.Properties.Platform.OSDisk.DiskStorageAccountType)
882+
883+
if actualDiskType != expectedDiskType {
884+
return fmt.Errorf("nodepool %s has incorrect DiskStorageAccountType: expected %s (framework default), got %s",
885+
nodePoolName, expectedDiskType, actualDiskType)
886+
}
887+
888+
return nil
889+
}

0 commit comments

Comments
 (0)