You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This bug is in HuaweiCloud Importer function for cce_vpc (Ref). This function call GetCcePvcInfoById func (Ref).
func GetCcePvcInfoById(c *golangsdk.ServiceClient, clusterId, namespace,
id string) (*persistentvolumeclaims.PersistentVolumeClaim, error) {
pages, err := persistentvolumeclaims.List(c, clusterId, namespace).AllPages()
if err != nil {
return nil, err
}
responses, err := persistentvolumeclaims.ExtractPersistentVolumeClaims(pages)
if err != nil {
return nil, err
}
for _, v := range responses {
if v.Metadata.UID == id {
return &v, nil
}
}
// PVC has not exist.
return nil, nil
}
This function always return nil,nil if PVC has not exist. And in func resourceCcePvcResourceImportState if GetCcePvcInfoById return nil,nil no error is returned
azrod
changed the title
Resource flexibleengine_cce_pvc import always returns OK
[CCE] Resource flexibleengine_cce_pvc import always returns OK
Jan 11, 2023
In resource flexibleengine_cce_pvc import always returns OK
This bug is in HuaweiCloud Importer function for cce_vpc (Ref). This function call
GetCcePvcInfoById
func (Ref).This function always return
nil,nil
if PVC has not exist. And in funcresourceCcePvcResourceImportState
ifGetCcePvcInfoById
returnnil,nil
no error is returnedResult the resource is always imported even if it does not exist
References
The text was updated successfully, but these errors were encountered: