app

package
v1.8.9 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actions

type Actions struct {
	// contains filtered or unexported fields
}

this implements the "when" part of given/when/then

none of the func implement error checks, and that is complete intended, you should check for errors using the Then()

func (*Actions) AddAnnotatedTag added in v1.8.8

func (a *Actions) AddAnnotatedTag(name string, message string) *Actions

func (*Actions) AddFile added in v1.2.0

func (a *Actions) AddFile(fileName, fileContents string) *Actions

func (*Actions) AddSignedFile added in v1.8.8

func (a *Actions) AddSignedFile(fileName, fileContents string) *Actions

func (*Actions) AddSignedTag added in v1.8.8

func (a *Actions) AddSignedTag(name string) *Actions

func (*Actions) AddTag added in v1.8.8

func (a *Actions) AddTag(name string) *Actions

func (*Actions) AddTagWithForce added in v1.8.8

func (a *Actions) AddTagWithForce(name string) *Actions

func (*Actions) And

func (a *Actions) And(block func()) *Actions

func (*Actions) AppSet added in v1.2.0

func (a *Actions) AppSet(flags ...string) *Actions

func (*Actions) AppUnSet added in v1.5.3

func (a *Actions) AppUnSet(flags ...string) *Actions

func (*Actions) ConfirmDeletion added in v1.8.8

func (a *Actions) ConfirmDeletion() *Actions

func (*Actions) CreateApp added in v1.8.8

func (a *Actions) CreateApp(args ...string) *Actions

func (*Actions) CreateFromFile added in v1.2.0

func (a *Actions) CreateFromFile(handler func(app *v1alpha1.Application), flags ...string) *Actions

func (*Actions) CreateFromPartialFile added in v1.8.8

func (a *Actions) CreateFromPartialFile(data string, flags ...string) *Actions

func (*Actions) CreateMultiSourceApp added in v1.8.8

func (a *Actions) CreateMultiSourceApp(flags ...string) *Actions

func (*Actions) CreateMultiSourceAppFromFile added in v1.8.8

func (a *Actions) CreateMultiSourceAppFromFile(handler func(app *v1alpha1.Application), flags ...string) *Actions

func (*Actions) CreateWithNoNameSpace added in v1.8.8

func (a *Actions) CreateWithNoNameSpace(args ...string) *Actions

func (*Actions) Declarative

func (a *Actions) Declarative(filename string) *Actions

func (*Actions) DeclarativeWithCustomRepo added in v1.2.0

func (a *Actions) DeclarativeWithCustomRepo(filename string, repoURL string) *Actions

func (*Actions) Delete

func (a *Actions) Delete(cascade bool) *Actions

func (*Actions) DeleteBySelector added in v1.8.8

func (a *Actions) DeleteBySelector(selector string) *Actions

func (*Actions) DeleteBySelectorWithWait added in v1.8.8

func (a *Actions) DeleteBySelectorWithWait(selector string) *Actions

func (*Actions) DeleteFile

func (a *Actions) DeleteFile(file string) *Actions

func (*Actions) DoNotIgnoreErrors added in v1.3.0

func (a *Actions) DoNotIgnoreErrors() *Actions

func (*Actions) Get added in v1.8.8

func (a *Actions) Get() *Actions

func (*Actions) IgnoreErrors added in v1.2.0

func (a *Actions) IgnoreErrors() *Actions

func (*Actions) PatchApp

func (a *Actions) PatchApp(patch string) *Actions

func (*Actions) PatchAppHttp added in v1.8.8

func (a *Actions) PatchAppHttp(patch string) *Actions

func (*Actions) PatchFile

func (a *Actions) PatchFile(file string, jsonPatch string) *Actions

func (*Actions) Refresh

func (a *Actions) Refresh(refreshType v1alpha1.RefreshType) *Actions

func (*Actions) RemoveSubmodule added in v1.8.8

func (a *Actions) RemoveSubmodule() *Actions

func (*Actions) SetInstallationID added in v1.8.8

func (a *Actions) SetInstallationID(installationID string) *Actions

func (*Actions) SetParamInSettingConfigMap added in v1.8.8

