Skip to content

Commit

Permalink
123
Browse files Browse the repository at this point in the history
  • Loading branch information
Valeriy Khorunzhin committed Sep 4, 2024
1 parent b4f1c98 commit b9b5ec1
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,12 @@ func NewValidator(client client.Client, log *slog.Logger) *Validator {

func (v *Validator) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
v.log.Info("kek")
return nil, fmt.Errorf("expected a new VirtualMachine but got a %T", obj)
// _, ok := obj.(*virtv2.VirtualMachineClass)
// if !ok {
// return nil, fmt.Errorf("expected a new VirtualMachine but got a %T", obj)
// }
_, ok := obj.(*virtv2.VirtualMachineClass)
if !ok {
return nil, fmt.Errorf("expected a new VirtualMachine but got a %T", obj)
}

// var warnings admission.Warnings
var warnings admission.Warnings

// // for _, validator := range v.validators {
// // warn, err := validator.ValidateCreate(ctx, vmclass)
Expand All @@ -60,7 +59,7 @@ func (v *Validator) ValidateCreate(ctx context.Context, obj runtime.Object) (adm
// // warnings = append(warnings, warn...)
// // }

// return warnings, nil
return warnings, nil
}

func (v *Validator) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
Expand Down

0 comments on commit b9b5ec1

Please sign in to comment.