Documentation ¶
Index ¶
- Constants
- Variables
- func GetScheme() *runtime.Scheme
- type FileCrawler
- func (fc FileCrawler) ReadConstraint(name string) (*unstructured.Unstructured, error)
- func (fc FileCrawler) ReadConstraintTemplate(name string) (*templates.ConstraintTemplate, error)
- func (fc FileCrawler) ReadConstraintTemplates() ([]*templates.ConstraintTemplate, error)
- func (fc FileCrawler) ReadConstraints() ([]*unstructured.Unstructured, error)
- func (fc FileCrawler) ReadManifests(manifestBytes []byte) ([]*unstructured.Unstructured, error)
- type ManifestFile
- type ManifestResult
- type Safeguard
- type TestManifest
Constants ¶
View Source
const ( Constraint_CAI = "container-allowed-images" Constraint_CEP = "container-enforce-probes" Constraint_CRL = "container-resource-limits" Constraint_CRIP = "container-restricted-image-pulls" Constraint_DBPDB = "disallowed-bad-pod-disruption-budgets" Constraint_PEA = "pod-enforce-antiaffinity" Constraint_RT = "restricted-taints" Constraint_USS = "unique-service-selectors" Constraint_all = "all" KustomizationPath = "../tests/kustomize/overlays/production" DirectPath_ToValidChart = "../tests/testmanifests/validchart/Chart.yaml" ChartPath = "../tests/testmanifests/validchart" InvalidChartPath = "../tests/testmanifests/invalidchart" InvalidValuesChart = "../tests/testmanifests/invalidvalues" InvalidDeploymentSyntax = "../tests/testmanifests/invaliddeployment-syntax" InvalidDeploymentValues = "../tests/testmanifests/invaliddeployment-values" FolderwithHelpersTmpl = "../tests/testmanifests/different-structure" MultipleTemplateDirs = "../tests/testmanifests/multiple-templates" MultipleValuesFile = "../tests/testmanifests/multiple-values-files" Subcharts = "../tests/testmanifests/multiple-charts" SubchartDir = "../tests/testmanifests/multiple-charts/charts/subchart2" DirectPath_ToSubchartYaml = "../tests/testmanifests/multiple-charts/charts/subchart1/Chart.yaml" DirectPath_ToMainChartYaml = "../tests/testmanifests/multiple-charts/Chart.yaml" DirectPath_ToInvalidChart = "../tests/testmanifests/invalidchart/Chart.yaml" TemplateFileName = "template.yaml" ConstraintFileName = "constraint.yaml" )
Variables ¶
View Source
var Safeguard_CRIP = Safeguard{ Name: Constraint_CRIP, TemplatePath: fmt.Sprintf("lib/%s/%s/%s", SelectedVersion, Constraint_CRIP, TemplateFileName), ConstraintPath: fmt.Sprintf("lib/%s/%s/%s", SelectedVersion, Constraint_CRIP, ConstraintFileName), }
View Source
var Safeguards = []Safeguard{ { Name: Constraint_CAI, TemplatePath: fmt.Sprintf("lib/%s/%s/%s", SelectedVersion, Constraint_CAI, TemplateFileName), ConstraintPath: fmt.Sprintf("lib/%s/%s/%s", SelectedVersion, Constraint_CAI, ConstraintFileName), }, { Name: Constraint_CEP, TemplatePath: fmt.Sprintf("lib/%s/%s/%s", SelectedVersion, Constraint_CEP, TemplateFileName), ConstraintPath: fmt.Sprintf("lib/%s/%s/%s", SelectedVersion, Constraint_CEP, ConstraintFileName), }, { Name: Constraint_CRL, TemplatePath: fmt.Sprintf("lib/%s/%s/%s", SelectedVersion, Constraint_CRL, TemplateFileName), ConstraintPath: fmt.Sprintf("lib/%s/%s/%s", SelectedVersion, Constraint_CRL, ConstraintFileName), }, { Name: Constraint_DBPDB, TemplatePath: fmt.Sprintf("lib/%s/%s/%s", SelectedVersion, Constraint_DBPDB, TemplateFileName), ConstraintPath: fmt.Sprintf("lib/%s/%s/%s", SelectedVersion, Constraint_DBPDB, ConstraintFileName), }, { Name: Constraint_PEA, TemplatePath: fmt.Sprintf("lib/%s/%s/%s", SelectedVersion, Constraint_PEA, TemplateFileName), ConstraintPath: fmt.Sprintf("lib/%s/%s/%s", SelectedVersion, Constraint_PEA, ConstraintFileName), }, { Name: Constraint_RT, TemplatePath: fmt.Sprintf("lib/%s/%s/%s", SelectedVersion, Constraint_RT, TemplateFileName), ConstraintPath: fmt.Sprintf("lib/%s/%s/%s", SelectedVersion, Constraint_RT, ConstraintFileName), }, { Name: Constraint_USS, TemplatePath: fmt.Sprintf("lib/%s/%s/%s", SelectedVersion, Constraint_USS, TemplateFileName), ConstraintPath: fmt.Sprintf("lib/%s/%s/%s", SelectedVersion, Constraint_USS, ConstraintFileName), }, }
View Source
var SafeguardsTesting = append(Safeguards, Safeguard_CRIP)
View Source
var SelectedVersion = "v1.0.0"
View Source
var SupportedVersions = []string{SelectedVersion}
View Source
var TestError_CAI_Standard = fmt.Sprintf("%s/%s/%s", testManifestDirectory, Constraint_CAI, "CAI-error-manifest.yaml")
View Source
var TestManifest_CAI = TestManifest{ Name: Constraint_CAI, SuccessPaths: []string{TestSuccess_CAI_Standard}, ErrorPaths: []string{TestError_CAI_Standard}, }
View Source
var TestManifest_CEP = TestManifest{ Name: Constraint_CEP, SuccessPaths: []string{testSuccess_CEP_Standard}, ErrorPaths: []string{testError_CEP_Standard}, }
View Source
var TestManifest_CL = TestManifest{ Name: Constraint_CRL, SuccessPaths: []string{testSuccess_CRL_Standard}, ErrorPaths: []string{testError_CRL_Standard}, }
View Source
var TestManifest_CRIP = TestManifest{ Name: Constraint_CRIP, SuccessPaths: []string{testSuccess_CRIP_Standard}, ErrorPaths: []string{testError_CRIP_Standard}, }
View Source
var TestManifest_DBPDB = TestManifest{ Name: Constraint_DBPDB, SuccessPaths: []string{testSuccess_DBPDB_Standard}, ErrorPaths: []string{testError_DBPDB_Standard}, }
View Source
var TestManifest_PEA = TestManifest{ Name: Constraint_PEA, SuccessPaths: []string{testSuccess_PEA_Standard}, ErrorPaths: []string{testError_PEA_Standard}, }
View Source
var TestManifest_RT = TestManifest{ Name: Constraint_RT, SuccessPaths: []string{testSuccess_RT_Standard}, ErrorPaths: []string{testError_RT_Standard}, }
View Source
var TestManifest_USS = TestManifest{ Name: Constraint_USS, SuccessPaths: []string{testSuccess_USS_Standard}, ErrorPaths: []string{testError_USS_Standard}, }
View Source
var TestManifest_all = TestManifest{ Name: "all", SuccessPaths: []string{testSuccess_all_Standard_1, testSuccess_all_Standard_2}, ErrorPaths: []string{testError_all_Standard_1, testError_all_Standard_2}, }
View Source
var TestSuccess_CAI_Standard = fmt.Sprintf("%s/%s/%s", testManifestDirectory, Constraint_CAI, "CAI-success-manifest.yaml")
Functions ¶
Types ¶
type FileCrawler ¶
func (FileCrawler) ReadConstraint ¶
func (fc FileCrawler) ReadConstraint(name string) (*unstructured.Unstructured, error)
func (FileCrawler) ReadConstraintTemplate ¶
func (fc FileCrawler) ReadConstraintTemplate(name string) (*templates.ConstraintTemplate, error)
func (FileCrawler) ReadConstraintTemplates ¶
func (fc FileCrawler) ReadConstraintTemplates() ([]*templates.ConstraintTemplate, error)
func (FileCrawler) ReadConstraints ¶
func (fc FileCrawler) ReadConstraints() ([]*unstructured.Unstructured, error)
func (FileCrawler) ReadManifests ¶
func (fc FileCrawler) ReadManifests(manifestBytes []byte) ([]*unstructured.Unstructured, error)
methods for retrieval of manifest, constraint templates, and constraints
type ManifestFile ¶
type ManifestResult ¶
type TestManifest ¶
Click to show internal directories.
Click to hide internal directories.