func (a *Actions) SetParamInSettingConfigMap(key, value string) *Actions

func (*Actions) SetTrackingLabel added in v1.8.8

func (a *Actions) SetTrackingLabel(trackingLabel string) *Actions

func (*Actions) SetTrackingMethod added in v1.8.8

func (a *Actions) SetTrackingMethod(trackingMethod string) *Actions

func (*Actions) Sync

func (a *Actions) Sync(args ...string) *Actions

func (*Actions) TerminateOp

func (a *Actions) TerminateOp() *Actions

func (*Actions) Then

func (a *Actions) Then() *Consequences

func (*Actions) Wait added in v1.8.8

func (a *Actions) Wait(args ...string) *Actions

func (*Actions) WithImpersonationDisabled added in v1.8.8

func (a *Actions) WithImpersonationDisabled() *Actions

func (*Actions) WithImpersonationEnabled added in v1.8.8

func (a *Actions) WithImpersonationEnabled(serviceAccountName string, policyRules []rbacv1.PolicyRule) *Actions

func (*Actions) WithImpersonationEnforcementDisabled added in v1.8.8

func (a *Actions) WithImpersonationEnforcementDisabled() *Actions

func (*Actions) WriteFile added in v1.8.8

func (a *Actions) WriteFile(fileName, fileContents string) *Actions

type Consequences

type Consequences struct {
	// contains filtered or unexported fields
}

this implements the "then" part of given/when/then

func (*Consequences) And

func (c *Consequences) And(block func(app *v1alpha1.Application)) *Consequences

func (*Consequences) AndAction added in v1.8.8

func (c *Consequences) AndAction(block func()) *Consequences

func (*Consequences) AndCLIOutput added in v1.8.8

func (c *Consequences) AndCLIOutput(block func(output string, err error)) *Consequences

func (*Consequences) Expect

func (c *Consequences) Expect(e Expectation) *Consequences

func (*Consequences) ExpectConsistently added in v1.8.8

func (c *Consequences) ExpectConsistently(e Expectation, waitDuration time.Duration, expirationDuration time.Duration) *Consequences

ExpectConsistently will continuously evaluate a condition. Once true, it must be true each time it is evaluated, otherwise the test is failed. The condition will be repeatedly evaluated once it is true,until 'expirationDuration' is met, waiting 'waitDuration' after each success.

func (*Consequences) Given

func (c *Consequences) Given() *Context

func (*Consequences) When

func (c *Consequences) When() *Actions

type Context

type Context struct {
	*fixture.TestState
	// contains filtered or unexported fields
}

Context implements the "given" part of given/when/then. It embeds fixture.TestState to provide test-specific state that enables parallel test execution.

func Given

func Given(t *testing.T, opts ...fixture.TestOption) *Context

func GivenWithNamespace added in v1.8.8

func GivenWithNamespace(t *testing.T, namespace string) *Context

func GivenWithSameState added in v1.8.8

func GivenWithSameState(ctx fixture.TestContext) *Context

GivenWithSameState creates a new Context that shares the same TestState as an existing context. Use this when you need multiple fixture contexts within the same test.

func (*Context) And

func (c *Context) And(block func()) *Context

func (*Context) AppName added in v1.8.8

func (c *Context) AppName() string

AppName returns the unique application name for the test context. Unique application names protects from potential conflicts between test run caused by the tracking annotation on existing objects

func (*Context) AppNamespace added in v1.8.8

func (c *Context) AppNamespace() string

func (*Context) AppQualifiedName added in v1.8.8

func (c *Context) AppQualifiedName() string

func (*Context) ApplyOutOfSyncOnly added in v1.8.8

func (c *Context) ApplyOutOfSyncOnly() *Context

func (*Context) Async

func (c *Context) Async(async bool) *Context

func (*Context) AuthenticatedOCIRepoAdded added in v1.8.8

func (c *Context) AuthenticatedOCIRepoAdded(name, imagePath string) *Context

func (*Context) Chart added in v1.3.0

func (c *Context) Chart(chart string) *Context

