Open ytimocin opened 1 year ago
Good catch @ytimocin. Won't this result into untracked output resources left behind if an existing Radius resource is re-deployed since https://github.com/project-radius/radius/blob/main/pkg/linkrp/backend/controller/createorupdateresource.go#L85 will be skipped?
Good catch @ytimocin. Won't this result into untracked output resources left behind if an existing Radius resource is re-deployed since https://github.com/project-radius/radius/blob/main/pkg/linkrp/backend/controller/createorupdateresource.go#L85 will be skipped?
If it is redeployed then it is going to go into this if case
. We should just delete the if case
because the flow always goes into it.
Good catch @ytimocin. Won't this result into untracked output resources left behind if an existing Radius resource is re-deployed since https://github.com/project-radius/radius/blob/main/pkg/linkrp/backend/controller/createorupdateresource.go#L85 will be skipped?
If it is redeployed then it is going to go into this
if case
. We should just delete theif case
because the flow always goes into it.
Let me sync up with you offline. I think the original output resources won't be tracked in the data store by this point since the resource stored in the data store is being overwritten by async put controller.
Good catch @ytimocin. Won't this result into untracked output resources left behind if an existing Radius resource is re-deployed since https://github.com/project-radius/radius/blob/main/pkg/linkrp/backend/controller/createorupdateresource.go#L85 will be skipped?
If it is redeployed then it is going to go into this
if case
. We should just delete theif case
because the flow always goes into it.Let me sync up with you offline. I think the original output resources won't be tracked in the data store by this point since the resource stored in the data store is being overwritten by async put controller.
Yetkin and I synced up. This indeed is resulting into orphaned output resources, since entire resource including info about previously deployed output resources get overwritten by async put controller https://github.com/project-radius/radius/blob/main/pkg/armrpc/frontend/controller/operation.go#L161. We should prioritize fixing this.
Bug information
We have isNewResource check in the generic async backend controllers for createOrUpdate. That is unnecessary because at that point the object is already saved to the DB.
This one is called first: https://github.com/project-radius/radius/blob/main/pkg/armrpc/frontend/controller/operation.go#L161
And then this is called: https://github.com/project-radius/radius/blob/main/pkg/linkrp/backend/controller/createorupdateresource.go#L38
Steps to reproduce (required)
No specific way
Observed behavior (required)
Unnecessary code branch
Desired behavior (required)
Workaround (optional)
System information
rad Version (required)
Operating system (required)
Additional context
AB#6766