Today the library calls the provisioner's Delete method in different situations but only for greenfield provisioning where the reclaim policy is "Delete"
the OBC is deleted (most common)
the provsioner returns a Provision error
Provision is successful but the lib is unable to complete its job, eg. can't create the OB, secret or configmap (only for greenfield).
Note: assume Revoke is called for cleanup when Grant is called.
While proivisioners generally don't distinguish between these cases, the 3rd reason can likely be folded into the first since in both situations the provisioner knows the bucket was created and now it's being called to delete the bucket and related artifacts.
This issue addresses the 2nd case above. I propose that the lib should not call Delete when Provision returns an error. In this case provisioners should be expected to cleanup all artifacts that were created or altered before their Provision method returns.
Note: if this is implemented we will break all provisioners that rely on the lib to call their Delete method as one of the cleanup steps. This applies to all errors: those returned by Provision and those lib detected by the lib when it's creating resources.
Today the library calls the provisioner's
Delete
method in different situations but only for greenfield provisioning where the reclaim policy is "Delete"Provision
errorProvision
is successful but the lib is unable to complete its job, eg. can't create the OB, secret or configmap (only for greenfield).Note: assume
Revoke
is called for cleanup whenGrant
is called.While proivisioners generally don't distinguish between these cases, the 3rd reason can likely be folded into the first since in both situations the provisioner knows the bucket was created and now it's being called to delete the bucket and related artifacts.
This issue addresses the 2nd case above. I propose that the lib should not call Delete when
Provision
returns an error. In this case provisioners should be expected to cleanup all artifacts that were created or altered before their Provision method returns.Note: if this is implemented we will break all provisioners that rely on the lib to call their
Delete
method as one of the cleanup steps. This applies to all errors: those returned byProvision
and those lib detected by the lib when it's creating resources.@guymguym @nimrod-becker @copejon @screeley44