Skip to content

Commit

Permalink
release: Update KServe to v0.12.0 (#497)
Browse files Browse the repository at this point in the history
* Update kserve/kserve dependency to v0.12.0
* Update KServe CRDs to the ones in KServe v0.12.0
* Code adaptations for controller-runtime upgrade.

---------

Signed-off-by: Edgar Hernández <[email protected]>
  • Loading branch information
israel-hdez authored Apr 16, 2024
1 parent 0de0bd1 commit 15c2698
Show file tree
Hide file tree
Showing 12 changed files with 1,296 additions and 456 deletions.
12 changes: 3 additions & 9 deletions apis/serving/v1alpha1/servingruntime_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
// +kubebuilder:webhook:path=/validate-serving-modelmesh-io-v1alpha1-servingruntime,mutating=false,failurePolicy=fail,sideEffects=None,groups=serving.kserve.io,resources=servingruntimes;clusterservingruntimes,verbs=create;update,versions=v1alpha1,name=servingruntime.modelmesh-webhook-server.default,admissionReviewVersions=v1
type ServingRuntimeWebhook struct {
Client client.Client
decoder *admission.Decoder
Decoder *admission.Decoder
}

func (s *ServingRuntimeWebhook) Handle(ctx context.Context, req admission.Request) admission.Response {
Expand All @@ -42,7 +42,7 @@ func (s *ServingRuntimeWebhook) Handle(ctx context.Context, req admission.Reques

if req.Kind.Kind == "ServingRuntime" {
servingRuntime := &kservev1alpha.ServingRuntime{}
err := s.decoder.Decode(req, servingRuntime)
err := s.Decoder.Decode(req, servingRuntime)
if err != nil {
return admission.Errored(http.StatusBadRequest, err)
}
Expand All @@ -58,7 +58,7 @@ func (s *ServingRuntimeWebhook) Handle(ctx context.Context, req admission.Reques

} else {
clusterServingRuntime := &kservev1alpha.ClusterServingRuntime{}
err := s.decoder.Decode(req, clusterServingRuntime)
err := s.Decoder.Decode(req, clusterServingRuntime)
if err != nil {
return admission.Errored(http.StatusBadRequest, err)
}
Expand Down Expand Up @@ -92,12 +92,6 @@ func (s *ServingRuntimeWebhook) Handle(ctx context.Context, req admission.Reques
return admission.Allowed("Passed all validation checks for ServingRuntime")
}

// InjectDecoder injects the decoder.
func (s *ServingRuntimeWebhook) InjectDecoder(d *admission.Decoder) error {
s.decoder = d
return nil
}

// Validation of servingruntime autoscaler class
func validateServingRuntimeAutoscaler(annotations map[string]string) error {
value, ok := annotations[constants.AutoscalerClass]
Expand Down
17 changes: 16 additions & 1 deletion config/crd/bases/serving.kserve.io_clusterservingruntimes.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copied from https://github.com/kserve/kserve/blob/v0.11.2/config/crd/serving.kserve.io_clusterservingruntimes.yaml
# Copied from https://github.com/kserve/kserve/blob/v0.12.0/config/crd/serving.kserve.io_clusterservingruntimes.yaml
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -871,6 +871,19 @@ spec:
format: int32
type: integer
type: object
resizePolicy:
items:
properties:
resourceName:
type: string
restartPolicy:
type: string
required:
- resourceName
- restartPolicy
type: object
type: array
x-kubernetes-list-type: atomic
resources:
properties:
claims:
Expand Down Expand Up @@ -902,6 +915,8 @@ spec:
x-kubernetes-int-or-string: true
type: object
type: object
restartPolicy:
type: string
securityContext:
properties:
allowPrivilegeEscalation:
Expand Down
Loading

0 comments on commit 15c2698

Please sign in to comment.