Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #24 from mfranczy/perf-options
Browse files Browse the repository at this point in the history
fix errs check condition for spec and secrets validator
  • Loading branch information
stoyanr authored Oct 7, 2020
2 parents 4980abc + 06f95dd commit 07a50ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/kubevirt/machine_server_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ func decodeProviderSpecAndSecret(machineClass *v1alpha1.MachineClass, secret *co
return nil, status.Error(codes.Internal, wrapped.Error())
}

if errs := validation.ValidateKubevirtProviderSpec(providerSpec); errs != nil {
if errs := validation.ValidateKubevirtProviderSpec(providerSpec); len(errs) > 0 {
err = fmt.Errorf("could not validate provider spec: %v", errs)
klog.V(2).Infof(err.Error())
return nil, status.Error(codes.Internal, err.Error())
}

if errs := validation.ValidateKubevirtProviderSecrets(secret); errs != nil {
if errs := validation.ValidateKubevirtProviderSecrets(secret); len(errs) > 0 {
err = fmt.Errorf("could not validate provider secrets: %v", errs)
klog.V(2).Infof(err.Error())
return nil, status.Error(codes.Internal, err.Error())
Expand Down

0 comments on commit 07a50ee

Please sign in to comment.