Bug 1850681

Summary: cluster-config-operator does not properly update serviceEndpoint status
Product: OpenShift Container Platform Reporter: Daneyon Hansen <dhansen>
Component: InstallerAssignee: Abhinav Dahiya <adahiya>
Installer sub component: openshift-installer QA Contact: Yunfei Jiang <yunjiang>
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: medium    
Version: 4.6   
Target Milestone: ---   
Target Release: 4.6.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: 2020-10-27 16:08:51 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 Daneyon Hansen 2020-06-24 17:30:25 UTC
Description of problem:
AWS Endpoints are not removed from status of infrastructures.config.openshift.io after being removed from spec.

Version-Release number of the following components:
Cluster version is 4.6.0-0.nightly-2020-06-23-160540

How reproducible:
100%
Steps to Reproduce:
1. Install a 4.6.0 cluster
2. Update spec of infrastructure/cluster, for example:
  platformSpec:
    aws:
      serviceEndpoints:
      - name: route53
        url: https://route53.amazonaws.com

3. Verify status of infrastructure/cluster has been updated.
4. Remove the changes from step 3.
5. Verify status of infrastructure/cluster has NOT been updated.

Actual results:
Status still shows:

  platformSpec:
    aws:
      serviceEndpoints:
      - name: route53
        url: https://route53.amazonaws.com

Expected results:
That status was updated after removing serviceEndpoints from spec.

Additional info:
The following EP added custom endpoint support:

https://github.com/openshift/enhancements/blob/master/enhancements/installer/aws-custom-region-and-endpoints.md

Comment 1 Abhinav Dahiya 2020-06-24 18:05:47 UTC
> https://github.com/openshift/cluster-config-operator/blob/3ff40a9228ec536487ab392a6c2ec41a55e5e7cc/pkg/operator/aws_platform_service_location/controller.go#L78-L81

seems like the controller doesn't reconcile on reseting the list to zero.. as it treats that as no-op, 

we should change it to skip only when spec and status match, and not len == 0

Comment 2 Abhinav Dahiya 2020-06-29 17:16:43 UTC
this should be a blocker for 4.6 but we won't be able to get to it because of higher priority bugs.

Comment 6 Yunfei Jiang 2020-08-17 07:55:26 UTC
verified. PASS.

version: 4.6.0-0.nightly-2020-08-15-132419

1. oc describe infrastructure/cluster
...
Spec:
  Cloud Config:
    Name:  
  Platform Spec:
    Aws:
    Type:  AWS
...

2. oc edit infrastructure/cluster  (add service endpoint)

3. oc describe infrastructure/cluster
...
Spec:
  Cloud Config:
    Name:  
  Platform Spec:
    Aws:
      Service Endpoints:
        Name:  route53
        URL:   https://route53.amazonaws.com
    Type:      AWS
...

4. oc edit infrastructure/cluster  (remove service endpoint)

5. oc describe infrastructure/cluster
...
Spec:
  Cloud Config:
    Name:  
  Platform Spec:
    Aws:
    Type:  AWS
...

Comment 8 errata-xmlrpc 2020-10-27 16:08:51 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 (OpenShift Container Platform 4.6 GA Images), 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/RHBA-2020:4196