Add GetGroupVersionKind and Selector WithPod#1043
Add GetGroupVersionKind and Selector WithPod#1043savitaashture wants to merge 1 commit intoknative:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: savitaashture The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
| // WithPodSpec is the shell around the PodSpecable within WithPod. | ||
| type WithPodSpec struct { | ||
| Template PodSpecable `json:"template,omitempty"` | ||
| Selector *metav1.LabelSelector `json:"selector"` |
There was a problem hiding this comment.
This would break compatibility with our own PodSpecables, like Service and Configuration.
There was a problem hiding this comment.
If that's the case then do we need to write new one because for controllers selector is mandatory
There was a problem hiding this comment.
See my comment on the PR. I think we shouldn't actually reserialize from the PodSpecable as that's a lossy conversion (as you noticed).
Instead, we should only override the relevant part of the unstructured that's been updated and part of PodSpecable
| } | ||
|
|
||
| // GetGroupVersionKind returns a GroupVersionKind. | ||
| func (*WithPod) GetGroupVersionKind() schema.GroupVersionKind { |
There was a problem hiding this comment.
Not sure if this is the right thing to do here as WithPod doesn't really exist. Should this read the actual GroupVersionKind from the typeMeta?
439ef64 to
546e090
Compare
|
The following is the coverage report on the affected files.
|
|
closing PR because it may break compatibility with |
Background:
as per the comments 1 and 2 usage of
PodSpecableduck type helps to reduce lot of duplicate codeIssue:
To use duck type for Deployment, DaemonSet, StatefulSet etc...
Selectorfield is mandatory and which is missing in WithPod and alsoGetGroupVersionKindimplementation