Bug 1574884

Summary: unable to delete buildconfig post upgrade to 3.6
Product: OpenShift Container Platform Reporter: Rajnikant <rkant>
Component: MasterAssignee: Michal Fojtik <mfojtik>
Status: CLOSED NOTABUG QA Contact: Wang Haoran <haowang>
Severity: high Docs Contact:
Priority: medium    
Version: 3.6.0CC: aos-bugs, bparees, cstark, erich, jmalde, jokerman, mfojtik, mmccomas, rkant
Target Milestone: ---   
Target Release: 3.6.z   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-03-07 11:21:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Rajnikant 2018-05-04 09:20:10 UTC
Description of problem:
Unable to delete buildconfig

Version-Release number of selected component (if applicable):
OpenShift Container Platform 3.6

How reproducible:
Post upgrade to 3.6 it's not possible to delete a buildconfig:
Tried with admin, cluster-admin as well, bot no luck

- while deleteing BC finalizers: orphan, where original BC does not contain finalizer.

<snip from BC>
  deletionGracePeriodSeconds: 0
  deletionTimestamp: 2018-04-24T08:32:24Z
  - orphan

Tried using cascade=false without success.

# oc delete bc BC-NAME --cascade=false

After removing finalizers definition bc disappeared immediately.

Build contains ownerReferences, suggested to delete build first and check,tried but did not work.

<snip from build file>
- apiVersion: v1
  kind: Build
    - apiVersion: build.openshift.io/v1
      controller: true
      kind: BuildConfig

Steps to Reproduce:

Actual results:

Expected results:

Additional info:

Comment 2 Michal Fojtik 2018-05-07 09:41:55 UTC
I think the BuildConfig might also depend on secrets/etc. I'm not sure what changed in 3.6 regarding to ownerRefs and GC for BuildConfigs, Ben do you know?

If the Builds have ownerRefs to BuildConfig and the GC is running, I don't think you need a finalizer and the builds should be removed automatically with the GC. This might be a migration issue, where we should make sure no finalizers are present?

Comment 3 Ben Parees 2018-05-07 11:45:10 UTC
I believe the only ownerrefs we added were from builds to buildconfigs.  The buildconfig may have refs to secrets but there shouldn't be any ownership relation between them (at least not one *we* setup, obviously a user could create them).

But the orphan finalizer isn't ours, we never had a finalizer for builds/buildconfigs, so I don't know where the finalizer is coming from?