func (*Context) CustomCACertAdded added in v1.2.0

func (c *Context) CustomCACertAdded() *Context

func (*Context) CustomSSHKnownHostsAdded added in v1.2.0

func (c *Context) CustomSSHKnownHostsAdded() *Context

func (*Context) DestName added in v1.8.8

func (c *Context) DestName(destName string) *Context

func (*Context) DestServer

func (c *Context) DestServer(destServer string) *Context

func (*Context) DrySourcePath added in v1.8.8

func (c *Context) DrySourcePath(path string) *Context

func (*Context) DrySourceRevision added in v1.8.8

func (c *Context) DrySourceRevision(revision string) *Context

func (*Context) Env

func (c *Context) Env(env string) *Context

func (*Context) Force added in v1.3.0

func (c *Context) Force() *Context

func (*Context) GPGPublicKeyAdded added in v1.8.8

func (c *Context) GPGPublicKeyAdded() *Context

func (*Context) GPGPublicKeyRemoved added in v1.8.8

func (c *Context) GPGPublicKeyRemoved() *Context

func (*Context) GetTrackingMethod added in v1.8.8

func (c *Context) GetTrackingMethod() v1alpha1.TrackingMethod

func (*Context) HTTPSCredentialsTLSClientCertAdded added in v1.4.0

func (c *Context) HTTPSCredentialsTLSClientCertAdded() *Context

func (*Context) HTTPSCredentialsUserPassAdded added in v1.4.0

func (c *Context) HTTPSCredentialsUserPassAdded() *Context

func (*Context) HTTPSInsecureRepoURLAdded added in v1.2.0

func (c *Context) HTTPSInsecureRepoURLAdded(withCreds bool, opts ...repos.AddRepoOpts) *Context

func (*Context) HTTPSInsecureRepoURLWithClientCertAdded added in v1.2.0

func (c *Context) HTTPSInsecureRepoURLWithClientCertAdded() *Context

func (*Context) HTTPSRepoURLAdded added in v1.2.0

func (c *Context) HTTPSRepoURLAdded(withCreds bool, opts ...repos.AddRepoOpts) *Context

func (*Context) HTTPSRepoURLWithClientCertAdded added in v1.2.0

func (c *Context) HTTPSRepoURLWithClientCertAdded() *Context

func (*Context) HelmHTTPSCredentialsUserPassAdded added in v1.8.8

func (c *Context) HelmHTTPSCredentialsUserPassAdded() *Context

func (*Context) HelmOCIRepoAdded added in v1.8.8

func (c *Context) HelmOCIRepoAdded(name string) *Context

func (*Context) HelmPassCredentials added in v1.8.8

func (c *Context) HelmPassCredentials() *Context

func (*Context) HelmRepoAdded added in v1.3.0

func (c *Context) HelmRepoAdded(name string) *Context

func (*Context) HelmSkipCrds added in v1.8.8

func (c *Context) HelmSkipCrds() *Context

func (*Context) HelmSkipSchemaValidation added in v1.8.8

func (c *Context) HelmSkipSchemaValidation() *Context

func (*Context) HelmSkipTests added in v1.8.8

func (c *Context) HelmSkipTests() *Context

func (*Context) HelmoOCICredentialsWithoutUserPassAdded added in v1.8.8

func (c *Context) HelmoOCICredentialsWithoutUserPassAdded() *Context

func (*Context) HydrateToBranch added in v1.8.8

func (c *Context) HydrateToBranch(branch string) *Context

func (*Context) LocalPath

func (c *Context) LocalPath(localPath string) *Context

func (*Context) Name added in v1.4.0

func (c *Context) Name(name string) *Context

func (*Context) NamePrefix

func (c *Context) NamePrefix(namePrefix string) *Context

func (*Context) NameSuffix added in v1.4.0

func (c *Context) NameSuffix(nameSuffix string) *Context

func (*Context) OCIRegistry added in v1.8.8

func (c *Context) OCIRegistry(registry string) *Context

func (*Context) OCIRegistryPath added in v1.8.8

func (c *Context) OCIRegistryPath(ociPath string) *Context

