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

fix errs check condition for spec and secrets validator #24

Merged
merged 1 commit into from
Oct 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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