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

package fuzzer

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

Index

Package Files

fuzzer.go

Variables

var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
    return []interface{}{
        func(r *rbac.RoleRef, c fuzz.Continue) {
            c.FuzzNoCustom(r)

            if len(r.APIGroup) == 0 {
                r.APIGroup = rbac.GroupName
            }
        },
        func(r *rbac.Subject, c fuzz.Continue) {
            switch c.Int31n(3) {
            case 0:
                r.Kind = rbac.ServiceAccountKind
                r.APIGroup = ""
                c.FuzzNoCustom(&r.Name)
                c.FuzzNoCustom(&r.Namespace)
            case 1:
                r.Kind = rbac.UserKind
                r.APIGroup = rbac.GroupName
                c.FuzzNoCustom(&r.Name)

                for r.Name == "*" {
                    c.FuzzNoCustom(&r.Name)
                }
            case 2:
                r.Kind = rbac.GroupKind
                r.APIGroup = rbac.GroupName
                c.FuzzNoCustom(&r.Name)
            }
        },
    }
}

Funcs returns the fuzzer functions for the rbac api group.

Package fuzzer imports 3 packages (graph) and is imported by 33 packages. Updated 2018-07-03. Refresh now. Tools for package owners.