Bug 2014165

Summary: [4.6.z] Cluster-version operator loads proxy config from spec, not status
Product: OpenShift Container Platform Reporter: Pablo Alonso Rodriguez <palonsor>
Component: Cluster Version OperatorAssignee: Over the Air Updates <aos-team-ota>
Status: CLOSED ERRATA QA Contact: Johnny Liu <jialiu>
Severity: low Docs Contact:
Priority: low    
Version: 4.2.0CC: aos-bugs, aos-team-ota, jialiu, jokerman, openshift-bugzilla-robot, palonsor, wking
Target Milestone: ---   
Target Release: 4.6.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2007674 Environment:
Last Closed: 2021-11-03 21:01:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2007674    
Bug Blocks:    

Comment 1 Pablo Alonso Rodriguez 2021-10-14 14:47:55 UTC
*** Bug 2014170 has been marked as a duplicate of this bug. ***

Comment 2 Johnny Liu 2021-10-15 04:50:35 UTC
Verified this bug with pre-merge build, and PASS

[root@preserve-jialiu-ansible ~]# oc get co network
NAME      VERSION                                                  AVAILABLE   PROGRESSING   DEGRADED   SINCE
network   4.6.0-0.ci.test-2021-10-15-022413-ci-ln-blf1xq2-latest   True        False         False      98m

[root@preserve-jialiu-ansible ~]# oc patch proxies.config.openshift.io/cluster --patch '{"spec":{"httpProxy":"testing"}}' --type=merge
proxy.config.openshift.io/cluster patched

[root@preserve-jialiu-ansible ~]# oc patch proxies.config.openshift.io/cluster --patch '{"spec":{"httpsProxy":"testing"}}' --type=merge
proxy.config.openshift.io/cluster patched

[root@preserve-jialiu-ansible ~]# oc get proxies.config.openshift.io cluster -o json
{
    "apiVersion": "config.openshift.io/v1",
    "kind": "Proxy",
    "metadata": {
        "creationTimestamp": "2021-10-15T02:55:49Z",
        "generation": 3,
        "name": "cluster",
        "resourceVersion": "49092",
        "selfLink": "/apis/config.openshift.io/v1/proxies/cluster",
        "uid": "3b8e2941-c109-4021-8b2d-7f79df800dc1"
    },
    "spec": {
        "httpProxy": "testing",
        "httpsProxy": "testing",
        "noProxy": "test.no-proxy.com",
        "trustedCA": {
            "name": ""
        }
    },
    "status": {
        "httpProxy": "http://proxy-user1:xxxx@ec2-18-119-134-28.us-east-2.compute.amazonaws.com:3128",
        "httpsProxy": "http://proxy-user1:xxxxx@ec2-18-119-134-28.us-east-2.compute.amazonaws.com:3128",
        "noProxy": ".cluster.local,.svc,.us-east-2.compute.internal,10.0.0.0/16,10.128.0.0/14,127.0.0.1,169.254.169.254,172.30.0.0/16,api-int.jialiu46.qe.devcluster.openshift.com,etcd-0.jialiu46.qe.devcluster.openshift.com,etcd-1.jialiu46.qe.devcluster.openshift.com,etcd-2.jialiu46.qe.devcluster.openshift.com,localhost,test.no-proxy.com"
    }
}


[root@preserve-jialiu-ansible ~]# oc get co network
NAME      VERSION                                                  AVAILABLE   PROGRESSING   DEGRADED   SINCE
network   4.6.0-0.ci.test-2021-10-15-022413-ci-ln-blf1xq2-latest   True        False         True       101m


[root@preserve-jialiu-ansible ~]# oc describe co network
Name:         network
Namespace:    
Labels:       <none>
Annotations:  network.operator.openshift.io/last-seen-state: {"DaemonsetStates":[],"DeploymentStates":[]}
API Version:  config.openshift.io/v1
Kind:         ClusterOperator
<--snip-->
Status:
  Conditions:
    Last Transition Time:  2021-10-15T04:45:24Z
    Message:               The configuration is invalid for proxy 'cluster' (invalid httpProxy URI: parse "testing": invalid URI for request). Use 'oc edit proxy.config.openshift.io cluster' to fix.
    Reason:                InvalidProxyConfig
    Status:                True
    Type:                  Degraded
    Last Transition Time:  2021-10-15T03:03:46Z
    Status:                True
    Type:                  Upgradeable
    Last Transition Time:  2021-10-15T03:15:19Z
    Status:                False
    Type:                  Progressing
    Last Transition Time:  2021-10-15T03:04:42Z
    Status:                True
    Type:                  Available
  Extension:               <nil>
<--snip-->

[root@preserve-jialiu-ansible ~]# oc adm upgrade
Cluster version is 4.6.0-0.ci.test-2021-10-15-022413-ci-ln-blf1xq2-latest

Upstream: https://api.openshift.com/api/upgrades_info/v1/graph
Channel: stable-4.6
warning: Cannot display available updates:
  Reason: VersionNotFound
  Message: Unable to retrieve available updates: currently reconciling cluster version 4.6.0-0.ci.test-2021-10-15-022413-ci-ln-blf1xq2-latest not found in the "stable-4.6" channel

CVO does not complain about the proxy URI, using status for that.

Comment 4 Johnny Liu 2021-10-18 01:25:22 UTC
Per comment 2, move to verified.

Comment 7 errata-xmlrpc 2021-11-03 21:01:40 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.49 bug fix 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/RHBA-2021:4009