MCPcopy
hub / github.com/operator-framework/operator-sdk / NewTestContext

Function NewTestContext

internal/testutils/utils.go:49–59  ·  view source on GitHub ↗

NewTestContext returns a TestContext containing a new kubebuilder TestContext. Construct if your environment is connected to a live cluster, ex. for e2e tests.

(binaryName string, env ...string)

Source from the content-addressed store, hash-verified

47// NewTestContext returns a TestContext containing a new kubebuilder TestContext.
48// Construct if your environment is connected to a live cluster, ex. for e2e tests.
49func NewTestContext(binaryName string, env ...string) (tc TestContext, err error) {
50 if tc.TestContext, err = kbtestutils.NewTestContext(binaryName, env...); err != nil {
51 return tc, err
52 }
53 tc.ProjectName = strings.ToLower(filepath.Base(tc.Dir))
54 tc.ImageName = makeImageName(tc.ProjectName)
55 tc.BundleImageName = makeBundleImageName(tc.ProjectName)
56 tc.isOLMManagedBySuite = true
57 tc.isPrometheusManagedBySuite = true
58 return tc, nil
59}
60
61// NewPartialTestContext returns a TestContext containing a partial kubebuilder TestContext.
62// This object needs to be populated with GVK information. The underlying TestContext is

Callers 3

suite_test.goFile · 0.92
suite_test.goFile · 0.92
suite_test.goFile · 0.92

Calls 2

makeImageNameFunction · 0.85
makeBundleImageNameFunction · 0.85

Tested by

no test coverage detected