Open rooftopcellist opened 3 years ago
If done in the Credential
delete method, we may need to put it in a task if this might take a long time. But I'm not sure.
We discussed the potential for a reaper. @tvo318 we should add a Known Issue for 4.0:
"Image pull secrets created by Tower will remain in Container Group namespaces after running jobs that use Execution Environments that use Container Registry credentials."
There is a PR for this, but not sure it's the best solution. Instead of doing this as a one-off background task, it would be best to have a reaper like @kdelee mentioned.
@amolgautam25 Here are some notes of how to test this:
First, you'll need a k8s or openshift cluster and creds for it.
If memory serves, then you'll need to:
Follow-up this PR: https://github.com/ansible/awx/pull/10204 Follow-up to this Issue: https://github.com/ansible/awx/issues/10114
ISSUE TYPE
SUMMARY
Currently, we create image pull secrets in the namespace of the cluster defined in the Container Group. These secrets remain after job runs and get re-used. This is fine, the issue is when a registry credential is deleted. In this case, we should delete all associated cluster secrets.
To do this, we need to:
For example:
Alternatively, we could try to maintain a list of known pull secrets and delete from that list...
This could be done here in the credential
destroy()
method.ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
The image pull secret should be deleted.
ACTUAL RESULTS
Currently, the secret must be deleted manually. Secret will remain.