Skip to content

Commit

Permalink
Implement webhook validations for the XGBoostJob
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
  • Loading branch information
tenzen-y committed Apr 10, 2024
1 parent 1bf512e commit 850ff3a
Show file tree
Hide file tree
Showing 10 changed files with 429 additions and 318 deletions.
20 changes: 20 additions & 0 deletions manifests/base/webhook/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,23 @@ webhooks:
resources:
- pytorchjobs
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: webhook-service
namespace: system
path: /validate-kubeflow-org-v1-xgboostjob
failurePolicy: Fail
name: validator.xgboostjob.training-operator.kubeflow.org
rules:
- apiGroups:
- kubeflow.org
apiVersions:
- v1
operations:
- CREATE
- UPDATE
resources:
- xgboostjobs
sideEffects: None
3 changes: 3 additions & 0 deletions manifests/base/webhook/patch.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
- op: replace
path: /webhooks/0/clientConfig/service/name
value: training-operator
- op: replace
path: /webhooks/1/clientConfig/service/name
value: training-operator
- op: replace
path: /metadata/name
value: validator.training-operator.kubeflow.org
87 changes: 0 additions & 87 deletions pkg/apis/kubeflow.org/v1/xgboost_validation.go

This file was deleted.

222 changes: 0 additions & 222 deletions pkg/apis/kubeflow.org/v1/xgboost_validation_test.go

This file was deleted.

3 changes: 2 additions & 1 deletion pkg/cert/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ package cert

import (
"fmt"
"os"

cert "github.com/open-policy-agent/cert-controller/pkg/rotator"
"k8s.io/apimachinery/pkg/types"
"os"
ctrl "sigs.k8s.io/controller-runtime"
)

Expand Down
Loading

0 comments on commit 850ff3a

Please sign in to comment.