Documentation
¶
Index ¶
- Constants
- func ReplaceInFile(path, old, new string) error
- func ReplaceRegexInFile(path, match, replace string) error
- func UncommentCode(filename, target, prefix string) error
- type TestContext
- func (tc TestContext) AddPackagemanifestsTarget() error
- func (tc TestContext) AddScorecardCustomPatchFile() error
- func (tc TestContext) DisableOLMBundleInteractiveMode() error
- func (tc TestContext) InstallOLM() error
- func (tc TestContext) InstallOLMVersion(version string) error
- func (tc TestContext) KustomizeBuild(dir string) ([]byte, error)
- func (tc TestContext) LoadImageToKindClusterWithName(image string) error
- func (tc TestContext) ReplaceScorecardImagesForDev() error
- func (tc TestContext) UninstallOLM()
Constants ¶
const BinaryName = "operator-sdk"
const (
OlmVersionForTestSuite = "0.15.1"
)
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 ReplaceRegexInFile ¶
ReplaceRegexInFile finds all strings that match `match` and replaces them with `replace` in the file at path. todo(camilamacedo86): this func can be pushed to upstream/kb
func UncommentCode ¶
UncommentCode searches for target in the file and remove the comment prefix of the target content. The target content may span multiple lines. todo(camilamacedo86): this func exists in upstream/kb but there the error is not thrown. We need to push this change. See: https://github.com/kubernetes-sigs/kubebuilder/blob/master/test/e2e/utils/util.go
Types ¶
type TestContext ¶
type TestContext struct { *kbtestutils.TestContext BundleImageName string ProjectName string }
TestContext wraps kubebuilder's e2e TestContext.
func NewTestContext ¶
func NewTestContext(binary string, env ...string) (tc TestContext, err error)
NewTestContext returns a TestContext containing a new kubebuilder TestContext.
func (TestContext) AddPackagemanifestsTarget ¶
func (tc TestContext) AddPackagemanifestsTarget() 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) DisableOLMBundleInteractiveMode ¶
func (tc TestContext) DisableOLMBundleInteractiveMode() error
DisableOLMBundleInterativeMode will update the Makefile to disable the interactive mode
func (TestContext) InstallOLM ¶
func (tc TestContext) InstallOLM() error
InstallOLM runs 'operator-sdk olm install' and returns any errors emitted by that command.
func (TestContext) InstallOLMVersion ¶
func (tc TestContext) InstallOLMVersion(version string) error
InstallOLM runs 'operator-sdk olm install' for specific version and returns any errors emitted by that command.
func (TestContext) KustomizeBuild ¶
func (tc TestContext) KustomizeBuild(dir string) ([]byte, error)
KustomizeBuild runs 'kustomize build <dir>' and returns its output and an error if any.
func (TestContext) LoadImageToKindClusterWithName ¶
func (tc TestContext) LoadImageToKindClusterWithName(image string) error
LoadImageToKindCluster 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) UninstallOLM ¶
func (tc TestContext) UninstallOLM()
InstallOLM runs 'operator-sdk olm uninstall' and logs any errors emitted by that command.