Skip to content

Commit

Permalink
fix: check private and remove validation check
Browse files Browse the repository at this point in the history
  • Loading branch information
ishaansehgal99 committed Oct 25, 2023
1 parent 1552eb6 commit e9ef63e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions api/v1alpha1/workspace_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,5 @@ func (i *InferenceSpec) validateUpdate(old *InferenceSpec) (errs *apis.FieldErro
errs = errs.Also(apis.ErrGeneric("field cannot be unset/set if it was set/unset", "template"))
}

if i.Preset.PresetMeta.AccessMode == "private" && i.Preset.PresetOptions.Image == "" {
errs = errs.Also(apis.ErrGeneric("When AccessMode is private, an image must be provided in PresetOptions").ViaField("presetOptions"))
}

return errs
}
2 changes: 1 addition & 1 deletion pkg/controllers/workspace_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ func (c *WorkspaceReconciler) getInferenceObjFromPreset(ctx context.Context, wOb
}

inferenceObj.AccessMode = string(wObj.Inference.Preset.PresetMeta.AccessMode)
if wObj.Inference.Preset.PresetOptions.Image != "" {
if inferenceObj.AccessMode == "private" && wObj.Inference.Preset.PresetOptions.Image != "" {
inferenceObj.Image = wObj.Inference.Preset.PresetOptions.Image

imagePullSecretRefs := []corev1.LocalObjectReference{}
Expand Down

0 comments on commit e9ef63e

Please sign in to comment.