Skip to content

Commit 0af42ca

Browse files
Merge pull request #507 from erhancagirici/remove-id-check-in-externalname-fw
remove id validation from setExternalName for resources without id field
2 parents c4332e6 + f794e5e commit 0af42ca

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

pkg/controller/external_tfpluginfw.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -568,13 +568,9 @@ func (n *terraformPluginFrameworkExternalClient) Delete(ctx context.Context, _ x
568568
}
569569

570570
func (n *terraformPluginFrameworkExternalClient) setExternalName(mg xpresource.Managed, stateValueMap map[string]interface{}) (bool, error) {
571-
id, ok := stateValueMap["id"]
572-
if !ok || id.(string) == "" {
573-
return false, nil
574-
}
575571
newName, err := n.config.ExternalName.GetExternalNameFn(stateValueMap)
576572
if err != nil {
577-
return false, errors.Wrapf(err, "failed to compute the external-name from the state map of the resource with the ID %s", id)
573+
return false, errors.Wrap(err, "failed to compute the external-name from the state map")
578574
}
579575
oldName := meta.GetExternalName(mg)
580576
// we have to make sure the newly set external-name is recorded

0 commit comments

Comments
 (0)