I am using OpenShift Online Pro and am following the DevOps with OpenShift book example about multiple project jenkins pipelines that starts at page 43.
I am trying a second run through the example so I used the webconsole to delete all the projects. When I then try to recreate the projects using oc new-project production
some of them fail to create with the error Error from server (AlreadyExists): project.project.openshift.io "production" already exists
even though the project doesn't show up on the output of oc projects
nor on the web console.
If I create and delete projects without following the steps in the book I get no problems and some projects don't have this problem. I happen to have two online pro accounts (a personal one and a collaboration). I can repeat the behaviour in the second online pro account.
It feels like that if I add the system:image-puller role to the service account of the project as per the book then delete the project it doesn't delete the service account. Then when I try to create deleted project afresh it fails as the service account is zombied:
oc policy add-role-to-group system:image-puller system:serviceaccounts:testing -n development
oc policy add-role-to-group system:image-puller system:serviceaccounts:production -n development
Is there something i can do to tidy up further any traces beyond deleting the project that can allow me to recreate the projects from the book example on OpenShift Online Pro?
Projects are deleted asynchronously after you send the delete command. So it's possible that the deletion just hasn't been reconciled yet. It should happen within a minute or so, so try again.
Also, please be aware that in a multitenant environment, like OpenShift Online, you are prevented from creating a project with the same name as any other project in the cluster, even if it's not your own. So if you can't create the project, it's possible that someone has already created a project with the same name.