scplugins

package
v0.10.1-0...-fa89fd1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2019 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NamespaceOpt          = "namespace"
	KubeconfigOpt         = "kubeconfig"
	InitTimeoutOpt        = "init-timeout"
	OlmDeployedOpt        = "olm-deployed"
	CSVPathOpt            = "csv-path"
	NamespacedManifestOpt = "namespaced-manifest"
	GlobalManifestOpt     = "global-manifest"
	CRManifestOpt         = "cr-manifest"
	ProxyImageOpt         = "proxy-image"
	ProxyPullPolicyOpt    = "proxy-pull-policy"
	CRDsDirOpt            = "crds-dir"
	DeployDirOpt          = "deploy-dir"
	BasicTestsOpt         = "basic-tests"
	OLMTestsOpt           = "olm-tests"
)

Variables

This section is empty.

Functions

func NewBasicTestSuite

func NewBasicTestSuite(conf BasicTestConfig) *schelpers.TestSuite

NewBasicTestSuite returns a new schelpers.TestSuite object containing basic, functional operator tests

func NewOLMTestSuite

func NewOLMTestSuite(conf OLMTestConfig) *schelpers.TestSuite

NewOLMTestSuite returns a new schelpers.TestSuite object containing CSV best practice checks

func RunInternalPlugin

func RunInternalPlugin(pluginType PluginType, config BasicAndOLMPluginConfig, logFile io.ReadWriter) (scapiv1alpha1.ScorecardOutput, error)

Types

type AnnotationsContainExamplesTest

type AnnotationsContainExamplesTest struct {
	schelpers.TestInfo
	OLMTestConfig
}

AnnotationsContainExamplesTest is a scorecard test that verifies that the CSV contains examples via the alm-examples annotation

func NewAnnotationsContainExamplesTest

func NewAnnotationsContainExamplesTest(conf OLMTestConfig) *AnnotationsContainExamplesTest

NewAnnotationsContainExamplesTest returns a new AnnotationsContainExamplesTest object

func (*AnnotationsContainExamplesTest) Run

Run - implements Test interface

type BasicAndOLMPluginConfig

type BasicAndOLMPluginConfig struct {
	Namespace          string        `mapstructure:"namespace"`
	Kubeconfig         string        `mapstructure:"kubeconfig"`
	InitTimeout        int           `mapstructure:"init-timeout"`
	OLMDeployed        bool          `mapstructure:"olm-deployed"`
	NamespacedManifest string        `mapstructure:"namespaced-manifest"`
	GlobalManifest     string        `mapstructure:"global-manifest"`
	CRManifest         []string      `mapstructure:"cr-manifest"`
	CSVManifest        string        `mapstructure:"csv-path"`
	ProxyImage         string        `mapstructure:"proxy-image"`
	ProxyPullPolicy    v1.PullPolicy `mapstructure:"proxy-pull-policy"`
	CRDsDir            string        `mapstructure:"crds-dir"`
	DeployDir          string        `mapstructure:"deploy-dir"`
}

type BasicTestConfig

type BasicTestConfig struct {
	Client   client.Client
	CR       *unstructured.Unstructured
	ProxyPod *v1.Pod
}

BasicTestConfig contains all variables required by the BasicTest schelpers.TestSuite

type CRDsHaveResourcesTest

type CRDsHaveResourcesTest struct {
	schelpers.TestInfo
	OLMTestConfig
}

CRDsHaveResourcesTest is a scorecard test that verifies that the CSV lists used resources in its owned CRDs secyion

func NewCRDsHaveResourcesTest

func NewCRDsHaveResourcesTest(conf OLMTestConfig) *CRDsHaveResourcesTest

NewCRDsHaveResourcesTest returns a new CRDsHaveResourcesTest object

func (*CRDsHaveResourcesTest) Run

Run - implements Test interface

type CRDsHaveValidationTest

type CRDsHaveValidationTest struct {
	schelpers.TestInfo
	OLMTestConfig
}

CRDsHaveValidationTest is a scorecard test that verifies that all CRDs have a validation section

func NewCRDsHaveValidationTest

func NewCRDsHaveValidationTest(conf OLMTestConfig) *CRDsHaveValidationTest

NewCRDsHaveValidationTest returns a new CRDsHaveValidationTest object

func (*CRDsHaveValidationTest) Run

Run - implements Test interface

type CheckSpecTest

type CheckSpecTest struct {
	schelpers.TestInfo
	BasicTestConfig
}

CheckSpecTest is a scorecard test that verifies that the CR has a spec block

func NewCheckSpecTest

func NewCheckSpecTest(conf BasicTestConfig) *CheckSpecTest

NewCheckSpecTest returns a new CheckSpecTest object

func (*CheckSpecTest) Run

Run - implements Test interface

type CheckStatusTest

type CheckStatusTest struct {
	schelpers.TestInfo
	BasicTestConfig
}

CheckStatusTest is a scorecard test that verifies that the CR has a status block

func NewCheckStatusTest

func NewCheckStatusTest(conf BasicTestConfig) *CheckStatusTest

NewCheckStatusTest returns a new CheckStatusTest object

func (*CheckStatusTest) Run

Run - implements Test interface

type OLMTestConfig

type OLMTestConfig struct {
	Client   client.Client
	CR       *unstructured.Unstructured
	CSV      *olmapiv1alpha1.ClusterServiceVersion
	CRDsDir  string
	ProxyPod *v1.Pod
}

OLMTestConfig contains all variables required by the OLMTest schelpers.TestSuite

type PluginType

type PluginType int
const (
	BasicOperator  PluginType = 0
	OLMIntegration PluginType = 1
)

type SpecDescriptorsTest

type SpecDescriptorsTest struct {
	schelpers.TestInfo
	OLMTestConfig
}

SpecDescriptorsTest is a scorecard test that verifies that all spec fields have descriptors

func NewSpecDescriptorsTest

func NewSpecDescriptorsTest(conf OLMTestConfig) *SpecDescriptorsTest

NewSpecDescriptorsTest returns a new SpecDescriptorsTest object

func (*SpecDescriptorsTest) Run

Run - implements Test interface

type StatusDescriptorsTest

type StatusDescriptorsTest struct {
	schelpers.TestInfo
	OLMTestConfig
}

StatusDescriptorsTest is a scorecard test that verifies that all status fields have descriptors

func NewStatusDescriptorsTest

func NewStatusDescriptorsTest(conf OLMTestConfig) *StatusDescriptorsTest

NewStatusDescriptorsTest returns a new StatusDescriptorsTest object

func (*StatusDescriptorsTest) Run

Run - implements Test interface

type WritingIntoCRsHasEffectTest

type WritingIntoCRsHasEffectTest struct {
	schelpers.TestInfo
	BasicTestConfig
}

WritingIntoCRsHasEffectTest is a scorecard test that verifies that the operator is making PUT and/or POST requests to the API server

func NewWritingIntoCRsHasEffectTest

func NewWritingIntoCRsHasEffectTest(conf BasicTestConfig) *WritingIntoCRsHasEffectTest

NewWritingIntoCRsHasEffectTest returns a new WritingIntoCRsHasEffectTest object

func (*WritingIntoCRsHasEffectTest) Run

Run - implements Test interface

Jump to

Keyboard shortcuts

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