func (*Context) OCIRepoAdded added in v1.8.8

func (c *Context) OCIRepoAdded(name, imagePath string) *Context

func (*Context) Parameter

func (c *Context) Parameter(parameter string) *Context

func (*Context) Path

func (c *Context) Path(path string) *Context

func (*Context) Project

func (c *Context) Project(project string) *Context

func (*Context) ProjectSpec added in v1.3.0

func (c *Context) ProjectSpec(spec v1alpha1.AppProjectSpec) *Context

func (*Context) Prune

func (c *Context) Prune(prune bool) *Context

func (*Context) PushChartToAuthenticatedOCIRegistry added in v1.8.8

func (c *Context) PushChartToAuthenticatedOCIRegistry(chartPathName, chartName, chartVersion string) *Context

func (*Context) PushChartToOCIRegistry added in v1.8.8

func (c *Context) PushChartToOCIRegistry(chartPathName, chartName, chartVersion string) *Context

func (*Context) PushImageToAuthenticatedOCIRegistry added in v1.8.8

func (c *Context) PushImageToAuthenticatedOCIRegistry(pathName, tag string) *Context

func (*Context) PushImageToOCIRegistry added in v1.8.8

func (c *Context) PushImageToOCIRegistry(pathName, tag string) *Context

func (*Context) Recurse added in v1.4.0

func (c *Context) Recurse() *Context

func (*Context) RegisterKustomizeVersion added in v1.8.8

func (c *Context) RegisterKustomizeVersion(version, path string) *Context

func (*Context) Replace added in v1.8.8

func (c *Context) Replace() *Context

func (*Context) RepoURLType added in v1.2.0

func (c *Context) RepoURLType(urlType fixture.RepoURLType) *Context

func (*Context) Resource added in v1.8.8

func (c *Context) Resource(content string) *Context

func (*Context) ResourceFilter added in v1.2.0

func (c *Context) ResourceFilter(filter settings.ResourcesFilter) *Context

func (*Context) ResourceOverrides

func (c *Context) ResourceOverrides(overrides map[string]v1alpha1.ResourceOverride) *Context

func (*Context) Revision added in v1.3.0

func (c *Context) Revision(revision string) *Context

func (*Context) RunningCMPServer added in v1.8.8

func (c *Context) RunningCMPServer(configFile string) *Context

RunningCMPServer starts a CMP server with the given config directory and waits for it to be ready. It blocks until the CMP socket is created or times out after 10 seconds.

func (*Context) SSHCredentialsAdded added in v1.4.0

func (c *Context) SSHCredentialsAdded() *Context

func (*Context) SSHInsecureRepoURLAdded added in v1.2.0

func (c *Context) SSHInsecureRepoURLAdded(withCreds bool) *Context

func (*Context) SSHRepoURLAdded added in v1.2.0

func (c *Context) SSHRepoURLAdded(withCreds bool) *Context

func (*Context) SelectedResource

func (c *Context) SelectedResource(resource string) *Context

group:kind:name

func (*Context) SetAppNamespace added in v1.8.8

func (c *Context) SetAppNamespace(namespace string) *Context

func (*Context) SetInstallationID added in v1.8.8

func (c *Context) SetInstallationID(installationID string) *Context

func (*Context) SetTrackingMethod added in v1.8.8

func (c *Context) SetTrackingMethod(trackingMethod string) *Context

func (*Context) Sleep added in v1.8.8

func (c *Context) Sleep(seconds time.Duration) *Context

func (*Context) Sources added in v1.8.8

func (c *Context) Sources(sources []v1alpha1.ApplicationSource) *Context

func (*Context) SubmoduleHTTPSRepoURLAdded added in v1.4.0

func (c *Context) SubmoduleHTTPSRepoURLAdded(withCreds bool) *Context

func (*Context) SubmoduleSSHRepoURLAdded added in v1.4.0

func (c *Context) SubmoduleSSHRepoURLAdded(withCreds bool) *Context

func (*Context) SyncSourceBranch added in v1.8.8

func (c *Context) SyncSourceBranch(branch string) *Context

