Skip to content

Conversation

@wking
Copy link
Member

@wking wking commented May 5, 2023

In 4.11.0 (#1111) and 4.10.14 (#1114), I ported oc adm upgrade --to ... and friends from POST to PATCH. I used MergePatchType, based on RFC 7386, which isn't powerful enough for omitempty zero-value properties in the Update structure to clear any in-cluster values for that property. Luckily, we currently have no omitempty Update properties. But this commit transitions us to the more explict RFC 6902 JSON Patch, to ensure complete control over spec.desiredUpdate with the PATCH, even if Update grows 'omitempty' properties in the future.

I'm also taking the opportunity to transition to complete Marshal serialization, instead of using Sprintf to hand-craft part of the JSON patch body. This reduces the chances of coding typos introducing invalid-JSON issues.

In 4.11.0 [1] and 4.10.14 [2], I ported 'oc adm upgrade --to ...' and
friends from POST to PATCH.  I used MergePatchType, based on [3] RFC
7386 [4], which isn't powerful enough to clear 'omitempty' zero-value
properties in the `Update` structure to clear any in-cluster values
for that property.  Luckily, we currently have no 'omitempty' Update
properties [5].  But this commit transitions us to the more explict
RFC 6902 JSON Patch [6], to ensure complete control over
spec.desiredUpdate with the PATCH, even if Update grows 'omitempty'
properties in the future.

I'm also taking the opportunity to transition to complete Marshal
serialization, instead of using Sprintf to hand-craft part of the JSON
patch body.  This reduces the chances of coding typos introducing
invalid-JSON issues.

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=2075647#c6
[2]: https://bugzilla.redhat.com/show_bug.cgi?id=2077332#c7
[3]: https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/#use-a-json-merge-patch-to-update-a-deployment
[4]: https://www.rfc-editor.org/rfc/rfc7386
[5]: https://github.com/openshift/api/blob/8bbcb7ca71836dc87cce3ef63647403dc9d0fbea/config/v1/types_cluster_version.go#L454-L495
[6]: https://www.rfc-editor.org/rfc/rfc6902
@openshift-ci openshift-ci bot requested review from ardaguclu and soltysh May 5, 2023 08:45
@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 5, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 5, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 5, 2023

@wking: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-metal-ipi-ovn-ipv6 0f1a0b2 link false /test e2e-metal-ipi-ovn-ipv6
ci/prow/e2e-aws-ovn-serial 0f1a0b2 link true /test e2e-aws-ovn-serial
ci/prow/e2e-aws-ovn 0f1a0b2 link true /test e2e-aws-ovn
ci/prow/e2e-agnostic-ovn-cmd 0f1a0b2 link true /test e2e-agnostic-ovn-cmd

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@wking wking changed the title pkg/cli/admin/upgrade: Use JSON Patch OCPBUGS-8356: pkg/cli/admin/upgrade: Use JSON Patch May 5, 2023
@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels May 5, 2023
@openshift-ci-robot
Copy link

@wking: This pull request references Jira Issue OCPBUGS-8356, which is invalid:

  • expected the bug to target the "4.14.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

In 4.11.0 (#1111) and 4.10.14 (#1114), I ported oc adm upgrade --to ... and friends from POST to PATCH. I used MergePatchType, based on RFC 7386, which isn't powerful enough for omitempty zero-value properties in the Update structure to clear any in-cluster values for that property. Luckily, we currently have no omitempty Update properties. But this commit transitions us to the more explict RFC 6902 JSON Patch, to ensure complete control over spec.desiredUpdate with the PATCH, even if Update grows 'omitempty' properties in the future.

I'm also taking the opportunity to transition to complete Marshal serialization, instead of using Sprintf to hand-craft part of the JSON patch body. This reduces the chances of coding typos introducing invalid-JSON issues.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@wking
Copy link
Member Author

wking commented May 5, 2023

/hold

We'll want this as part of addressing OCPBUGS-8356, but we'll also want the API bump to make architecture omitempty , so holding until we can do both in one pull.

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 5, 2023
@wking
Copy link
Member Author

wking commented May 5, 2023

I've floated openshift/api#1455 with the omitempty pivot, and set a target release for the bug:

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels May 5, 2023
@openshift-ci-robot
Copy link

@wking: This pull request references Jira Issue OCPBUGS-8356, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.14.0) matches configured target version for branch (4.14.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @zhouying7780

Details

In response to this:

I've floated openshift/api#1455 with the omitempty pivot, and set a target release for the bug:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot requested a review from zhouying7780 May 5, 2023 15:56
@openshift-bot
Copy link
Contributor

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 Aug 4, 2023
@openshift-bot
Copy link
Contributor

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

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

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci openshift-ci bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Sep 3, 2023
@openshift-bot
Copy link
Contributor

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

@openshift-ci openshift-ci bot closed this Oct 4, 2023
@openshift-ci-robot
Copy link

@wking: This pull request references Jira Issue OCPBUGS-8356. The bug has been updated to no longer refer to the pull request using the external bug tracker.

Details

In response to this:

In 4.11.0 (#1111) and 4.10.14 (#1114), I ported oc adm upgrade --to ... and friends from POST to PATCH. I used MergePatchType, based on RFC 7386, which isn't powerful enough for omitempty zero-value properties in the Update structure to clear any in-cluster values for that property. Luckily, we currently have no omitempty Update properties. But this commit transitions us to the more explict RFC 6902 JSON Patch, to ensure complete control over spec.desiredUpdate with the PATCH, even if Update grows 'omitempty' properties in the future.

I'm also taking the opportunity to transition to complete Marshal serialization, instead of using Sprintf to hand-craft part of the JSON patch body. This reduces the chances of coding typos introducing invalid-JSON issues.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 4, 2023

@openshift-bot: Closed this PR.

Details

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

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. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants