-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can not delete device resources #8
Comments
These optional, sensitive fields (userdata, custom_data) are set on device create. These fields are not forcenew. The terrajet warning/error is coming from: |
Hmm it looks like we expect it to be present in all cases. @displague would you be interested in contributing a fix? I believe a |
@muvaf I attempted to create a fix for this, but I think the problem runs deeper. I wonder if diff --git a/pkg/resource/sensitive.go b/pkg/resource/sensitive.go
index 7afa4cb..707db02 100644
--- a/pkg/resource/sensitive.go
+++ b/pkg/resource/sensitive.go
@@ -116,6 +116,10 @@ func GetSensitiveAttributes(from map[string]interface{}, mapping map[string]stri
for _, fp := range fieldPaths {
v, err := paved.GetString(fp)
if err != nil {
+ // Ignore unset optional sensitive attributes
+ if err.Error() == fmt.Sprintf("%s: not a string", fp) {
+ continue
+ }
return nil, errors.Wrapf(err, errFmtCannotGetStringForFieldPath, fp)
}
// Note(turkenh): k8s secrets uses a strict regex to validate secret |
@displague I observed another issue with device resource though:
I used the default example and here is the generated terraform state attributes:
|
@ulucinar I am wondering if the error above needs a late-init config, similar to what you did in crossplane-contrib/provider-jet-azure#107 (review) |
Hi @turkenh, |
Thanks @turkenh. I think it makes sense to exclude r.LateInitializer = config.LateInitializer{
IgnoredFields: []string{"metro"},
} in the relevant terrajet resource configuration. |
Closing as won't fix, but this should be resolved in the replacement project. |
What happened?
The resource delete hangs with the following warnings:
How can we reproduce it?
Create the resources from examples/ and then try to delete it. Describe the resource.
What environment did it happen in?
Crossplane version:
provider-tf-equinix-metal 0.2.2
The text was updated successfully, but these errors were encountered: