Commit Graph

51 Commits

Author SHA1 Message Date
Tom Lebreux f3b392ada2
Move to wrangler v3 (#427) 2024-05-02 10:06:30 -04:00
Alejandro Ruiz f5d32fe214
Allow GeneratingHandlers to skip Apply if resource version didn't change (#341)
* Allow GeneratingHandlers to skip Apply if resource version didn't change

* Run go generate

* Add call count to FakeApply

* Add test for UniqueApplyForResourceVersion

* Simplify error handling

Co-authored-by: Kevin Joiner <10265309+KevinJoiner@users.noreply.github.com>

* Make generated code more readable

Co-authored-by: Kevin Joiner <10265309+KevinJoiner@users.noreply.github.com>

* Rename constant

* Rename seenResourceVersion to storeResourceVersion

* go generate

* Add comments to code generator

* Run go generate

* Upgrade golangci-lint GitHub action, since it always fails now

---------

Co-authored-by: Kevin Joiner <10265309+KevinJoiner@users.noreply.github.com>
2023-12-22 13:57:51 -05:00
Alejandro Ruiz 3040716d42
Use indexer when listing cached types by hash (#326)
* Add indexer by hash for cached types

* Upgrade golangci-lint GitHub action, since it always fails now
2023-12-22 13:56:56 -05:00
Ricardo Weir d4a7d13cee Update module to v2 and update paths 2023-09-01 17:51:39 -07:00
Kevin Joiner 707ef06124 Fix golangci-lint errors 2023-02-21 09:14:27 -05:00
Kevin Joiner b37532bed7 Fix wrangler unit tests. 2023-02-14 16:18:26 -05:00
Luther Monson 69f6fcbfbd fix truncated job annotations 2022-05-20 10:45:04 -07:00
Brad Davidson 376eb18f46 Fix desiredset list with owner
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2022-02-10 13:48:17 -08:00
Brad Davidson 815817c058 Optimize getDistinctNamespaces
The current implementation will perform poorly when the desiredset
contains a large number of objects and namespaces, as it does a linear
scan of the string slice for each object. A more optimal approach is to
build a map of namespaces, and just return the map keys. This is much
faster since map operations are O(1).

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2021-12-14 10:23:18 -08:00
Sergey Nasovich e7a18626ea Fixed distinct namespaces resolution in Apply 2021-11-29 19:04:25 -05:00
Jacob Payne e2966973ca fixed permissions errors when applying multiple namespaces 2021-11-10 16:53:28 -07:00
Dan Ramich 0cb88e08c8 Expand apply debug log 2021-10-14 15:11:44 -06:00
Darren Shepherd 0babd42fba Add ability to not prune objects based on a label 2021-08-19 13:38:59 -07:00
Dan Ramich 5647d24014 Add GetSelectorFromOwner helper 2021-08-03 09:07:02 -06:00
Nick Gerace acec00bd4a Add noDeleteGVK 2021-07-21 11:56:53 -04:00
Dan Ramich d572fa55d0 Check if object is namespaced for list calls 2021-06-18 11:18:27 -06:00
Darren Shepherd 94dbdf4854 Reduce the length of the applied annotation 2021-05-20 12:11:32 -07:00
Darren Shepherd 1d79560f11 Add ErrNoInformerFound and fix namespace logic 2021-02-19 09:13:35 -07:00
Darren Shepherd b45fb68c78 Make IsNamespaced work when it's not a known type to apply 2021-02-19 09:13:35 -07:00
Darren Shepherd 340730ca18 Never include status in patch 2020-09-22 12:14:00 -07:00
Darren Shepherd ef7399b336 Add ability run a JSON patch before calculating a diff 2020-09-15 10:10:42 -07:00
Darren Shepherd d73e141bcc Handle objectset with mixed versions of the same group/kind 2020-09-15 10:08:20 -07:00
Darren Shepherd b650f7923a Add ability to ignore previous state when applying 2020-09-12 15:49:52 -07:00
Darren Shepherd cfa5a107a3 Only fail apply if bot set ID and owner is not set 2020-09-08 22:02:33 -07:00
Darren Shepherd c52460ce2e Lister should use lister namespace 2020-08-28 22:23:47 -07:00
Darren Shepherd 1839adce1e Add secrets reconciler
secrets.Type field is immutable, so we replace on update.
2020-08-21 18:05:27 -07:00
Darren Shepherd c72acba0d9 Don't attempt to assign ownerReference if owner is nil 2020-08-14 20:57:29 -07:00
Darren Shepherd 4668dfc72f Ensure that setid is always set on apply 2020-08-14 20:57:29 -07:00
Darren Shepherd 464d24debe Lasso refactor 2020-04-15 22:19:21 -07:00
Darren Shepherd 56c1325653 Apply enhancements 2020-03-28 14:44:53 -07:00
Darren Shepherd 225a41c76b Upgrade to k8s 1.18 2020-03-26 12:13:23 -07:00
Jacob Blain Christen a107bb01f5 fix replace spurious wait errors
This address an issue in rancher/system-upgrade-controller#25 when generating objects `WithNoDelete()` where the replace logic fails with noisy 'Replace Wait' errors in the log.
This also mitigates the no-delete+replace logic swamping the rate limit for a custom type.
2020-02-25 12:20:36 -07:00
Darren Shepherd e5e1062ebf Move patch logic to separate package and add jsonpatch 2020-02-20 16:52:00 -07:00
Daishan 8dcea9c7cd Fix onwer reference bug 2019-11-08 14:55:12 -07:00
Darren Shepherd 70c703ac51 Add reconcilers for Deployment and DaemonSet 2019-11-03 23:42:10 -07:00
Dax McDonald 5427547a46 Add WithGVK() method to Apply interface
The WithGVK() allows for passing in a slice of GVK methods that can then
 be used by the implementation of the apply logic.

 In the case of the desiredSet it will use those gvk to search for
 previously created objects outside the scope of the current apply run.
2019-11-01 16:12:30 -07:00
Daishan ecd068ff0c Fix onwer can be cluster-scoped 2019-10-22 00:18:02 -07:00
Daishan 6a731953f0 Fix owner reference bug, add CustomColumn support 2019-10-21 09:55:22 -07:00
Darren Shepherd 52712fd766 Add reconciler 2019-10-14 10:13:42 -07:00
Matthias Lechner ac14c6773b Bugfix: when applying a non-namespace-scoped object that contains namespace metadata and the object has been applied before, apply() will delete the object 2019-09-18 15:28:28 +00:00
Darren Shepherd 7a6b3224f1 Add NewForConfig constructor for apply 2019-08-24 11:16:28 -07:00
Daishan 7e6fce5138 Fix lister issue 2019-08-16 10:24:03 -07:00
Darren Shepherd 901068548f Don't require Kind/APIVersion to be set for object to passed to apply 2019-06-11 17:22:32 -07:00
Darren Shepherd d2470fc4c5 Enhance apply API 2019-05-15 23:57:59 -07:00
Daishan Peng 31f3a4b0e3 make qps configurable 2019-05-03 11:29:30 -07:00
Daishan Peng e98654ff1b fix compile error 2019-04-29 16:14:35 -07:00
Darren Shepherd 50cf11d481 Remove dependency on mapper 2019-04-25 22:01:58 -07:00
Daishan Peng f708acec84 multiple fixes 2019-04-19 09:16:57 -07:00
Luther Monson e2cb629716 changed to namespace 2019-04-17 15:38:08 -07:00
Darren Shepherd 2c4c7e7765 fix issue in desired set 2019-03-29 09:52:41 -07:00