Skip to content

Conversation

@wking
Copy link
Member

@wking wking commented Apr 7, 2021

Addressing some of the ambiguities raised in rhbz#1825396.

These docs have not been adjusted since the properties landed in ab4ff93 (#293). The initial cluster-version operator implementation only used them for signature checks, openshift/cluster-version-operator@f8eff25191 (openshift/cluster-version-operator#170). At that time, RetrievePayload would always attempt to verify the proposed release image, including both signature validation and "does this look like a real release image?" checks. If that verification succeeded, it would set verified: true. If that verification failed, it would look at force, and if force was true, it would set verified: false and proceed with the update, while if force was false, it would reject the update.

Despite the API docs, availableUpdates never came into this in the CVO code. The only availableUpdates guards are client-side in oc, and the API docs are discussion the ClusterVersion API, not oc adm upgrade's --force API. In openshift/oc@0501d04ff1 (openshift/oc#109), oc's client-side guards split --allow-explicit-upgrade (for updating to something not in availableUpdates) and --allow-upgrade-with-warnings (for updating despite client-side guards against Progressing and Degraded ClusterVersion conditions) away from --force, but again, never part of the ClusterVersion force property's CVO-side handling.

Since then, the CVO grew precondition handlers in openshift/cluster-version-operator@aceb5bc66f (openshift/cluster-version-operator#243). syncOnce ran all the precondition checks, which at that point was just the Upgradeable ClusterOperator and ClusterVersion condition check. If that check failed, but force was true, it would proceed with the update, while if force was false, it would reject the update. In neither case would verified be altered; it continued to only track the signature and "does this look like a real release image?" checks. The idea at the time was that these would fall under the "normal protections" phrasing (overriden by force) and not the "other forms of consistency checking" phrasing (whatever those were supposed to be).

CC @smarterclayton

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wking
To complete the pull request process, please assign jwforres after the PR has been reviewed.
You can assign the PR to them by writing /assign @jwforres in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wking wking force-pushed the clarify-force-and-verified-docs branch from 8598057 to c49454a Compare April 7, 2021 20:37
@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 7, 2021
@bparees
Copy link
Contributor

bparees commented Jul 13, 2021

/approve

@wking can you fix the verification error?

@bparees bparees removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 13, 2021
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 13, 2021
@wking wking force-pushed the clarify-force-and-verified-docs branch from c49454a to b03d3f2 Compare July 14, 2021 04:16
@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 14, 2021
@wking wking force-pushed the clarify-force-and-verified-docs branch from b03d3f2 to 4a38236 Compare July 14, 2021 04:29
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 14, 2021
These docs have not been adjusted since the properties landed in
ab4ff93 (Update ClusterVersion to have a 'force' update flag and
track verified, 2019-04-22, openshift#293).  The initial cluster-version
operator implementation only used them for signature checks,
openshift/cluster-version-operator@f8eff25191 (sync: Report whether
updates are verified and allow admin override, 2019-04-20,
openshift/cluster-version-operator#170).  At that time,
RetrievePayload would always attempt to verify the proposed release
image, including both signature validation and "does this look like a
real release image?" checks.  If that verification succeeded, it would
set 'verified: true'.  If that verification failed, it would look at
'force', and if 'force' was true, it would set 'verified: false' and
proceed with the update, while if 'force' was false, it would reject
the update.

Despite the API docs, availableUpdates never came into this in the CVO
code.  The only availableUpdates guards are client-side in 'oc', and
the API docs are discussion the ClusterVersion API, not 'oc adm
upgrade's --force API.  In openshift/oc@0501d04ff1 (upgrade: Separate
flags for safety instead of abusing force, 2019-09-27,
openshift/oc#109), oc's client-side guards split
--allow-explicit-upgrade (for updating to something not in
availableUpdates) and --allow-upgrade-with-warnings (for updating
despite client-side guards against Progressing and Degraded
ClusterVersion conditions) away from --force, but again, never part of
the ClusterVersion force property's CVO-side handling.

Since then, the CVO grew precondition handlers in
openshift/cluster-version-operator@aceb5bc66f (pkg: add precondition
handlers and perform these checks before accepting Update, 2019-08-26,
openshift/cluster-version-operator#243).  syncOnce ran all the
precondition checks, which at that point was just the Upgradeable
ClusterOperator and ClusterVersion condition check.  If that check
failed, but 'force' was true, it would proceed with the update, while
if 'force' was false, it would reject the update.  In neither case
would 'verified' be altered; it continued to only track the signature
and "does this look like a real release image?" checks.  The idea at
the time was that these would fall under the "normal protections"
phrasing (overriden by force) and not the "other forms of consistency
checking" phrasing (whatever those were supposed to be).
@wking wking force-pushed the clarify-force-and-verified-docs branch from 4a38236 to 4d4f989 Compare July 14, 2021 04:57
@wking
Copy link
Member Author

wking commented Jul 14, 2021

can you fix the verification error?

Done with c49454a -> 4d4f989.

@bparees
Copy link
Contributor

bparees commented Jul 14, 2021

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 14, 2021
@openshift-merge-robot openshift-merge-robot merged commit 0a6cab7 into openshift:master Jul 14, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 14, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bparees, wking

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wking wking deleted the clarify-force-and-verified-docs branch July 14, 2021 13:43
properties:
force:
description: "force allows an administrator to update to an image that has failed verification, does not appear in the availableUpdates list, or otherwise would be blocked by normal protections on update. This option should only be used when the authenticity of the provided image has been verified out of band because the provided image will run with full administrative access to the cluster. Do not use this flag with images that comes from unknown or potentially malicious sources. \n This flag does not override other forms of consistency checking that are required before a new update is deployed."
description: force allows an administrator to update to an image that has failed verification or upgradeable checks. This option should only be used when the authenticity of the provided image has been verified out of band because the provided image will run with full administrative access to the cluster. Do not use this flag with images that comes from unknown or potentially malicious sources.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wking "upgradeable checks" is still somewhat unclear to someone not steeped in our internal meanings.

"there is no edge from your cluster version to this target version" is an "upgradeable check"(at least to a naive user) but not one that force has any influence on, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants