Skip to content

Commit

Permalink
Add annotation check for the deployment mode (kubeflow#2338)
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Sun <dsun20@bloomberg.net>
  • Loading branch information
yuzisun authored Jul 16, 2022
1 parent a6ed8e4 commit 133eceb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/apis/serving/v1beta1/inference_service_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ func (isvc *InferenceService) Default() {
}

func (isvc *InferenceService) DefaultInferenceService(config *InferenceServicesConfig, deployConfig *DeployConfig) {
if deployConfig.DefaultDeploymentMode == string(constants.ModelMeshDeployment) ||
deployConfig.DefaultDeploymentMode == string(constants.RawDeployment) {
isvc.ObjectMeta.Annotations[constants.DeploymentMode] = deployConfig.DefaultDeploymentMode
if _, ok := isvc.ObjectMeta.Annotations[constants.DeploymentMode]; !ok {
if deployConfig.DefaultDeploymentMode == string(constants.ModelMeshDeployment) ||
deployConfig.DefaultDeploymentMode == string(constants.RawDeployment) {
isvc.ObjectMeta.Annotations[constants.DeploymentMode] = deployConfig.DefaultDeploymentMode
}
}
components := []Component{isvc.Spec.Transformer, isvc.Spec.Explainer}
deploymentMode, ok := isvc.ObjectMeta.Annotations[constants.DeploymentMode]
Expand Down

0 comments on commit 133eceb

Please sign in to comment.