Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1892718

Summary: HostAlreadyClaimed: The new route cannot be loaded with a new api group version
Product: OpenShift Container Platform Reporter: Hongkai Liu <hongkliu>
Component: NetworkingAssignee: Miciah Dashiel Butler Masters <mmasters>
Networking sub component: router QA Contact: Hongan Li <hongli>
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: low CC: amcdermo, aos-bugs, bmcelvee, hongli, mfisher, misalunk, mmasters, naoto30, pbertera
Version: 4.5   
Target Milestone: ---   
Target Release: 4.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-27 22:33:58 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:
Embargoed:

Description Hongkai Liu 2020-10-29 14:13:14 UTC
Description of problem:
We found this issue when we got an alert telling our certs are going to expired.
https://coreos.slack.com/archives/CHY2E1BL4/p1603971876367100

The secret with the certs has been refreshed by cert-manager.
The new route has been created but

```
status:
  ingress:
  - conditions:
    - lastTransitionTime: "2020-09-30T18:20:28Z"
      message: route release-controller-njlt8 already exposes amd64.ocp.releases.ci.openshift.org and is older
      reason: HostAlreadyClaimed
      status: "False"
      type: Admitted
    host: amd64.ocp.releases.ci.openshift.org
    routerCanonicalHostname: apps.ci.l2s4.p1.openshiftapps.com
    routerName: default
    wildcardPolicy: None
```

Miciah pointed out that it is caused by the diffrent apiVersion field in the ownerReferences of the routes:

```
  ownerReferences:
  - apiVersion: extensions/v1beta1
    controller: true
    kind: Ingress
    name: release-controller
    uid: 7e5bc7d4-343c-4007-a4a2-7069df58d840
```

```
  ownerReferences:
  - apiVersion: networking.k8s.io/v1beta1
    controller: true
    kind: Ingress
    name: release-controller
    uid: 7e5bc7d4-343c-4007-a4a2-7069df58d840
```

We hit this issue on OCP 4.6 but the old route was created when the cluster was on 4.4. (no issue found at 4.5 since 4.5 lasts only a short time and we have no new routes created during that time.)

Workaround:
Delete the old route and then the new one works.

Comment 2 Pietro Bertera 2020-11-12 08:41:41 UTC
*** Bug 1896678 has been marked as a duplicate of this bug. ***

Comment 4 Miciah Dashiel Butler Masters 2021-05-27 02:27:06 UTC
I believe this issue was fixed with the transition from the networking.k8s.io/v1beta1 API version to the networking.k8s.io/v1 API version.  This transition added logic to match owner references that specify old API versions: https://github.com/openshift/openshift-controller-manager/pull/172/commits/02113185908eef2b06e9b31a8720f14d719001a2#diff-5100b0e98310cb270f5b9b2bc09313e46cdb9c509eef0ea3a76dda2a07ce987bR555-R565

Comment 5 Hongan Li 2021-05-31 05:13:28 UTC
verified with 4.8.0-0.nightly-2021-05-29-114625 and passed.

the ingress always shows "apiVersion: networking.k8s.io/v1" whatever use "extensions/v1beta1" or "networking.k8s.io/v1beta1" to create to ingress resources.


$ oc get ingress path-ingress -oyaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  creationTimestamp: "2021-05-31T04:55:20Z"
  generation: 1
  managedFields:
  - apiVersion: extensions/v1beta1


$ oc get ingress path-ingress2 -oyaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  creationTimestamp: "2021-05-31T05:01:23Z"
  generation: 1
  managedFields:
  - apiVersion: networking.k8s.io/v1beta1


And the route generated by openshift-controller-manager has same apiVersion in ownerReferences:

  ownerReferences:
  - apiVersion: networking.k8s.io/v1
    controller: true
    kind: Ingress
    name: path-ingress
    uid: 9bb72d21-5c2e-45bb-9a50-c2fa219895ab

Comment 7 Brandi Munilla 2021-06-24 16:51:32 UTC
Hi, does this bug require doc text? If so, please update the doc text field.

Comment 9 errata-xmlrpc 2021-07-27 22:33:58 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.8.2 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:2438