Bug 2066267

Summary: Submariner ServiceExport does not have unique condition types to wait for readiness
Product: Red Hat Advanced Cluster Management for Kubernetes Reporter: Noam Manos <nmanos>
Component: SubmarinerAssignee: Vishal Thapar <vthapar>
Status: CLOSED CURRENTRELEASE QA Contact: Noam Manos <nmanos>
Severity: low Docs Contact: Christopher Dawson <cdawson>
Priority: unspecified    
Version: rhacm-2.5CC: dfarrell, maafried, mbabushk, nyechiel, skitt
Target Milestone: ---   
Target Release: rhacm-2.6   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ACM 2.6 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-10-03 20:21:49 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 Noam Manos 2022-03-21 11:49:14 UTC
**What happened**:
After creating service export with subctl, ther's no way to validate it with kubectl/oc wait command, 
since Submariner ServiceExport does not have unique condition types to wait for readiness (all types are the same "Valid").

For example, on a working service export status it failed on:

$ oc wait serviceexport nginx-cl-bc --for=condition=Valid
error: timed out waiting for the condition on serviceexports/nginx-cl-bc

**What you expected to happen**:

If the service export is working, it should return something like:

multicluster.x-k8s.io/ServiceExportList condition met


**How to reproduce it (as minimally and precisely as possible)**:

# Create a service export:

$ oc get serviceexport
NAME          AGE
nginx-cl-bc   3h5m


$ oc get serviceexport -o yaml
apiVersion: v1
items:
- apiVersion: multicluster.x-k8s.io/v1alpha1
  kind: ServiceExport
  metadata:
    creationTimestamp: "2022-03-21T08:25:40Z"
    generation: 1
    name: nginx-cl-bc
    namespace: test-submariner
    resourceVersion: "115495575"
    selfLink: /apis/multicluster.x-k8s.io/v1alpha1/namespaces/test-submariner/serviceexports/nginx-cl-bc
    uid: 7af4a9ae-24f6-4d1d-9ac5-100664e03dd9
  status:
    conditions:
    - lastTransitionTime: "2022-03-21T08:25:39Z"
      message: Service doesn't have a global IP yet
      reason: ServiceGlobalIPUnavailable
      status: "False"
      type: Valid
    - lastTransitionTime: "2022-03-21T08:25:39Z"
      message: Awaiting sync of the ServiceImport to the broker
      reason: AwaitingSync
      status: "False"
      type: Valid
    - lastTransitionTime: "2022-03-21T08:25:39Z"
      message: Service was successfully synced to the broker
      reason: ""
      status: "True"
      type: Valid
    - lastTransitionTime: "2022-03-21T09:59:32Z"
      message: Service to be exported doesn't exist
      reason: ServiceUnavailable
      status: "False"
      type: Valid
    - lastTransitionTime: "2022-03-21T09:59:32Z"
      message: Service doesn't have a global IP yet
      reason: ServiceGlobalIPUnavailable
      status: "False"
      type: Valid
    - lastTransitionTime: "2022-03-21T09:59:33Z"
      message: Awaiting sync of the ServiceImport to the broker
      reason: AwaitingSync
      status: "False"
      type: Valid
    - lastTransitionTime: "2022-03-21T09:59:35Z"
      message: Service was successfully synced to the broker
      reason: ""
      status: "True"
      type: Valid
    - lastTransitionTime: "2022-03-21T10:20:16Z"
      message: Service to be exported doesn't exist
      reason: ServiceUnavailable
      status: "False"
      type: Valid
    - lastTransitionTime: "2022-03-21T10:20:16Z"
      message: Service doesn't have a global IP yet
      reason: ServiceGlobalIPUnavailable
      status: "False"
      type: Valid
kind: List
metadata:
  resourceVersion: ""
  selfLink: ""

$ oc wait serviceexport nginx-cl-bc --for=condition=Valid
error: timed out waiting for the condition on serviceexports/nginx-cl-bc


**Environment**:
- Submariner version v0.12.0

Comment 1 Stephen Kitt 2022-03-21 14:09:53 UTC
Is there any way to sync this to Lighthouse rather than the addon?

Comment 2 Noam Manos 2022-03-21 14:16:54 UTC
I don't think so, because in Bugzilla the only sub-component of ACM is Submariner.

Comment 3 Noam Manos 2022-03-21 14:20:49 UTC
(no other sub-components for Submariner)

Comment 4 bot-tracker-sync 2022-03-22 11:58:38 UTC
G2Bsync 1075028033 comment 
 skitt Tue, 22 Mar 2022 11:00:32 UTC 
 G2BSync @vthapar could you look into this, and open an issue in Lighthouse if necessary?

Comment 5 Nir Yechiel 2022-03-29 10:30:28 UTC
This is merged upstream in Submariner devel (so will be shipped in ACM 2.6). I don't think this is critical enough to be backported.

Comment 6 Maxim Babushkin 2022-08-02 11:43:55 UTC
The wait for condition for service export has been successfully verified on acm 2.6 / submariner 0.13.0