diff --git a/apis/resources/v1alpha1/bento_types.go b/apis/resources/v1alpha1/bento_types.go index 096e422..7545b2a 100644 --- a/apis/resources/v1alpha1/bento_types.go +++ b/apis/resources/v1alpha1/bento_types.go @@ -56,10 +56,11 @@ type BentoSpec struct { // +kubebuilder:validation:Required Tag string `json:"tag"` // +kubebuilder:validation:Required - Image string `json:"image"` - Context *BentoContext `json:"context,omitempty"` - Runners []BentoRunner `json:"runners,omitempty"` - Models []BentoModel `json:"models,omitempty"` + Image string `json:"image"` + ServiceName string `json:"serviceName,omitempty"` + Context *BentoContext `json:"context,omitempty"` + Runners []BentoRunner `json:"runners,omitempty"` + Models []BentoModel `json:"models,omitempty"` ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"` } diff --git a/apis/resources/v1alpha1/bentorequest_types.go b/apis/resources/v1alpha1/bentorequest_types.go index 339ada9..9d65cc0 100644 --- a/apis/resources/v1alpha1/bentorequest_types.go +++ b/apis/resources/v1alpha1/bentorequest_types.go @@ -58,6 +58,7 @@ type BentoRequestSpec struct { // +kubebuilder:validation:Required BentoTag string `json:"bentoTag"` DownloadURL string `json:"downloadUrl,omitempty"` + ServiceName string `json:"serviceName,omitempty"` Context *BentoContext `json:"context,omitempty"` Runners []BentoRunner `json:"runners,omitempty"` Models []BentoModel `json:"models,omitempty"` diff --git a/apis/resources/v1alpha1/zz_generated.deepcopy.go b/apis/resources/v1alpha1/zz_generated.deepcopy.go index 4fef321..3f85bda 100644 --- a/apis/resources/v1alpha1/zz_generated.deepcopy.go +++ b/apis/resources/v1alpha1/zz_generated.deepcopy.go @@ -22,11 +22,10 @@ limitations under the License. package v1alpha1 import ( - timex "time" - - v1 "k8s.io/api/core/v1" + "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" + timex "time" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/config/crd/bases/resources.yatai.ai_bentoes.yaml b/config/crd/bases/resources.yatai.ai_bentoes.yaml index 7af4651..5e8c4b5 100644 --- a/config/crd/bases/resources.yatai.ai_bentoes.yaml +++ b/config/crd/bases/resources.yatai.ai_bentoes.yaml @@ -98,6 +98,8 @@ spec: - name type: object type: array + serviceName: + type: string tag: type: string required: diff --git a/config/crd/bases/resources.yatai.ai_bentorequests.yaml b/config/crd/bases/resources.yatai.ai_bentorequests.yaml index 5f0fa78..1e7063b 100644 --- a/config/crd/bases/resources.yatai.ai_bentorequests.yaml +++ b/config/crd/bases/resources.yatai.ai_bentorequests.yaml @@ -1389,6 +1389,8 @@ spec: - name type: object type: array + serviceName: + type: string required: - bentoTag type: object diff --git a/controllers/resources/bentorequest_controller.go b/controllers/resources/bentorequest_controller.go index 0703698..6bd31cc 100644 --- a/controllers/resources/bentorequest_controller.go +++ b/controllers/resources/bentorequest_controller.go @@ -244,11 +244,12 @@ func (r *BentoRequestReconciler) Reconcile(ctx context.Context, req ctrl.Request Namespace: bentoRequest.Namespace, }, Spec: resourcesv1alpha1.BentoSpec{ - Tag: bentoRequest.Spec.BentoTag, - Image: imageInfo.ImageName, - Context: bentoRequest.Spec.Context, - Runners: bentoRequest.Spec.Runners, - Models: bentoRequest.Spec.Models, + Tag: bentoRequest.Spec.BentoTag, + Image: imageInfo.ImageName, + ServiceName: bentoRequest.Spec.ServiceName, + Context: bentoRequest.Spec.Context, + Runners: bentoRequest.Spec.Runners, + Models: bentoRequest.Spec.Models, }, } diff --git a/helm/yatai-image-builder-crds/templates/bentorequest.yaml b/helm/yatai-image-builder-crds/templates/bentorequest.yaml index c7505ba..dd6fa7a 100644 --- a/helm/yatai-image-builder-crds/templates/bentorequest.yaml +++ b/helm/yatai-image-builder-crds/templates/bentorequest.yaml @@ -91,6 +91,8 @@ spec: - name type: object type: array + serviceName: + type: string tag: type: string required: @@ -944,6 +946,8 @@ spec: - name type: object type: array + serviceName: + type: string required: - bentoTag type: object