@@ -445,6 +445,51 @@ resource "kustomization_resource" "rb" {
445
445
`
446
446
}
447
447
448
+ //
449
+ //
450
+ // Update_Recreate_StorageClass Test
451
+ func TestAccResourceKustomization_updateRecreateStorageClass (t * testing.T ) {
452
+
453
+ resource .Test (t , resource.TestCase {
454
+ Providers : testAccProviders ,
455
+ Steps : []resource.TestStep {
456
+ //
457
+ //
458
+ // Applying initial storage class
459
+ {
460
+ Config : testAccResourceKustomizationConfig_updateRecreateStorageClassProvisioner ("test_kustomizations/update_recreate_storage_class/initial" ),
461
+ Check : resource .ComposeAggregateTestCheckFunc (
462
+ resource .TestCheckResourceAttrSet ("kustomization_resource.scparam" , "id" ),
463
+ resource .TestCheckResourceAttrSet ("kustomization_resource.scprov" , "id" ),
464
+ ),
465
+ },
466
+ //
467
+ //
468
+ // Applying changed storage class
469
+ {
470
+ Config : testAccResourceKustomizationConfig_updateRecreateStorageClassProvisioner ("test_kustomizations/update_recreate_storage_class/modified" ),
471
+ Check : resource .ComposeAggregateTestCheckFunc (
472
+ resource .TestCheckResourceAttrSet ("kustomization_resource.scparam" , "id" ),
473
+ resource .TestCheckResourceAttrSet ("kustomization_resource.scprov" , "id" ),
474
+ ),
475
+ },
476
+ },
477
+ })
478
+ }
479
+
480
+ func testAccResourceKustomizationConfig_updateRecreateStorageClassProvisioner (path string ) string {
481
+ return testAccDataSourceKustomizationConfig_basic (path ) + `
482
+ resource "kustomization_resource" "scparam" {
483
+ manifest = data.kustomization_build.test.manifests["storage.k8s.io/StorageClass/_/local-storage-parameters"]
484
+ }
485
+
486
+ resource "kustomization_resource" "scprov" {
487
+ manifest = data.kustomization_build.test.manifests["storage.k8s.io/StorageClass/_/local-storage-provisioner"]
488
+ }
489
+
490
+ `
491
+ }
492
+
448
493
//
449
494
//
450
495
// Upgrade_API_Version Test
0 commit comments