fixtures

package
v3.16.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

fixtures package contains commonly used ConstraintTemplates, Constraints, Objects and other k8s resources mostly used for testing.

Index

Constants

View Source
const (
	TemplateValidateUserInfo = `` /* 512-byte string literal not displayed */

	TemplateAlwaysValidate = `` /* 367-byte string literal not displayed */

	TemplateNeverValidate = `` /* 359-byte string literal not displayed */

	TemplateNeverValidateTwice = `` /* 462-byte string literal not displayed */

	TemplateUnsupportedVersion = `` /* 370-byte string literal not displayed */

	TemplateInvalidYAML = `` /* 371-byte string literal not displayed */

	TemplateMarshalError = `
kind: ConstraintTemplate
apiVersion: templates.gatekeeper.sh/v1beta1
metadata:
  name: alwaysvalidate
spec: [a, b, c]
`

	TemplateCompileError = `` /* 355-byte string literal not displayed */

	ConstraintAlwaysValidate = `
kind: AlwaysValidate
apiVersion: constraints.gatekeeper.sh/v1beta1
metadata:
  name: always-pass
`

	ConstraintExcludedNamespace = `` /* 162-byte string literal not displayed */

	ConstraintIncludedNamespace = `` /* 154-byte string literal not displayed */

	ConstraintClusterScope = `` /* 146-byte string literal not displayed */

	ConstraintNamespaceSelector = `` /* 184-byte string literal not displayed */

	ConstraintNeverValidate = `
kind: NeverValidate
apiVersion: constraints.gatekeeper.sh/v1beta1
metadata:
  name: always-fail
`

	ConstraintNeverValidateTwice = `
kind: NeverValidateTwice
apiVersion: constraints.gatekeeper.sh/v1beta1
metadata:
  name: always-fail-twice
`

	ConstraintInvalidYAML = `
kind: AlwaysValidate
apiVersion: constraints.gatekeeper.sh/v1beta1
metadata:
  name: always-pass
  {}: {}
`

	ConstraintWrongTemplate = `
kind: Other
apiVersion: constraints.gatekeeper.sh/v1beta1
metadata:
  name: other
`

	Object = `
kind: Object
apiVersion: group.sh/v1
metadata:
  name: object
`
	ObjectMultiple = `` /* 131-byte string literal not displayed */

	ObjectIncluded = `
kind: Object
apiVersion: group.sh/v1
metadata:
  name: object
  namespace: included
`

	ObjectExcluded = `
kind: Object
apiVersion: group.sh/v1
metadata:
  name: object
  namespace: excluded
`

	ObjectNamespaceScope = `
kind: Object
apiVersion: group.sh/v1
metadata:
  name: object
  namespace: foo
`

	ObjectClusterScope = `
kind: Object
apiVersion: group.sh/v1
metadata:
  name: object
`

	ObjectInvalid = `
kind Object
apiVersion: group.sh/v1
metadata:
  name: object`

	ObjectEmpty = ``

	ObjectInvalidInventory = `
kind: Object
metadata:
  name: object
---
kind: Object
apiVersion: group.sh/v1
metadata:
  name: object`

	NamespaceSelected = `
kind: Namespace
apiVersion: /v1
metadata:
  name: foo
  labels:
    bar: qux
`
	NamespaceNotSelected = `
kind: Namespace
apiVersion: /v1
metadata:
  name: foo
  labels:
    bar: bar
`

	TemplateReferential = `` /* 1662-byte string literal not displayed */

	ConstraintReferential = `` /* 162-byte string literal not displayed */

	ObjectReferentialInventory = `` /* 159-byte string literal not displayed */

	ObjectReferentialAllow = `` /* 165-byte string literal not displayed */

	ObjectReferentialDeny = `` /* 162-byte string literal not displayed */

	TemplateRequiredLabel = `` /* 966-byte string literal not displayed */

	ConstraintRequireLabelInvalid = `` /* 143-byte string literal not displayed */

	ConstraintRequireLabelValid = `` /* 145-byte string literal not displayed */

	// AdmissionReviewMissingRequest makes sure that our code can handle nil requests.
	AdmissionReviewMissingRequest = `
kind: AdmissionReview
apiVersion: admission.k8s.io/v1beta1
`
	// AdmissionReviewMissingObjectAndOldObject makes sure we enforce having an object to review.
	AdmissionReviewMissingObjectAndOldObject = `
kind: AdmissionReview
apiVersion: admission.k8s.io/v1beta1
request:
  name:
`

	// AdmissionReviewWithOldObject proves that our code handles submitting a request with an oldObject for review.
	AdmissionReviewWithOldObject = `` /* 128-byte string literal not displayed */

	// DeleteAdmissionReviewWithNoOldObject enforces the AdmissionRequest behavior for k8s v1.15.0+ for DELETE operations.
	DeleteAdmissionReviewWithNoOldObject = `` /* 146-byte string literal not displayed */

	DeleteAdmissionReviewWithOldObjectMissingKind = `` /* 190-byte string literal not displayed */

	// SystemAdmissionReview holds a request coming from a system user name.
	SystemAdmissionReview = `` /* 163-byte string literal not displayed */

	SystemAdmissionReviewMissingKind = `` /* 150-byte string literal not displayed */

	// NonSystemAdmissionReview holds a request coming from a non system user name.
	NonSystemAdmissionReview = `` /* 152-byte string literal not displayed */

	// InvalidAdmissionReview cannot be converted into a typed AdmissionReview.
	InvalidAdmissionReview = `
kind: AdmissionReview
apiVersion: admission.k8s.io/v1
request:
key_that_does_not_exist_in_spec: "some_value"
`

	ConstraintAlwaysValidateUserInfo = `
kind: ValidateUserInfo
apiVersion: constraints.gatekeeper.sh/v1beta1
metadata:
  name: always-pass
`

	ConstraintAlwaysValidateUserInfoWithMatch = `` /* 172-byte string literal not displayed */

)

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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