зеркало из https://github.com/Azure/ARO-RP.git
Simplified error message
This commit is contained in:
Родитель
118da75dc8
Коммит
26cc634bd1
|
@ -4,7 +4,6 @@ package v20210131preview
|
|||
// Licensed under the Apache License 2.0.
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
@ -214,9 +213,7 @@ func (sv *openShiftClusterStaticValidator) validateNetworkProfile(path string, n
|
|||
switch np.SDNProvider {
|
||||
case SDNProviderOVNKubernetes, SDNProviderOpenShiftSDN:
|
||||
default:
|
||||
fmt.Println(np.SDNProvider)
|
||||
errorMsg := fmt.Sprintf("The provided SDNProvider must be either '%s' or '%s'.", SDNProviderOVNKubernetes, SDNProviderOpenShiftSDN)
|
||||
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, path+".sdnProvider", errorMsg)
|
||||
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, path+".sdnProvider", "The provided SDNProvider '%s' is invalid.", np.SDNProvider)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
@ -473,7 +473,7 @@ func TestOpenShiftClusterStaticValidateNetworkProfileType(t *testing.T) {
|
|||
modify: func(oc *OpenShiftCluster) {
|
||||
oc.Properties.NetworkProfile.SDNProvider = "InvalidOption"
|
||||
},
|
||||
wantErr: "400: InvalidParameter: properties.networkProfile.sdnProvider: The provided SDNProvider must be either 'OVNKubernetes' or 'OpenShiftSDN'.",
|
||||
wantErr: "400: InvalidParameter: properties.networkProfile.sdnProvider: The provided SDNProvider 'InvalidOption' is invalid.",
|
||||
},
|
||||
{
|
||||
name: "networkProvider",
|
||||
|
@ -498,7 +498,7 @@ func TestOpenShiftClusterStaticValidateNetworkProfileType(t *testing.T) {
|
|||
modify: func(oc *OpenShiftCluster) {
|
||||
oc.Properties.NetworkProfile.SDNProvider = "InvalidOption"
|
||||
},
|
||||
wantErr: "400: InvalidParameter: properties.networkProfile.sdnProvider: The provided SDNProvider must be either 'OVNKubernetes' or 'OpenShiftSDN'.",
|
||||
wantErr: "400: InvalidParameter: properties.networkProfile.sdnProvider: The provided SDNProvider 'InvalidOption' is invalid.",
|
||||
},
|
||||
{
|
||||
name: "networkProvider",
|
||||
|
|
Загрузка…
Ссылка в новой задаче