azurerm_kubernetes_flux_configuration
is removing secrets after adding kustomization blocks
#23449
Closed
1 task done
Labels
Is there an existing issue for this?
Community Note
Terraform Version
1.54
AzureRM Provider Version
3.75.0
Affected Resource(s)/Data Source(s)
azurerm_kubernetes_flux_configuration
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
GitRepository is configured with secret even after adding second (and more) kustomization blocks.
Actual Behaviour
After adding second kustomization block to the
azurerm_kubernetes_flux_configuration
resource (that is already applied), the GitRepository object on the AKS is missing secretRef and secrets are containing 0 data.I did some investigation in the code and that is what I found:
On the create, the
configurationProtectedSettings
are correctly returned by the Create function.Anyway, on the Update function there is a bug.
Line 644 is setting
Properties.ConfigurationProtectedSettings
tonil
and it is stillnil
even after the update, because this if condition is not applied - git_repository DID NOT CHANGE, but the kustomizations DID change. Anyway, the if condition for kustomizations is not returningconfigurationProtectedSettings
.Steps to Reproduce
kubectl get gitrepository flux-debug-repo -n flux-system
Status Ready is True.
kubectl get secret -n flux-system flux-debug-repo-auth flux-debug-repo-protected-parameters
Both secrets contains data.
Check secret refrence on the GitRepository:
kubectl get gitrepository flux-debug-repo -n flux-system -o yaml | grep secretRef -A1
secretRef is present.
azurerm_kubernetes_flux_configuration
resource and apply changes (steps 1 and 2).kubecl get gitrepository flux-debug-repo -n flux-system
Status Ready is False with error:
failed to checkout and determine revision: unable to list remote for 'HTTPS_URL_REPO': authentication required
Check secrets:
kubectl get secret -n flux-system flux-debug-repo-auth flux-debug-repo-protected-parameters
Both secrets does not contains data (DATA field equal to 0).
Check secret refrence on the GitRepository:
kubectl get gitrepository flux-debug-repo -n flux-system -o yaml | grep secretRef -A1
No results.
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered: