Commit Graph

14 Commits

Author SHA1 Message Date
Ansu Varghese 5c8cc3c9ef
Ignore migration of CRDs that aren't installed (#2493)
* Ignore migration of CRD that is not installed

Signed-off-by: aavarghese <avarghese@us.ibm.com>

* Ignore error from ParseBool

Co-authored-by: Dave Protasowski <dprotaso@gmail.com>

* Review comments to check for error in main

Signed-off-by: aavarghese <avarghese@us.ibm.com>

* REmoving test

Signed-off-by: aavarghese <avarghese@us.ibm.com>

* Update log output format

Co-authored-by: Dave Protasowski <dprotaso@gmail.com>

Co-authored-by: Dave Protasowski <dprotaso@gmail.com>
2022-04-28 19:25:52 +00:00
Kenjiro Nakayama 2783cd8cfa
Do not block NotFound error during patching resources (#2403)
storage-version-migration-serving crashes if ksvc deleted during
migration.

Please refer to the following error especially
`services.serving.knative.dev \"receiver261\" not found` message.

```
{"severity":"INFO","timestamp":"2022-01-25T14:17:19.840090884Z","caller":"logging/config.go:116","message":"Successfully created the logger."}
{"severity":"INFO","timestamp":"2022-01-25T14:17:19.840350704Z","caller":"logging/config.go:117","message":"Logging level set to: info"}
{"severity":"INFO","timestamp":"2022-01-25T14:17:19.840399959Z","caller":"logging/config.go:79","message":"Fetch GitHub commit ID from kodata failed","error":"\"KO_DATA_PATH\" does not exist or is empty"}
{"severity":"INFO","timestamp":"2022-01-25T14:17:19.854296148Z","logger":"storage-migrator","caller":"migrate/main.go:60","message":"Migrating 4 group resources"}
{"severity":"INFO","timestamp":"2022-01-25T14:17:19.85439718Z","logger":"storage-migrator","caller":"migrate/main.go:63","message":"Migrating group resource services.serving.knative.dev"}
{"severity":"EMERGENCY","timestamp":"2022-01-25T14:17:47.601002153Z","logger":"storage-migrator","caller":"migrate/main.go:65","message":"Failed to migrate: unable to patch resource kc-broker-newsubs-kn-0/receiver261 (gvr: serving.knative.dev/v1, Resource=services) - services.serving.knative.dev \"receiver261\" not found","stacktrace":"main.main\n\t/opt/app-root/src/go/src/knative.dev/serving/vendor/knative.dev/pkg/apiextensions/storageversion/cmd/migrate/main.go:65\nruntime.main\n\t/usr/lib/golang/src/runtime/proc.go:255"}
```

It could be a rare case but it happens when an user delete their
resource during storage-version-migration-serving is running.

This patch fixes the issue by ignoring the NotFound error during
patching resources.
2022-01-28 06:59:47 -08:00
Dave Protasowski fa2f8f1955
drop fake dynamic client workaround (#2310)
the upstream changes have merged
2021-10-13 08:28:48 -07:00
Dave Protasowski eaa823c765
bump k8s to v1.20.7 (#2145)
* bump k8s deps to v1.20.7

* fix migrator test pkg

* dynamicclient now expects List types to be declare either via a scheme or manually

* fix error message comparison

* drop excess vendor licenses

* Using the injection fake dynamic client will preserve pre-1.20 behaviour

This is accomplished by preprocessing the scheme/fixtures and declaring
a custom scheme were we map our types & lists to unstructured.* types

* revert webhook factory changes

* ensure objects to the dynamic client are unstructured

* seed the default dynamic client with k8s scheme

* include duckv1 types in default fake dynamic client scheme

* use default k8s scheme
looks like eventing adds to this scheme but we should import the correct one vs the one from the  fake package

* drop duckv1 from default scheme

* set APIVersion/Kind if empty

* refactor ToUnstructured helper to a new package
2021-06-10 06:56:43 -07:00
Dave Protasowski 47dfdcfaed
consolidate k8s flags to an environment package (#2133)
* consolidate k8s flags to an environment package

* add copyright

* fix comment style

* use go1.16 in workflows so downstream tests work

* Deprecate GetRESTConfig and do not remove

* update copyright date
2021-05-28 13:30:30 -07:00
Victor Agababov 247841408e
Apply the cleanup to the pkg (#1776)
* Apply the cleanup to the pkg

This is probably the final iteration of my cleanup application.

* codegen

* one more try
2020-10-05 21:41:20 -07:00
Victor Agababov 1e373a9e5d
take 2 (#1755) 2020-09-29 14:10:29 -07:00
Victor Agababov a371418524
v2 (#1754) 2020-09-29 13:18:29 -07:00
Zbynek Roubalik 2d4efecc6b
bump to k8s 1.18 (#1428)
* bump to k8s 1.18.8

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* plumbing ctx through

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* add more ctx plumbing

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* ctx WithCancel()

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2020-09-11 07:54:00 -07:00
Markus Thömmes d21012af55
Deprecate --master flag in favor of --server. (#1693)
* Deprecate --master flag in favor of --server.

* Actually just drop the flag altogether.
2020-09-09 09:57:50 -07:00
Dave Protasowski c99955c477
use apiextensions v1 apis for migrator (#1445) 2020-06-24 11:28:27 -07:00
Victor Agababov f6cfa4c47c
Clean context.TODO in pkg and other minor nits (#1337)
- TODO is for migration, we know we want background there
- other nits
2020-05-15 10:58:02 -07:00
Markus Thömmes d29cf98a77
Assorted linting fixes. (#1249)
* Remove unused code.

* Use raw strings to avoid escaping.

* Remove unneeded type conversions.

* Preallocate slices where possible.

* Use semantic equality in psbinding reconciler.
2020-04-28 08:20:51 -07:00
Dave Protasowski 466c676678
Include utility to migrate a CRD's storage version (#1197)
* include utility to migrate a CRD's storage version

* fix godoc function name

* godoc updates

* drop use of fmt.Sprintf

* Update apiextensions/storageversion/cmd/migrate/main.go

Co-Authored-By: Victor Agababov <vagababov@gmail.com>

* Update apiextensions/storageversion/migrator_test.go

Co-Authored-By: Victor Agababov <vagababov@gmail.com>

* Update apiextensions/storageversion/migrator_test.go

Co-Authored-By: Victor Agababov <vagababov@gmail.com>

* test formatting

Co-authored-by: Victor Agababov <vagababov@gmail.com>
2020-04-06 16:14:59 -07:00