-
Notifications
You must be signed in to change notification settings - Fork 39
Description
Hi,
After upgrading a provider generated from this template from v1 to v2, we started experiencing issues where it would silently fail. No logs, no events, but MR:s didn't sync.
After much effort I found that root cause was that we had accidentally dropped initializing the Configuration struct during the migration:
ps.Configuration = map[string]any{}This caused Go to panic because of the nil pointer reference (understandable), which was seemingly recovered at some point without any form of logging (!?). This leads me to two questions/suggestions:
-
How can we make sure recovered panics are logged? I'm not sure what is doing the recovery (controller runtime?), so I'm unsure where to look for this.
-
Does it make sense to adjust the template so
ps.Configurationis initialized by default? Even if it's just empty and doesn't do anything, it would save others from the same issue.ps := terraform.Setup{ Version: version, Requirement: terraform.ProviderRequirement{ Source: providerSource, Version: providerVersion, }, Configuration: terraform.ProviderConfiguration{}, }