crdfuzz

package module
v0.29.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 31, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

README

crd-schema-fuzz

Fuzz testing for Kubernetes CustomResourceDefinition schemas

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SafeFuzzerFuncs

func SafeFuzzerFuncs(funcs ...fuzzer.FuzzerFuncs) fuzzer.FuzzerFuncs

SafeFuzzerFuncs will merge the given funcLists, replacing any fuzzer for metav1.ObjectMeta with a fuzzer safe to use as a CRD embedded ObjectMeta. An ObjectMeta embedded inside a CRD only supports the following 5 fields. So, all other fields are set to their zero value.

  • Name
  • Namespace
  • Labels
  • Annotations
  • Finalizers

ref: https://github.com/kubernetes-sigs/controller-tools/commit/adfbf775195bf1c2366286684cc77a97b04a8cb9

func SchemaFuzzTestForCRDWithPath

func SchemaFuzzTestForCRDWithPath(t *testing.T, scheme *runtime.Scheme, path string, fuzzingFuncs fuzzer.FuzzerFuncs)

SchemaFuzzTestForCRDWithPath will perform schema validation based pruning fuzz tests against all versions defined in a file containing a single CustomResourceDefinition resource in any support CRD APIVersion (currently v1beta1 and v1)

func SchemaFuzzTestForInternalCRD

func SchemaFuzzTestForInternalCRD(t *testing.T, scheme *runtime.Scheme, crd *apiextensions.CustomResourceDefinition, fuzzingFuncs fuzzer.FuzzerFuncs)

SchemaFuzzTestForInternalCRD will perform schema validation based pruning fuzz tests against all versions defined in a given CRD object.

func SchemaFuzzTestForObject

func SchemaFuzzTestForObject(t *testing.T, scheme *runtime.Scheme, obj runtime.Object, schema *structuralschema.Structural, fuzzingFuncs fuzzer.FuzzerFuncs)

SchemaFuzzTestForObject will run schema validation based pruning fuzz tests against a single given obj using the provided schema.

func SchemaFuzzTestForV1CRD

func SchemaFuzzTestForV1CRD(t *testing.T, scheme *runtime.Scheme, crd *crdv1.CustomResourceDefinition, fuzzingFuncs fuzzer.FuzzerFuncs)

SchemaFuzzTestForV1CRD will perform schema validation based pruning fuzz tests against all versions defined in a given v1 CRD object.

func SchemaFuzzTestForV1beta1CRD

func SchemaFuzzTestForV1beta1CRD(t *testing.T, scheme *runtime.Scheme, crd *crdv1beta1.CustomResourceDefinition, fuzzingFuncs fuzzer.FuzzerFuncs)

SchemaFuzzTestForV1beta1CRD will perform schema validation based pruning fuzz tests against all versions defined in a given v1beta1 CRD object.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL