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) AllowProjectBeMultiGroup() error
- func (tc TestContext) DisableOLMBundleInteractiveMode() error
- func (tc TestContext) InstallOLMVersion(version string) error
- func (tc TestContext) InstallPrerequisites()
- func (tc TestContext) IsRunningOnKind() bool
- func (tc TestContext) KustomizeBuild(dir string) ([]byte, error)
- func (tc TestContext) LoadImageToKindClusterWithName(image string) error
- func (tc TestContext) ReplaceScorecardImagesForDev() error
- func (tc TestContext) UninstallOLM()
- func (tc TestContext) UninstallPrerequisites()
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 store the image to use to build the bundle BundleImageName string // ProjectName store the project name ProjectName string // Kubectx stores the k8s context from where the tests are running Kubectx string // contains filtered or unexported fields }
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) AllowProjectBeMultiGroup ¶ added in v1.2.0
func (tc TestContext) AllowProjectBeMultiGroup() error
AllowProjectBeMultiGroup will update the PROJECT file with the information to allow we scaffold apis with different groups. todo(camilamacedo86) : remove this helper when the edit plugin via the bin be available. See the Pr: https://github.com/kubernetes-sigs/kubebuilder/pull/1691
func (TestContext) DisableOLMBundleInteractiveMode ¶
func (tc TestContext) DisableOLMBundleInteractiveMode() error
DisableOLMBundleInterativeMode will update the Makefile to disable the interactive mode
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) InstallPrerequisites ¶ added in v1.2.0
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 ¶ added in v1.2.0
func (tc TestContext) IsRunningOnKind() bool
IsRunningOnKind returns true when the tests are executed in a Kind Cluster
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
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) UninstallOLM ¶
func (tc TestContext) UninstallOLM()
InstallOLM runs 'operator-sdk olm uninstall' and logs any errors emitted by that command.
func (TestContext) UninstallPrerequisites ¶ added in v1.2.0
func (tc TestContext) UninstallPrerequisites()
UninstallPrerequisites will uninstall all prerequisites installed via InstallPrerequisites()