Commit 90b9dd4
authored
[fix][fn] Make /version return correct version (#20047)
### Motivation
The `/version` endpoint for functions currently returns `{"version":"version.number"}` instead of an actual version number. This PR fixes that.
One observation is that the broker's `/version` endpoint returns a plain string:
https://github.com/apache/pulsar/blob/82237d3684fe506bcb6426b3b23f413422e6e4fb/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/BrokersBase.java#L527-L535
### Modifications
* Return the actual version.
* Use a static field to decrease the cost of this endpoint.
### Verifying this change
This is a trivial change.
### Documentation
- [x] `doc-not-needed`
This fixes an endpoint, no docs are needed.
### Matching PR in forked repository
PR in forked repository: Skipping PR since this is so trivial1 parent 421d707 commit 90b9dd4
1 file changed
Lines changed: 5 additions & 10 deletions
File tree
- pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest
Lines changed: 5 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
27 | 25 | | |
28 | 26 | | |
29 | | - | |
| 27 | + | |
30 | 28 | | |
31 | 29 | | |
32 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | 38 | | |
42 | 39 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 40 | + | |
46 | 41 | | |
47 | 42 | | |
48 | 43 | | |
0 commit comments