audit: fix fuzzer

Kubernetes-commit: 58dd0879a754baff151913184ab5e1cd924fb19d
This commit is contained in:
Dr. Stefan Schimanski 2017-09-04 18:10:17 +02:00 committed by Kubernetes Publisher
parent ada39a8a4e
commit 433a5a01a7
1 changed files with 5 additions and 1 deletions

View File

@ -17,6 +17,8 @@ limitations under the License.
package fuzzer
import (
"strings"
fuzz "github.com/google/gofuzz"
"k8s.io/apimachinery/pkg/runtime"
@ -62,7 +64,9 @@ func Funcs(codecs runtimeserializer.CodecFactory) []interface{} {
o.APIGroup = "rbac.authorization.k8s.io"
o.APIVersion = "v1beta1"
default:
// use random value.
// use random value, but without / as it is used as separator
o.APIGroup = strings.Replace(o.APIGroup, "/", "-", -1)
o.APIVersion = strings.Replace(o.APIVersion, "/", "-", -1)
}
},
}