Skip to content

Conversation

@smarterclayton
Copy link
Contributor

Administrators will need a knob to override upgrades where the payload
is not signed correctly, and future code will guard against more scenarios.

Add a verified tag to history to convey whether we checked the update.
This will be set on upgrades if the payload was verified before update.

/hold

Waiting on openshift/cluster-version-operator#170. Requried for GA

@openshift-ci-robot openshift-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 23, 2019
Administrators will need a knob to override upgrades where the payload
is not signed correctly, and future code will guard against more scenarios.

Add a verified tag to history to convey whether we checked the update.
This will be set on upgrades if the payload was verified before update.
@abhinavdahiya
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 23, 2019
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavdahiya, smarterclayton

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

@smarterclayton smarterclayton removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 23, 2019
@openshift-merge-robot openshift-merge-robot merged commit 515b356 into openshift:master Apr 23, 2019
wking added a commit to wking/openshift-api that referenced this pull request Jul 16, 2020
The outgoing text is unchanged since the property landed ab4ff93
(Update ClusterVersion to have a 'force' update flag and track
verified, 2019-04-22, openshift#293).  Those docs fit on the 'oc' client side
until openshift/oc@0501d04ff1 (upgrade: Separate flags for safety
instead of abusing force, 2019-09-27, openshift/oc#109), but never
applied to the cluster-version operator (CVO) side or the
ClusterVersion type.  The CVO uses Force to bypass verification
failures [1] (invalid pullspec [2], lack of trusted signature [3],
etc.) or preconditions [4] (ClusterVersion had Upgradeable=False for a
requested minor bump [5]).

[1]: https://github.com/openshift/cluster-version-operator/blob/28e4400eeb9ded7e09ff684e75780599cb25ec2c/pkg/cvo/updatepayload.go#L91-L102
[2]: https://github.com/openshift/cluster-version-operator/blob/28e4400eeb9ded7e09ff684e75780599cb25ec2c/pkg/verify/verify.go#L138
[3]: https://github.com/openshift/cluster-version-operator/blob/28e4400eeb9ded7e09ff684e75780599cb25ec2c/pkg/verify/verify.go#L182
[4]: https://github.com/openshift/cluster-version-operator/blob/28e4400eeb9ded7e09ff684e75780599cb25ec2c/pkg/cvo/sync_worker.go#L527-L529
[5]: https://github.com/openshift/cluster-version-operator/blob/28e4400eeb9ded7e09ff684e75780599cb25ec2c/pkg/payload/precondition/clusterversion/upgradeable.go#L74-L79
wking added a commit to wking/openshift-api that referenced this pull request Jul 16, 2020
The outgoing text is unchanged since the property landed ab4ff93
(Update ClusterVersion to have a 'force' update flag and track
verified, 2019-04-22, openshift#293).  Those docs fit on the 'oc' client side
until openshift/oc@0501d04ff1 (upgrade: Separate flags for safety
instead of abusing force, 2019-09-27, openshift/oc#109), but never
applied to the cluster-version operator (CVO) side or the
ClusterVersion type.  The CVO uses Force to bypass verification
failures [1] (invalid pullspec [2], lack of trusted signature [3],
etc.) or preconditions [4] (ClusterVersion had Upgradeable=False for a
requested minor bump [5]).  availableUpdates is orthogonal.

I don't know what "other forms of consistency checking" was about, so
I've dropped that too.  If folks want to call out explicit categories
that cannot be overridden with Force, we should do that with less
ambiguous wording.

[1]: https://github.com/openshift/cluster-version-operator/blob/28e4400eeb9ded7e09ff684e75780599cb25ec2c/pkg/cvo/updatepayload.go#L91-L102
[2]: https://github.com/openshift/cluster-version-operator/blob/28e4400eeb9ded7e09ff684e75780599cb25ec2c/pkg/verify/verify.go#L138
[3]: https://github.com/openshift/cluster-version-operator/blob/28e4400eeb9ded7e09ff684e75780599cb25ec2c/pkg/verify/verify.go#L182
[4]: https://github.com/openshift/cluster-version-operator/blob/28e4400eeb9ded7e09ff684e75780599cb25ec2c/pkg/cvo/sync_worker.go#L527-L529
[5]: https://github.com/openshift/cluster-version-operator/blob/28e4400eeb9ded7e09ff684e75780599cb25ec2c/pkg/payload/precondition/clusterversion/upgradeable.go#L74-L79
wking added a commit to wking/openshift-api that referenced this pull request Jul 16, 2020
The outgoing text is unchanged since the property landed ab4ff93
(Update ClusterVersion to have a 'force' update flag and track
verified, 2019-04-22, openshift#293).  Those docs fit on the 'oc' client side
until openshift/oc@0501d04ff1 (upgrade: Separate flags for safety
instead of abusing force, 2019-09-27, openshift/oc#109), but never
applied to the cluster-version operator (CVO) side or the
ClusterVersion type.  The CVO uses Force to bypass verification
failures [1] (invalid pullspec [2], lack of trusted signature [3],
etc.) or preconditions [4] (ClusterVersion had Upgradeable=False for a
requested minor bump [5]).  availableUpdates is orthogonal.

I don't know what "other forms of consistency checking" was about, so
I've dropped that too.  If folks want to call out explicit categories
that cannot be overridden with Force, we should do that with less
ambiguous wording.

Autogenerated bumps via:

  $ hack/update-swagger-docs.sh
  $ make update-codegen-crds

[1]: https://github.com/openshift/cluster-version-operator/blob/28e4400eeb9ded7e09ff684e75780599cb25ec2c/pkg/cvo/updatepayload.go#L91-L102
[2]: https://github.com/openshift/cluster-version-operator/blob/28e4400eeb9ded7e09ff684e75780599cb25ec2c/pkg/verify/verify.go#L138
[3]: https://github.com/openshift/cluster-version-operator/blob/28e4400eeb9ded7e09ff684e75780599cb25ec2c/pkg/verify/verify.go#L182
[4]: https://github.com/openshift/cluster-version-operator/blob/28e4400eeb9ded7e09ff684e75780599cb25ec2c/pkg/cvo/sync_worker.go#L527-L529
[5]: https://github.com/openshift/cluster-version-operator/blob/28e4400eeb9ded7e09ff684e75780599cb25ec2c/pkg/payload/precondition/clusterversion/upgradeable.go#L74-L79
wking added a commit to wking/openshift-api that referenced this pull request Apr 7, 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 added a commit to wking/openshift-api that referenced this pull request Apr 7, 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 added a commit to wking/openshift-api that referenced this pull request 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 added a commit to wking/openshift-api that referenced this pull request 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 added a commit to wking/openshift-api that referenced this pull request 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 added a commit to wking/openshift-api that referenced this pull request Aug 17, 2021
This type used to be used for both the admin-provided
spec.desiredUpdate and the operator-provided status.desired.  That
changed in 575f8d2 (config/v1: New Release type for
ClusterVersionStatus, 2019-01-19, openshift#521, 4.6), when status.desired
moved to a new Release type, so now Update is only used for
spec.desiredUpdate.

The properties have been '+optional' since they landed in 898d7e3
(api: Move ClusterVersion/ClusterOperator into config.openshift.io,
2018-11-09, openshift#127) and ab4ff93 (Update ClusterVersion to have a
'force' update flag and track verified, 2019-04-22, openshift#293).

I'm adding 'omitempty', because if the admin doesn't have a particular
version or image in mind, returning explicit empty strings is
distracting noise.  With this commit, it will be easier to focus on
the version or image property that did get set, and you need at least
one of them to be set to be a usable update request.

The force property is a bit more wiggly, since there may be some
benefit to explicitly pointing out that the admin is not forcing the
update.  But forcing is supposed to be an exceptional-situation safety
valve, so I'm adding omitempty there too, because the benefit of
de-emphasizing the property's presence (and reducing the chance that
an admin says "hey, let's see what 'force: true' does" without reading
associated docs) outweighs the benefit of explicitly pointing out
'force: false' cases.
wking added a commit to wking/openshift-api that referenced this pull request Nov 3, 2025
We've been dragging this around since growing the 'force' property in
ab4ff93 (Update ClusterVersion to have a 'force' update flag and
track verified, 2019-04-22, openshift#293).
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. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants