Documentation ¶
Index ¶
- Constants
- func ReplaceInFile(path, old, new string) error
- func WrapWarn(err error)
- func WrapWarnOutput(_ string, err error)
- type TestContext
- func (tc TestContext) AddPackagemanifestsTarget(operatorType projutil.OperatorType) error
- func (tc TestContext) AddScorecardCustomPatchFile() error
- func (tc TestContext) DisableManifestsInteractiveMode() error
- func (tc TestContext) GenerateBundle() error
- func (tc TestContext) InstallOLMVersion(version string) error
- func (tc TestContext) InstallPrerequisites()
- func (tc TestContext) IsRunningOnKind() (bool, error)
- func (tc TestContext) LoadImageToKindClusterWithName(image string) error
- func (tc TestContext) ReplaceScorecardImagesForDev() error
- func (tc TestContext) UncommentRestrictivePodStandards() error
- func (tc TestContext) UninstallOLM()
- func (tc TestContext) UninstallPrerequisites()
Constants ¶
const BinaryName = "bin/operator-sdk"
const (
OlmVersionForTestSuite = "0.25.0"
)
Variables ¶
This section is empty.
Functions ¶
func ReplaceInFile ¶
ReplaceInFile replaces all instances of old with new in the file at path. todo(camilamacedo86): this func can be pushed to upstream/kb
func WrapWarn ¶
func WrapWarn(err error)
WrapWarn is a one-liner to wrap an error from a command that returns (error) in a warning.
func WrapWarnOutput ¶
WrapWarnOutput is a one-liner to wrap an error from a command that returns (string, error) in a warning.
Types ¶
type TestContext ¶
type TestContext struct { *kbtestutils.TestContext // BundleImageName store the image to use to build the bundle BundleImageName string // ProjectName store the project name ProjectName string // contains filtered or unexported fields }
TestContext wraps kubebuilder's e2e TestContext.
func NewPartialTestContext ¶
func NewPartialTestContext(binaryName, dir string, env ...string) (tc TestContext, err error)
NewPartialTestContext returns a TestContext containing a partial kubebuilder TestContext. This object needs to be populated with GVK information. The underlying TestContext is created directly rather than through a constructor so cluster-based setup is skipped.
func NewTestContext ¶
func NewTestContext(binaryName string, env ...string) (tc TestContext, err error)
NewTestContext returns a TestContext containing a new kubebuilder TestContext. Construct if your environment is connected to a live cluster, ex. for e2e tests.
func (TestContext) AddPackagemanifestsTarget ¶
func (tc TestContext) AddPackagemanifestsTarget(operatorType projutil.OperatorType) error
AddPackagemanifestsTarget will append the packagemanifests target to the makefile in order to test the steps described in the docs. More info: https://v1-0-x.sdk.operatorframework.io/docs/olm-integration/generation/#package-manifests-formats
func (TestContext) AddScorecardCustomPatchFile ¶
func (tc TestContext) AddScorecardCustomPatchFile() error
func (TestContext) DisableManifestsInteractiveMode ¶
func (tc TestContext) DisableManifestsInteractiveMode() error
DisableManifestsInteractiveMode will update the Makefile to disable the interactive mode
func (TestContext) GenerateBundle ¶
func (tc TestContext) GenerateBundle() error
GenerateBundle runs all commands to create an operator bundle.
func (TestContext) InstallOLMVersion ¶
func (tc TestContext) InstallOLMVersion(version string) error
InstallOLMVersion runs 'operator-sdk olm install' for specific version and returns any errors emitted by that command.
func (TestContext) InstallPrerequisites ¶
func (tc TestContext) InstallPrerequisites()
InstallPrerequisites will install OLM and Prometheus when the cluster kind is Kind and when they are not present on the Cluster
func (TestContext) IsRunningOnKind ¶
func (tc TestContext) IsRunningOnKind() (bool, error)
IsRunningOnKind returns true when the tests are executed in a Kind Cluster
func (TestContext) LoadImageToKindClusterWithName ¶
func (tc TestContext) LoadImageToKindClusterWithName(image string) error
LoadImageToKindClusterWithName loads a local docker image with the name informed to the kind cluster
func (TestContext) ReplaceScorecardImagesForDev ¶
func (tc TestContext) ReplaceScorecardImagesForDev() error
ReplaceScorecardImagesForDev will replaces the scorecard images in the manifests per dev tag which is built in the CI based on the code changes made.
func (TestContext) UncommentRestrictivePodStandards ¶
func (tc TestContext) UncommentRestrictivePodStandards() error
func (TestContext) UninstallOLM ¶
func (tc TestContext) UninstallOLM()
UninstallOLM runs 'operator-sdk olm uninstall' and logs any errors emitted by that command.
func (TestContext) UninstallPrerequisites ¶
func (tc TestContext) UninstallPrerequisites()
UninstallPrerequisites will uninstall all prerequisites installed via InstallPrerequisites()