Bug 2077332

Summary: 'oc adm upgrade ...' POSTs ClusterVersion, clobbering any unrecognized spec properties
Product: OpenShift Container Platform Reporter: OpenShift BugZilla Robot <openshift-bugzilla-robot>
Component: ocAssignee: W. Trevor King <wking>
oc sub component: oc QA Contact: Evgeni Vakhonin <evakhoni>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: high CC: mfojtik, travi, yanyang
Version: 4.1.z   
Target Milestone: ---   
Target Release: 4.10.z   
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: 2022-05-18 11:51:02 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: 2075647    
Bug Blocks:    

Comment 3 Evgeni Vakhonin 2022-05-08 17:39:35 UTC
Reproduced on Client Version: 4.10.0-0.nightly-2022-05-05-171206
oc get clusterversions.config.openshift.io version -ojson | jq -r '"spec", .spec, "status caps", .status.capabilities'
spec
{
  "capabilities": {
    "additionalEnabledCapabilities": [
      "marketplace"
    ],
    "baselineCapabilitySet": "None"
  },
  "channel": "stable-4.11",
  "clusterID": "27624e7d-74d3-4696-bd69-7d90de7ceaba"
}
status caps
{
  "enabledCapabilities": [
    "marketplace"
  ],
  "knownCapabilities": [
    "baremetal",
    "marketplace",
    "openshift-samples"
  ]
}

oc adm upgrade --allow-explicit-upgrade --force --to-image=registry.ci.openshift.org/ocp/release@sha256:a655fcffc1bf299563471eb71625eedf142b4a953f15dc2c8fa76438092495ac
warning: The requested upgrade image is not one of the available updates.You have used --allow-explicit-upgrade for the update to proceed anyway
warning: --force overrides cluster verification of your supplied release image and waives any update precondition failures.
Updating to release image registry.ci.openshift.org/ocp/release@sha256:a655fcffc1bf299563471eb71625eedf142b4a953f15dc2c8fa76438092495ac

oc get clusterversions.config.openshift.io version -ojson | jq -r '"spec", .spec, "status caps", .status.capabilities'                                                  
spec
{
  "channel": "stable-4.11",
  "clusterID": "27624e7d-74d3-4696-bd69-7d90de7ceaba",
  "desiredUpdate": {
    "force": true,
    "image": "registry.ci.openshift.org/ocp/release@sha256:a655fcffc1bf299563471eb71625eedf142b4a953f15dc2c8fa76438092495ac",
    "version": ""
  }
}
status caps
{
  "enabledCapabilities": [
    "marketplace"
  ],
  "knownCapabilities": [
    "baremetal",
    "marketplace",
    "openshift-samples"
  ]
}


so as in 4.11, unpatched 4.10 oc deleted .spec.capabilities



Verifying on Client Version: 4.10.0-0.nightly-2022-05-06-010401

oc get clusterversions.config.openshift.io version -ojson | jq -r '"spec", .spec, "status caps", .status.capabilities'
spec
{
  "capabilities": {
    "additionalEnabledCapabilities": [
      "marketplace"
    ],
    "baselineCapabilitySet": "None"
  },
  "channel": "stable-4.11",
  "clusterID": "27624e7d-74d3-4696-bd69-7d90de7ceaba"
}
status caps
{
  "enabledCapabilities": [
    "marketplace"
  ],
  "knownCapabilities": [
    "baremetal",
    "marketplace",
    "openshift-samples"
  ]
}

oc adm upgrade --allow-explicit-upgrade --force --to-image=registry.ci.openshift.org/ocp/release@sha256:f5b8f8472fc233294206f5f18e7cc40e62ccad03bbcba9bed902ac2ce723ab5b
warning: The requested upgrade image is not one of the available updates.You have used --allow-explicit-upgrade for the update to proceed anyway
warning: --force overrides cluster verification of your supplied release image and waives any update precondition failures.
Updating to release image registry.ci.openshift.org/ocp/release@sha256:f5b8f8472fc233294206f5f18e7cc40e62ccad03bbcba9bed902ac2ce723ab5b


oc get clusterversions.config.openshift.io version -ojson | jq -r '"spec", .spec, "status caps", .status.capabilities'
spec
{
  "capabilities": {
    "additionalEnabledCapabilities": [
      "marketplace"
    ],
    "baselineCapabilitySet": "None"
  },
  "channel": "stable-4.11",
  "clusterID": "27624e7d-74d3-4696-bd69-7d90de7ceaba",
  "desiredUpdate": {
    "force": true,
    "image": "registry.ci.openshift.org/ocp/release@sha256:f5b8f8472fc233294206f5f18e7cc40e62ccad03bbcba9bed902ac2ce723ab5b",
    "version": ""
  }
}
status caps
{
  "enabledCapabilities": [
    "marketplace"
  ],
  "knownCapabilities": [
    "baremetal",
    "marketplace",
    "openshift-samples"
  ]
}


verified: patched 4.10 oc preserved .spec.capabilities successfully

Comment 7 errata-xmlrpc 2022-05-18 11:51:02 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.10.14 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-2022:2178