Commit Graph

14 Commits

Author SHA1 Message Date
dependabot[bot] a8e20d9db3
Bump gomodules.xyz/jsonpatch/v2 from 2.4.0 to 2.5.0 (#3154)
* Bump gomodules.xyz/jsonpatch/v2 from 2.4.0 to 2.5.0

Bumps [gomodules.xyz/jsonpatch/v2](https://github.com/gomodules/jsonpatch) from 2.4.0 to 2.5.0.
- [Release notes](https://github.com/gomodules/jsonpatch/releases)
- [Changelog](https://github.com/gomodules/jsonpatch/blob/release-2.0/CHANGELOG.md)
- [Commits](https://github.com/gomodules/jsonpatch/compare/v2.4.0...v2.5.0)

---
updated-dependencies:
- dependency-name: gomodules.xyz/jsonpatch/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Run ./hack/update-codegen.sh

* fix patch unit test

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Dave Protasowski <dprotaso@gmail.com>
2025-04-11 13:38:14 +00:00
Dave Protasowski 8535fcc248
gofumpt the repo (#3067)
* gofumpt the repo

* don't prefix numbers with 0 - otherwise they're octal
2024-06-25 07:27:07 +00:00
Kenjiro Nakayama 4f651e0928
Bump gomodules.xyz/jsonpatch/v2 from 2.2.0 to 2.3.0 (#2789)
* Bump gomodules.xyz/jsonpatch/v2 from 2.2.0 to 2.3.0

Bumps [gomodules.xyz/jsonpatch/v2](https://github.com/gomodules/jsonpatch) from 2.2.0 to 2.3.0.
- [Release notes](https://github.com/gomodules/jsonpatch/releases)
- [Changelog](https://github.com/gomodules/jsonpatch/blob/release-2.0/CHANGELOG.md)
- [Commits](https://github.com/gomodules/jsonpatch/compare/v2.2.0...v2.3.0)

---
updated-dependencies:
- dependency-name: gomodules.xyz/jsonpatch/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Run ./hack/update-codegen.sh

* Fix test case

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-08-15 13:28:40 +00:00
Victor Agababov a371418524
v2 (#1754) 2020-09-29 13:18:29 -07:00
Markus Thömmes 5fbbde31b3
Align linters with serving (enables stylecheck and asciicheck) (#1738) 2020-09-23 07:37:40 -07:00
Victor Agababov db51a898b4
Add a test to verify #542 is not an issue (#1646)
Reading #542 I see we miss a test for that use case.
So I added one and the test passes as expected.
Perhaps there was a bug in the jsonpatch library we're using at the time
🤷
2020-08-24 10:52:47 -07:00
cshou 1cc3c3e852
Update jsonpatch lib that correctly handle object removal (#1078)
* update jsonpatch lib

* add more patch tests for removal
2020-02-12 08:27:22 -08:00
Matt Moore 43ca049cdb Reduce the boilerplate for setting up duck.InformerFactory's. (#896)
This augments the injection codegen with the capability to produce a duck.InformerFactory
attached to context for each type that we process.

Now a `duck.InformerFactory` for "Addressable" can be produced by "Get"ing it from the context.

This is triggered by placing `// +genduck` on the type that implements `duck.Implementable`.
2019-11-25 09:57:10 -08:00
Dan Gerdesmeier d8d1bc2718 Move duck patch helper function from Knative Serving to pkg (#681)
We have been maintaining a copy of this helper function in the Knative
Serving tests. Moving it here and adding tests so it can be used more
generally. The function allows creating a []byte patch without having to
check two levels of error conditions.
2019-09-15 21:35:40 -07:00
Thomas Shafer d5db385fcc Address some lint errors (#351)
* Fix lint error: Remove unused receiver name

* Fix lint error: consistent receiver name

* Update apis/duck/v1alpha1/conditions_types.go
Update apis/duck/v1alpha1/retired_targetable_types.go
Update apis/duck/v1alpha1/legacy_targetable_types.go

Co-Authored-By: trshafer <tshafer@google.com>
2019-04-05 08:52:57 -07:00
Matt Moore 0e41760cea Undo the patch sorting. (#192)
My prior change added sorting to the duck.CreatePatch method to try and stabilize the result of jsonpatch.CreatePatch, which is otherwise non-deterministic (probably walking a map?).

My bad assumption was that the patch operations this generated wouldn't conflict, e.g. it should use `replace` vs. `remove` and `add`.

Clearly this was bad because we start getting really strange errors trying to import this into knative/serving, e.g.
https://gubernator.knative.dev/build/knative-prow/pr-logs/pull/knative_serving/2646/pull-knative-serving-integration-tests/1070435951391543298/
2018-12-05 15:04:26 -08:00
Matt Moore c267dfecb7 This exempts defaulting from the rules governing field immutability. (#191)
Immutable fields with default values may now be changed iff they change is to populate their default value.  This is to support defaulting in the scenario where an object was created long ago and a new field (with a default!) is added.  When controllers attempt to mutate the object status today, this would create a webhook rejection!  With this change, we compare against a freshly defaulted "old" object to exclude newly defaulted fields from the immutability check.

We saw this in knative/serving for the newly added TimeoutSeconds field in Revision (otherwise immutable), which I believe it leading to upgrade testing flakes since post-upgrade Revision status updates will fail.
2018-12-05 13:40:26 -08:00
Gregory Haynes 594df37bfd Add support for StrategicMergePatch to duck (#145)
K8s fake clients only support StrategicMergePatches so we should be
creating patches in this format.

Fixes #144
2018-10-26 17:06:32 -07:00
Matt Moore e71b1a477d Create a helper for synthesizing patches. (#87) 2018-09-24 15:36:20 -07:00