func (*Context) SyncSourcePath added in v1.8.8

func (c *Context) SyncSourcePath(path string) *Context

func (*Context) TagPrefix added in v1.8.8

func (c *Context) TagPrefix(tagPrefix string) *Context

func (*Context) Timeout added in v1.2.0

func (c *Context) Timeout(timeout int) *Context

func (*Context) When

func (c *Context) When() *Actions

func (*Context) WriteCredentials added in v1.8.8

func (c *Context) WriteCredentials(insecure bool) *Context

type ContextArgs added in v1.8.8

type ContextArgs struct {
	AppNamespace string
}

type Expectation

type Expectation func(c *Consequences) (state state, message string)

func App added in v1.8.8

func App(predicate func(app *v1alpha1.Application) bool) Expectation

func Condition

func Condition(conditionType v1alpha1.ApplicationConditionType, conditionMessage string) Expectation

func DoesNotExist

func DoesNotExist() Expectation

func DoesNotExistNow added in v1.8.8

func DoesNotExistNow() Expectation

func Error

func Error(message, err string, matchers ...func(string, string) bool) Expectation

Error asserts that the last command was an error with substring match

func ErrorRegex added in v1.8.8

func ErrorRegex(messagePattern, err string) Expectation

ErrorRegex asserts that the last command was an error that matches given regex epxression

func Event

func Event(reason string, message string) Expectation

func HealthIs

func HealthIs(expected health.HealthStatusCode) Expectation

func HydrationPhaseIs added in v1.8.8

func HydrationPhaseIs(expected v1alpha1.HydrateOperationPhase) Expectation

func Namespace added in v1.8.8

func Namespace(name string, block func(app *v1alpha1.Application, ns *corev1.Namespace)) Expectation

func NamespacedEvent added in v1.8.8

func NamespacedEvent(namespace string, reason string, message string) Expectation

func NoConditions added in v1.3.0

func NoConditions() Expectation

func NoNamespace added in v1.8.8

func NoNamespace(name string) Expectation

func NoStatus added in v1.8.8

func NoStatus() Expectation

func NotPod

func NotPod(predicate func(p corev1.Pod) bool) Expectation

func OperationMessageContains added in v1.8.8

func OperationMessageContains(text string) Expectation

func OperationPhaseIs

func OperationPhaseIs(expected common.OperationPhase) Expectation

func OperationRetriedMinimumTimes added in v1.8.8

func OperationRetriedMinimumTimes(minRetries int64) Expectation

func Or added in v1.8.8

func Pod

func Pod(predicate func(p corev1.Pod) bool) Expectation

func ResourceHealthIs

func ResourceHealthIs(kind, resource string, expected health.HealthStatusCode) Expectation

func ResourceHealthWithNamespaceIs added in v1.8.8

func ResourceHealthWithNamespaceIs(kind, resource, namespace string, expected health.HealthStatusCode) Expectation

func ResourceResultIs

func ResourceResultIs(result v1alpha1.ResourceResult) Expectation

func ResourceResultMatches added in v1.8.8

func ResourceResultMatches(result v1alpha1.ResourceResult) Expectation

func ResourceResultNumbering

func ResourceResultNumbering(num int) Expectation

func ResourceSyncStatusIs

func ResourceSyncStatusIs(kind, resource string, expected v1alpha1.SyncStatusCode) Expectation

func ResourceSyncStatusWithNamespaceIs added in v1.8.8

func ResourceSyncStatusWithNamespaceIs(kind, resource, namespace string, expected v1alpha1.SyncStatusCode) Expectation

func Status added in v1.8.8

func StatusExists added in v1.8.8

func StatusExists() Expectation

func Success

func Success(message string, matchers ...func(string, string) bool) Expectation

Success asserts that the last command was successful and that the output contains the given message.

func SuccessRegex added in v1.8.8

func SuccessRegex(messagePattern string) Expectation

SuccessRegex asserts that the last command was successful and output matches given regex expression

func SyncStatusIs

func SyncStatusIs(expected v1alpha1.SyncStatusCode) Expectation

Jump to

Keyboard shortcuts

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