Bug 2077332 - 'oc adm upgrade ...' POSTs ClusterVersion, clobbering any unrecognized spec properties
Summary: 'oc adm upgrade ...' POSTs ClusterVersion, clobbering any unrecognized spec p...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.1.z
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: 4.10.z
Assignee: W. Trevor King
QA Contact: Evgeni Vakhonin
URL:
Whiteboard:
Depends On: 2075647
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-04-21 05:04 UTC by OpenShift BugZilla Robot
Modified: 2022-05-18 11:51 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-18 11:51:02 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc pull 1114 0 None open [release-4.10] Bug 2077332: pkg/cli/admin/upgrade: Use PATCH instead of POST for spec updates 2022-04-21 05:04:31 UTC
Red Hat Product Errata RHBA-2022:2178 0 None None None 2022-05-18 11:51:18 UTC

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


Note You need to log in before you can comment on or make changes to this bug.