Commit b8fa7f7
CONSOLE-4806: Remove static extensions from knative-plugin (#15641)
* feat: Refactor Knative plugin: replace plugin.tsx with plugin.ts, update console-extensions.json to include new topology data model factories for serving, eventing, and kamelets, and remove deprecated topology-plugin.ts file
* CONSOLE-4806: Support CodeRef for topology resources property
Enable dynamic plugin extensions to use CodeRef for the resources
property in topology data model factories. This allows plugins to
fetch resources dynamically at runtime (e.g., discovering CRDs).
Changes:
- Update TopologyDataModelFactory type to accept CodeRef<() => Promise<WatchK8sResourcesGeneric>>
- Add Promise resolution in DataModelExtension for CodeRef resources
- Update get-knative-resources functions to return Promises with resource definitions
- Maintain backward compatibility with static resource definitions
The implementation follows the same pattern as other CodeRef properties
(getDataModel, isResourceDepicted) by resolving the Promise eagerly
during extension initialization and caching the result.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* Apply suggestions from code review
Co-authored-by: logonoff <[email protected]>
* fix: fix the review comments from @logonoff
* OCPBUGS-4806: Convert knative topology resources from CodeRef to static definitions
Replaces dynamic CodeRef-based resource definitions with inline static definitions for knative-serving and kamelets topology model factories, removing the need for runtime resolution. Adds compatibility layer for converting dynamic model factories to internal plugin format.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* OCPBUGS-4806: Remove static topology data model factory extensions
Refactor topology package to remove static extension support and rely
exclusively on dynamic plugin SDK for topology data model factories.
Key changes:
- Remove TopologyDataModelFactory extension interface and related types
- Simplify ApplicationDropdown to use only base watched resources
- Remove legacy function format support in useTopologyDataModelFactory
- Eliminate conversion layer between dynamic and static factories
- Update DataModelProvider to handle only dynamic extensions
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* Apply suggestions from code review
Co-authored-by: logonoff <[email protected]>
* Update frontend/packages/knative-plugin/src/utils/get-knative-resources.ts
Co-authored-by: logonoff <[email protected]>
* OCPBUGS-4806: Refactor topology data model to use useResolvedExtensions
Replace custom useResolvedResources hook with built-in useResolvedExtensions
to simplify the topology data model extension handling. This removes the need
for manual CodeRef resolution and improves error messaging with plugin context.
Changes:
- Use useResolvedExtensions instead of useExtensions in DataModelProvider
- Remove useTopologyDataModelFactory hook (no longer needed)
- Simplify DataModelExtension to work with pre-resolved extensions
- Add plugin ID to error messages for better debugging
- Use referenceForExtensionModel for better CRD reference resolution
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* fix: Refactor DataModelExtension to streamline resource conversion
* Implement async resource resolution for dynamic model factories in DataModelProvider
---------
Co-authored-by: Claude <[email protected]>
Co-authored-by: logonoff <[email protected]>1 parent 80b3db5 commit b8fa7f7
File tree
13 files changed
+317
-326
lines changed- frontend/packages
- console-dynamic-plugin-sdk
- docs
- src/extensions
- knative-plugin
- src
- topology
- utils
- topology/src
- components/dropdowns
- data-transforms
- extensions
13 files changed
+317
-326
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1158 | 1158 | | |
1159 | 1159 | | |
1160 | 1160 | | |
1161 | | - | |
| 1161 | + | |
1162 | 1162 | | |
1163 | 1163 | | |
1164 | 1164 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
Lines changed: 100 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2008 | 2008 | | |
2009 | 2009 | | |
2010 | 2010 | | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
2011 | 2111 | | |
2012 | 2112 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
This file was deleted.
Lines changed: 0 additions & 91 deletions
This file was deleted.
Lines changed: 38 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 24 | + | |
28 | 25 | | |
29 | 26 | | |
30 | 27 | | |
| |||
438 | 435 | | |
439 | 436 | | |
440 | 437 | | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
460 | 460 | | |
461 | | - | |
462 | 461 | | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
467 | 476 | | |
468 | 477 | | |
Lines changed: 4 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | 3 | | |
8 | | - | |
9 | 4 | | |
10 | 5 | | |
11 | | - | |
12 | 6 | | |
13 | | - | |
14 | 7 | | |
15 | 8 | | |
16 | 9 | | |
17 | 10 | | |
18 | 11 | | |
19 | 12 | | |
20 | 13 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | 14 | | |
31 | 15 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
42 | 19 | | |
43 | 20 | | |
44 | 21 | | |
45 | 22 | | |
46 | | - | |
| 23 | + | |
47 | 24 | | |
48 | 25 | | |
49 | 26 | | |
| |||
0 commit comments