kubernetes: k8s.io/kubernetes/pkg/apis/discovery/fuzzer Index | Files

package fuzzer

import "k8s.io/kubernetes/pkg/apis/discovery/fuzzer"

Index

Package Files

fuzzer.go

Variables

var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
    return []interface{}{
        func(obj *discovery.EndpointSlice, c fuzz.Continue) {
            c.FuzzNoCustom(obj)

            addressTypes := []discovery.AddressType{discovery.AddressTypeIPv4, discovery.AddressTypeIPv6, discovery.AddressTypeFQDN}
            obj.AddressType = addressTypes[c.Rand.Intn(len(addressTypes))]

            for i, endpointPort := range obj.Ports {
                if endpointPort.Name == nil {
                    emptyStr := ""
                    obj.Ports[i].Name = &emptyStr
                }

                if endpointPort.Protocol == nil {
                    protos := []api.Protocol{api.ProtocolTCP, api.ProtocolUDP, api.ProtocolSCTP}
                    obj.Ports[i].Protocol = &protos[c.Rand.Intn(len(protos))]
                }
            }
        },
    }
}

Funcs returns the fuzzer functions for the discovery api group.

Package fuzzer imports 4 packages (graph) and is imported by 14 packages. Updated 2019-11-29. Refresh now. Tools for package owners.