Commit 4f15359
committed
feat(kubernetes): add a GetObjectMeta accessor to ObjectMeta
Embedding promotes ObjectMeta's fields, but only a method survives type
erasure: a consumer walking a tree holds each resource as an any, and Go
generics cannot constrain on a field. Without an accessor every consumer
has to reach the typed name and namespace with its own per-kind closure
or reflection.
Mirrors resource.Resource's GetBase, with an Object interface to assert
on in the same way as resource.Implementation.1 parent cd76ef2 commit 4f15359
1 file changed
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
0 commit comments