diff --git a/apis/duck/v1/podspec_types.go b/apis/duck/v1/podspec_types.go index 0dd9ec3386..ff587a727f 100644 --- a/apis/duck/v1/podspec_types.go +++ b/apis/duck/v1/podspec_types.go @@ -20,6 +20,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" "knative.dev/pkg/apis" "knative.dev/pkg/apis/duck" @@ -44,7 +45,8 @@ type WithPod struct { // WithPodSpec is the shell around the PodSpecable within WithPod. type WithPodSpec struct { - Template PodSpecable `json:"template,omitempty"` + Selector *metav1.LabelSelector `json:"selector"` + Template PodSpecable `json:"template,omitempty"` } // Assert that we implement the interfaces necessary to @@ -82,6 +84,11 @@ func (*WithPod) GetListType() runtime.Object { return &WithPodList{} } +// GetGroupVersionKind returns a GroupVersionKind. +func (*WithPod) GetGroupVersionKind() schema.GroupVersionKind { + return SchemeGroupVersion.WithKind("WithPod") +} + // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // WithPodList is a list of WithPod resources diff --git a/apis/duck/v1/zz_generated.deepcopy.go b/apis/duck/v1/zz_generated.deepcopy.go index 2fcfbed776..7bd54485bb 100644 --- a/apis/duck/v1/zz_generated.deepcopy.go +++ b/apis/duck/v1/zz_generated.deepcopy.go @@ -21,6 +21,7 @@ limitations under the License. package v1 import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" apis "knative.dev/pkg/apis" ) @@ -483,6 +484,11 @@ func (in *WithPodList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *WithPodSpec) DeepCopyInto(out *WithPodSpec) { *out = *in + if in.Selector != nil { + in, out := &in.Selector, &out.Selector + *out = new(metav1.LabelSelector) + (*in).DeepCopyInto(*out) + } in.Template.DeepCopyInto(&out.Template) return }