@@ -100,6 +100,10 @@ var (
100100 }
101101)
102102
103+ const (
104+ injectedCABundleConfigMap = "injected-cabundle-stackrox-central-services"
105+ )
106+
103107// Deployer is the base deployer for ACS
104108type Deployer struct {
105109 logger * logger.Logger
@@ -222,6 +226,9 @@ func (d *Deployer) deleteCentralResources(ctx context.Context, wait bool) error
222226 {Name : "central-db-backup" , Kind : "pvc" , OwnerName : centralCrName },
223227 {Name : "admin-password" , Kind : "secret" },
224228 {Name : "scanner-db-password" , Kind : "secret" , OwnerName : centralCrName },
229+ // In case the Cluster Network Operator has succeeded in re-creating the injectedCABundleConfigMap
230+ // after our operator has already deleted it.
231+ {Name : injectedCABundleConfigMap , Kind : "configmap" },
225232 } {
226233 d .logger .Dimf ("Attempting to delete %s/%s" , resource .Kind , resource .Name )
227234 if resource .OwnerName != "" {
@@ -261,11 +268,7 @@ func (d *Deployer) preventOtherControllersFromReconciling(ctx context.Context) e
261268}
262269
263270func (d * Deployer ) preventCABundleInjection (ctx context.Context ) error {
264- configMapName := "injected-cabundle-stackrox-central-services"
265-
266- if ! d .doesResourceExist (ctx , "configmap" , configMapName , d .centralNamespace ) {
267- return nil
268- }
271+ configMapName := injectedCABundleConfigMap
269272
270273 d .logger .Info ("Removing CNO label from injected-cabundle ConfigMap to prevent CNO from injecting the CA bundle during cleanup" )
271274 _ , err := d .runKubectl (ctx , k8s.KubectlOptions {
0 commit comments