@@ -210,6 +210,27 @@ func TestAccKubernetesFluxConfiguration_kustomizationPostBuild(t *testing.T) {
210210 })
211211}
212212
213+ func TestAccKubernetesFluxConfiguration_kustomizationPostBuildUpdate (t * testing.T ) {
214+ data := acceptance .BuildTestData (t , "azurerm_kubernetes_flux_configuration" , "test" )
215+ r := KubernetesFluxConfigurationResource {}
216+ data .ResourceTest (t , r , []acceptance.TestStep {
217+ {
218+ Config : r .kustomizationPostBuild (data ),
219+ Check : acceptance .ComposeTestCheckFunc (
220+ check .That (data .ResourceName ).ExistsInAzure (r ),
221+ ),
222+ },
223+ data .ImportStep (),
224+ {
225+ Config : r .kustomizationUpdated (data ),
226+ Check : acceptance .ComposeTestCheckFunc (
227+ check .That (data .ResourceName ).ExistsInAzure (r ),
228+ ),
229+ },
230+ data .ImportStep (),
231+ })
232+ }
233+
213234func (r KubernetesFluxConfigurationResource ) Exists (ctx context.Context , clients * clients.Client , state * pluginsdk.InstanceState ) (* bool , error ) {
214235 id , err := fluxconfiguration .ParseScopedFluxConfigurationID (state .ID )
215236 if err != nil {
@@ -793,3 +814,32 @@ resource "azurerm_kubernetes_flux_configuration" "test" {
793814}
794815` , template , data .RandomInteger )
795816}
817+
818+ func (r KubernetesFluxConfigurationResource ) kustomizationUpdated (data acceptance.TestData ) string {
819+ template := r .template (data )
820+ return fmt .Sprintf (`
821+ %s
822+
823+ resource "azurerm_kubernetes_flux_configuration" "test" {
824+ name = "acctest-fc-%d"
825+ cluster_id = azurerm_kubernetes_cluster.test.id
826+ namespace = "flux"
827+
828+ git_repository {
829+ url = "https://github.com/Azure/arc-k8s-demo"
830+ reference_type = "branch"
831+ reference_value = "main"
832+ }
833+
834+ kustomizations {
835+ name = "kustomization-1"
836+ path = "./test/path"
837+ wait = false
838+ }
839+
840+ depends_on = [
841+ azurerm_kubernetes_cluster_extension.test
842+ ]
843+ }
844+ ` , template , data .RandomInteger )
845+ }
0 commit comments