shared

package
v0.0.6-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InitImage   = "busybox:1.36"
	InitCommand = "echo init-done"
)

InitContainer fixture values

View Source
const (
	MultiResourceBackendName  = "backend"
	MultiResourceFrontendName = "frontend"
	MultiResourceBackendPort  = 8080
	MultiResourceFrontendPort = 80
)

Multi-resource stack fixture values

View Source
const (
	EnvPortsResourceName = "app"
	EnvPortsAppEnvKey    = "APP_ENV"
	EnvPortsAppEnvVal    = "test"
	EnvPortsAppPortKey   = "APP_PORT"
	EnvPortsAppPortVal   = "8080"
	EnvPortsLogLevelKey  = "LOG_LEVEL"
	EnvPortsLogLevelVal  = "debug"
	EnvPortsPort1        = 8080
	EnvPortsPort2        = 9090
)

Env and ports stack fixture values

View Source
const (
	FullStackAPIName    = "api"
	FullStackWorkerName = "worker"
	FullStackAPIPort    = 8080
	FullStackVolumeName = "uploads"
	FullStackMountPath  = "/data/uploads"
	FullStackSubPath    = "api"
	FullStackSecretName = "tls-certs"
)

Full-stack e2e fixture values (2 resources, postgres, secret, volume, depends_on)

View Source
const (
	CrashResourceName = "crash-app"
	CrashImage        = "busybox:1.36"
	CrashMessage      = "application crashed with fatal error"
)

Crash detection fixture values

View Source
const (
	BuildSourceRepoURL      = "https://github.com/ashishmax31/test-private-repo.git"
	BuildSourceBranch       = "main"
	BuildSourceDockerfile   = "Dockerfile"
	BuildSourceContextPath  = "."
	BuildSourcePort         = 3000
	BuildSourceResourceName = "todo-app"
	BuildSourceSecretName   = "test-git-creds"

	// BuildSourceGitHost is the git host the build-source fixtures clone from;
	// an org git integration for this host provides private-clone auth.
	BuildSourceGitHost = "github.com"
	// BuildSourceGitUsername is the basic-auth username paired with a GitHub PAT.
	BuildSourceGitUsername = "git"

	// BrokenBuildResourceName is the resource name for the broken-build fixture.
	// It points to a branch that contains a Dockerfile with an invalid command so the build fails.
	BrokenBuildResourceName     = "broken-app"
	BrokenBuildSourceBranch     = "bad-build"
	BrokenBuildSourceDockerfile = "Dockerfile-nonexistent"
)

Build from source fixture values

View Source
const (
	MinIONamespace   = testutil.MinIONamespace
	MinIOName        = testutil.MinIOName
	MinIOServicePort = testutil.MinIOServicePort
	MinIOAccessKey   = testutil.MinIOAccessKey
	MinIOSecretKey   = testutil.MinIOSecretKey
)

Re-export MinIO constants from testutil for use in test specs and fixtures.

View Source
const SimulateReleaseStateAnnotationKey = models.SimulateReleaseStateAnnotation
View Source
const SkipProvisioningAnnotationKey = "stack.stackdome.io/skip-cluster-provisioning"

SkipProvisioningAnnotation is the annotation value that causes the stack worker to skip cluster provisioning and mark the stack as Ready immediately.

View Source
const TestImage = "nginx:1.25-alpine"

Shared test image used across all stack fixtures

Variables

View Source
var FullStackSecretEnvMapping = map[string]string{
	"tls_cert": "TLS_CERT",
	"tls_key":  "TLS_KEY",
}

FullStackSecretEnvMapping maps secret output keys to env var names.

View Source
var PostgresEnvMapping = map[string]string{
	"host":     "PG_HOST",
	"port":     "PG_PORT",
	"username": "PG_USER",
	"password": "PG_PASSWORD",
	"database": "PG_DATABASE",
	"url":      "DATABASE_URL",
}

PostgresEnvMapping maps output accessor names to env var names for postgres connections.

Functions

func ApplyStackExpectError

func ApplyStackExpectError(client *openapi.APIClient, orgID, projectName, stackID string, stack *openapi.Stack, expectedStatus int) *openapi.GenericOpenAPIError

func AuthenticatedClient

func AuthenticatedClient(token string) *openapi.APIClient

func CRNameForAddon

func CRNameForAddon(addonName string) string

CRNameForAddon returns the expected PostgresCluster CR name for a given addon. The CR name matches the addon name directly (set in postgres_cluster_builder.go).

func CancelRelease

func CancelRelease(client *openapi.APIClient, orgID, projectName, stackID, releaseID string)

func CnpgClusterName

func CnpgClusterName(addonName string, majorVersion int) string

CnpgClusterName returns the CNPG Cluster CR name derived from addon name and PG major version.

func ConnectToPostgres

func ConnectToPostgres(host string, port int32, username, password, dbName, sslMode string) *sql.DB

ConnectToPostgres opens a real PostgreSQL connection and runs SELECT 1 to verify connectivity.

func CreateAzureCredentialsSecret

func CreateAzureCredentialsSecret(name string) *openapi.Secret

CreateAzureCredentialsSecret creates a secret with Azure connection string

func CreateCrashingStack

func CreateCrashingStack(name string) *openapi.Stack

CreateCrashingStack creates a stack whose sole resource immediately exits with a non-zero code, triggering CrashLoopBackOff so the cluster-agent populates LastFailureDetails.

func CreateFullStack

func CreateFullStack(name string, addonID string, database string, secretID string) *openapi.Stack

CreateFullStack creates a stack with 2 resources (api + worker), a volume mount, postgres addon connection, secret connection, resource-to-resource connection, and depends_on. This exercises all connection kinds and topology features.

func CreateGCSCredentialsSecret

func CreateGCSCredentialsSecret(name string) *openapi.Secret

CreateGCSCredentialsSecret creates a secret with GCS service account credentials

func CreateGenericSecret

func CreateGenericSecret(name string, data map[string]string) *openapi.Secret

CreateGenericSecret creates a generic secret with key-value pairs

func CreateGitCredentialsIntegration

func CreateGitCredentialsIntegration(client *openapi.APIClient, orgID, host, username, password string) *openapi.GitIntegration

CreateGitCredentialsIntegration registers an org-level git_credentials integration (basic username/password). The credential resolver auto-attaches it to clones whose host matches, so private-repo builds authenticate without any per-source credential input.

func CreateGitCredentialsSecret

func CreateGitCredentialsSecret(name string, token string) *openapi.Secret

CreateGitCredentialsSecret creates a GitCredentials secret with a GitHub PAT token

func CreateInviteExpectError

func CreateInviteExpectError(client *openapi.APIClient, orgID string, req openapi.OrgInviteCreateRequest, expectedStatus int)

func CreateMinimalPostgresAddon

func CreateMinimalPostgresAddon(name string) *openapi.PostgresAddon

PostgreSQL addon factory functions using OpenAPI models

func CreateMultiResourceStack

func CreateMultiResourceStack(name string) *openapi.Stack

func CreateObjectStore

func CreateObjectStore(client *openapi.APIClient, orgID, projectName string, store *openapi.ObjectStore) *openapi.ObjectStore

func CreateObjectStoreExpectError

func CreateObjectStoreExpectError(client *openapi.APIClient, orgID, projectName string, store *openapi.ObjectStore, expectedStatus int) *openapi.GenericOpenAPIError

func CreateObjectStoreWithAzure

func CreateObjectStoreWithAzure(name string, secretID string) *openapi.ObjectStore

CreateObjectStoreWithAzure creates an ObjectStore with Azure credentials

func CreateObjectStoreWithGCS

func CreateObjectStoreWithGCS(name string, secretID string) *openapi.ObjectStore

CreateObjectStoreWithGCS creates an ObjectStore with GCS credentials

func CreateObjectStoreWithRetention

func CreateObjectStoreWithRetention(name string, secretID string, retention string) *openapi.ObjectStore

CreateObjectStoreWithRetention creates an ObjectStore with custom retention policy

func CreateObjectStoreWithS3

func CreateObjectStoreWithS3(name string, secretID string) *openapi.ObjectStore

CreateObjectStoreWithS3 creates an ObjectStore with S3 credentials

func CreateObjectStoreWithS3Endpoint

func CreateObjectStoreWithS3Endpoint(name string, secretID string, endpoint string) *openapi.ObjectStore

CreateObjectStoreWithS3Endpoint creates an ObjectStore with S3-compatible endpoint

func CreatePostgresAddon

func CreatePostgresAddon(client *openapi.APIClient, orgID, projectName string, addon *openapi.PostgresAddon) *openapi.PostgresAddon

PostgreSQL addon CRUD operations for Ginkgo tests

func CreatePostgresAddonExpectError

func CreatePostgresAddonExpectError(client *openapi.APIClient, orgID, projectName string, addon *openapi.PostgresAddon, expectedStatus int) *openapi.GenericOpenAPIError

Error testing helpers for Ginkgo

func CreatePostgresAddonForUpdate

func CreatePostgresAddonForUpdate(name string) *openapi.PostgresAddon

func CreatePostgresAddonWithBackup

func CreatePostgresAddonWithBackup(name string) *openapi.PostgresAddon

func CreatePostgresAddonWithHA

func CreatePostgresAddonWithHA(name string) *openapi.PostgresAddon

func CreatePostgresAddonWithResources

func CreatePostgresAddonWithResources(name string) *openapi.PostgresAddon

func CreatePostgresAddonWithSuperuser

func CreatePostgresAddonWithSuperuser(name string) *openapi.PostgresAddon

func CreateProject

func CreateProject(client *openapi.APIClient, orgID, projectName string) *openapi.Project

func CreateRelease

func CreateRelease(client *openapi.APIClient, orgID, projectName, stackID string) *openapi.StackRelease

func CreateReleaseExpectError

func CreateReleaseExpectError(client *openapi.APIClient, orgID, projectName, stackID string, expectedStatus int) *openapi.GenericOpenAPIError

CreateReleaseExpectError creates a release expecting the request to be rejected (e.g. sync validation failures surfaced as 400 from resolvePins).

func CreateS3CredentialsSecret

func CreateS3CredentialsSecret(name string) *openapi.Secret

CreateS3CredentialsSecret creates a secret with MinIO S3 access credentials

func CreateSecret

func CreateSecret(client *openapi.APIClient, orgID, projectName string, secret *openapi.Secret) *openapi.Secret

func CreateShellStack

func CreateShellStack(client *openapi.APIClient, orgID, projectName string, stack *openapi.Stack) *openapi.Stack

func CreateSimpleStack

func CreateSimpleStack(name string) *openapi.Stack

func CreateSimulatedReleaseStack

func CreateSimulatedReleaseStack(name string, resources []openapi.StackResource, state string) *openapi.Stack

func CreateSimulatedReleaseStackWithConnections

func CreateSimulatedReleaseStackWithConnections(name string, resources []openapi.StackResource, connections []openapi.StackConnection, state string) *openapi.Stack

func CreateSkipProvisioningStack

func CreateSkipProvisioningStack(name string, resources []openapi.StackResource) *openapi.Stack

func CreateSkipProvisioningStackFull

func CreateSkipProvisioningStackFull(name string, resources []openapi.StackResource, volumes []openapi.Volume, connections []openapi.StackConnection) *openapi.Stack

func CreateSkipProvisioningStackWithConnections

func CreateSkipProvisioningStackWithConnections(name string, resources []openapi.StackResource, connections []openapi.StackConnection) *openapi.Stack

func CreateSkipProvisioningStackWithVolumes

func CreateSkipProvisioningStackWithVolumes(name string, resources []openapi.StackResource, volumes []openapi.Volume) *openapi.Stack

func CreateStack

func CreateStack(client *openapi.APIClient, orgID, projectName string, stack *openapi.Stack) *openapi.Stack

func CreateStackAndDeploy

func CreateStackAndDeploy(client *openapi.APIClient, orgID, projectName string, stack *openapi.Stack) (*openapi.Stack, *openapi.StackRelease)

CreateStackAndDeploy creates a stack and immediately creates a release to deploy it. Use this instead of CreateStack when the test expects the stack to reach Ready state.

func CreateStackConnection

func CreateStackConnection(client *openapi.APIClient, orgID, projectName, stackID string, connection *openapi.StackConnection) *openapi.StackConnection

func CreateStackConnectionExpectError

func CreateStackConnectionExpectError(client *openapi.APIClient, orgID, projectName, stackID string, connection *openapi.StackConnection, expectedStatus int) *openapi.GenericOpenAPIError

func CreateStackExpectError

func CreateStackExpectError(client *openapi.APIClient, orgID, projectName string, stack *openapi.Stack, expectedStatus int) *openapi.GenericOpenAPIError

func CreateStackResource

func CreateStackResource(client *openapi.APIClient, orgID, projectName, stackID string, resource *openapi.StackResource) *openapi.StackResource

CreateStackResource adds a resource to an existing stack via the thin resource-create endpoint (POST /stacks/{id}/resources).

func CreateStackResourceExpectError

func CreateStackResourceExpectError(client *openapi.APIClient, orgID, projectName, stackID string, resource *openapi.StackResource, expectedStatus int) *openapi.GenericOpenAPIError

func CreateStackWithBrokenBuildSource

func CreateStackWithBrokenBuildSource(name string, repoURL string) *openapi.Stack

CreateStackWithBrokenBuildSource creates a stack pointing at a branch with a broken Dockerfile so the kaniko build fails, triggering last_build_failure_detail.

func CreateStackWithBuildSource

func CreateStackWithBuildSource(name string, repoURL string) *openapi.Stack

func CreateStackWithDependencies

func CreateStackWithDependencies(name string) *openapi.Stack

func CreateStackWithEnvAndPorts

func CreateStackWithEnvAndPorts(name string) *openapi.Stack

func CreateStackWithInitContainer

func CreateStackWithInitContainer(name string) *openapi.Stack

func CreateStackWithNamedBuildSource

func CreateStackWithNamedBuildSource(name, resourceName, repoURL string) *openapi.Stack

CreateStackWithNamedBuildSource lets a spec pick its own resource name: image_builds rows are keyed by the CR name <resource>-<commit>, so two stacks building the same commit under the same resource name collide.

func CreateStackWithPostgresAddon

func CreateStackWithPostgresAddon(name string, addonID string, database string) *openapi.Stack

func CreateStackWithPostgresAddonSuperuser

func CreateStackWithPostgresAddonSuperuser(name string, addonID string) *openapi.Stack

func DeleteGitIntegration

func DeleteGitIntegration(client *openapi.APIClient, orgID, integrationID string)

func DeleteObjectStore

func DeleteObjectStore(client *openapi.APIClient, orgID, projectName, storeID string)

func DeletePostgresAddon

func DeletePostgresAddon(client *openapi.APIClient, orgID, projectName, addonID string)

func DeleteSecret

func DeleteSecret(client *openapi.APIClient, orgID, projectName, secretID string)

func DeleteSecretRaw

func DeleteSecretRaw(client *openapi.APIClient, orgID, projectName, secretID string) (*http.Response, error)

func DeleteStack

func DeleteStack(client *openapi.APIClient, orgID, projectName, stackID string) *openapi.Stack

func DeleteStackConnection

func DeleteStackConnection(client *openapi.APIClient, orgID, projectName, stackID, connectionID string)

func DeleteStackConnectionExpectError

func DeleteStackConnectionExpectError(client *openapi.APIClient, orgID, projectName, stackID, connectionID string, expectedStatus int)

func DeleteStackResourceH

func DeleteStackResourceH(client *openapi.APIClient, orgID, projectName, stackID, resourceName string)

func DumpBuildSourceDebugInfo

func DumpBuildSourceDebugInfo(ctx context.Context, apiClient *openapi.APIClient, clusterClient client.Client, clientset *kubernetes.Clientset, orgID, projectName, stackID, namespace string)

DumpBuildSourceDebugInfo prints cluster and API state to help diagnose stuck builds.

func DumpCrashDetectionDebugInfo

func DumpCrashDetectionDebugInfo(ctx context.Context, clusterClient client.Client, namespace, resourceName string)

DumpCrashDetectionDebugInfo prints the raw StackResource CR status, Deployment conditions, and pod container statuses to help debug crash detection failures.

func DumpNamespaceDiagnostics

func DumpNamespaceDiagnostics(ctx context.Context, clusterClient client.Client, namespace string) string

DumpNamespaceDiagnostics renders the build-relevant state of a namespace — ImageBuild CRs (phase + conditions), Jobs, Pods (phase + container states), and Events — for inclusion in a timeout failure message.

func EnvConnection

func EnvConnection(fromType, fromName, toType, toName string, mappings []openapi.ConnectionMapping) openapi.StackConnection

func EnvConnectionWithID

func EnvConnectionWithID(fromType, fromID, toType, toName string, mappings []openapi.ConnectionMapping) openapi.StackConnection

func ErrorValidationCodes

func ErrorValidationCodes(apiErr *openapi.GenericOpenAPIError) []string

ErrorValidationCodes decodes an aggregated validation error's body and returns the codes carried in details.errors[].code. Works for any endpoint that returns errors.ValidationFailed (details: {"errors": [{field, code, message}]}), whether or not the generated client populated apiErr.Model() for the route.

func ExpectPostgresAddonEqual

func ExpectPostgresAddonEqual(expected, actual *openapi.PostgresAddon)

Assertion helpers for OpenAPI models using Ginkgo matchers

func GetContainerEnvVar

func GetContainerEnvVar(deploy *appsv1.Deployment, envName string) (string, bool)

func GetContainerEnvVarSecretRef

func GetContainerEnvVarSecretRef(deploy *appsv1.Deployment, envName string) (*corev1.SecretKeySelector, bool)

func GetContainerVolumeMount

func GetContainerVolumeMount(deploy *appsv1.Deployment, mountPath string) (*corev1.VolumeMount, bool)

func GetCredentials

func GetCredentials(apiClient *openapi.APIClient, orgID, projectName, addonID, database string) *openapi.PostgresCredentials

GetCredentials fetches JIT credentials for an addon database via the API.

func GetDeploymentForStackResource

func GetDeploymentForStackResource(ctx context.Context, clusterClient client.Client, namespace, name string) (*appsv1.Deployment, error)

func GetIngressesForStackResource

func GetIngressesForStackResource(ctx context.Context, clusterClient client.Client, resource *corev1alpha1.StackResource) ([]networkingv1.Ingress, error)

func GetInvite

func GetInvite(client *openapi.APIClient, orgID, inviteID string) *openapi.OrgInvite

func GetInviteExpectError

func GetInviteExpectError(client *openapi.APIClient, orgID, inviteID string, expectedStatus int)

func GetInviteInfo

func GetInviteInfo(client *openapi.APIClient, token string) *openapi.OrgInviteInfo

func GetInviteInfoExpectError

func GetInviteInfoExpectError(client *openapi.APIClient, token string, expectedStatus int)

func GetObjectStore

func GetObjectStore(client *openapi.APIClient, orgID, projectName, storeID string) *openapi.ObjectStore

func GetObjectStoreExpectError

func GetObjectStoreExpectError(client *openapi.APIClient, orgID, projectName, storeID string, expectedStatus int) *openapi.GenericOpenAPIError

func GetPostgresAddon

func GetPostgresAddon(client *openapi.APIClient, orgID, projectName, addonID string) *openapi.PostgresAddon

func GetPostgresAddonExpectError

func GetPostgresAddonExpectError(client *openapi.APIClient, orgID, projectName, addonID string, expectedStatus int) *openapi.GenericOpenAPIError

func GetPostgresClusterCR

func GetPostgresClusterCR(ctx context.Context, clusterClient client.Client, name, namespace string) (*addonsv1alpha1.PostgresCluster, error)

GetPostgresClusterCR retrieves the PostgresCluster CR from the cluster.

func GetRelease

func GetRelease(client *openapi.APIClient, orgID, projectName, stackID, releaseID string) *openapi.StackReleaseDetail

func GetSecret

func GetSecret(client *openapi.APIClient, orgID, projectName, secretID string) *openapi.Secret

func GetServiceForStackResource

func GetServiceForStackResource(ctx context.Context, clusterClient client.Client, namespace, name string) (*corev1.Service, error)

func GetStack

func GetStack(client *openapi.APIClient, orgID, projectName, stackID string) *openapi.Stack

func GetStackCR

func GetStackCR(ctx context.Context, clusterClient client.Client, name, namespace string) (*corev1alpha1.Stack, error)

func GetStackResourceCR

func GetStackResourceCR(ctx context.Context, clusterClient client.Client, name, namespace string) (*corev1alpha1.StackResource, error)

func GetStackTopology

func GetStackTopology(client *openapi.APIClient, orgID, projectName, stackID string) *openapi.StackTopology

func GetStackTopologyExpectError

func GetStackTopologyExpectError(client *openapi.APIClient, orgID, projectName, stackID string, expectedStatus int)

func GetSuperuserCredentials

func GetSuperuserCredentials(apiClient *openapi.APIClient, orgID, projectName, addonID string) *openapi.PostgresCredentials

GetSuperuserCredentials fetches JIT superuser credentials for an addon via the API. The database path param is required by the route but ignored by the service in superuser mode.

func HostMapping

func HostMapping() openapi.ConnectionMapping

func ListBackups

func ListBackups(apiClient *openapi.APIClient, orgID, projectName, addonID string) []openapi.PostgresBackup

ListBackups returns all backups for a postgres addon.

func ListInvites

func ListInvites(client *openapi.APIClient, orgID string) *openapi.OrgInviteList

func ListObjectStores

func ListObjectStores(client *openapi.APIClient, orgID, projectName string) *openapi.ObjectStoreList

func ListPostgresAddons

func ListPostgresAddons(client *openapi.APIClient, orgID, projectName string) *openapi.PostgresAddonList

func ListProjectMembers

func ListProjectMembers(client *openapi.APIClient, orgID, projectName string) *openapi.ProjectMembershipList

func ListReleaseEvents

func ListReleaseEvents(client *openapi.APIClient, orgID, projectName, stackID, releaseID string) *openapi.ReleaseEventList

ListReleaseEvents fetches the ordered release event timeline for a release.

func ListReleases

func ListReleases(client *openapi.APIClient, orgID, projectName, stackID string) *openapi.StackReleaseList

func ListStackBuilds

func ListStackBuilds(apiClient *openapi.APIClient, orgID, projectName, stackID string) []openapi.ImageBuild

func ListStackConnections

func ListStackConnections(client *openapi.APIClient, orgID, projectName, stackID string) []openapi.StackConnection

func ListStackConnectionsExpectError

func ListStackConnectionsExpectError(client *openapi.APIClient, orgID, projectName, stackID string, expectedStatus int)

func ListStacks

func ListStacks(client *openapi.APIClient, orgID, projectName string) *openapi.StackList

func MinIOEndpoint

func MinIOEndpoint() string

MinIOEndpoint returns the in-cluster endpoint for the MinIO service.

func NewInviteCreateRequest

func NewInviteCreateRequest(email, projectName, role string, expiresInDays int) openapi.OrgInviteCreateRequest

func PortForwardPod

func PortForwardPod(restConfig *rest.Config, clientset *kubernetes.Clientset, namespace, podName string, remotePort int) (int32, chan struct{})

PortForwardPod sets up port-forwarding to a pod. Returns the local port and a stop channel. Close stopChan to tear down the forward.

func PortForwardPostgres

func PortForwardPostgres(ctx context.Context, restConfig *rest.Config, clientset *kubernetes.Clientset, namespace, cnpgClusterName string) (int32, chan struct{})

PortForwardPostgres sets up port-forwarding to the CNPG primary pod for a given addon.

func PortForwardStackResource

func PortForwardStackResource(ctx context.Context, restConfig *rest.Config, clientset *kubernetes.Clientset, namespace, resourceName string, remotePort int) (int32, chan struct{})

PortForwardStackResource sets up port-forwarding to a pod backing a StackResource Deployment.

func PostgresMapping

func PostgresMapping(output, envName string) openapi.ConnectionMapping

func ResendInvite

func ResendInvite(client *openapi.APIClient, orgID, inviteID string)

func ResendInviteExpectError

func ResendInviteExpectError(client *openapi.APIClient, orgID, inviteID string, expectedStatus int)

func ResolveContainerEnvVar

func ResolveContainerEnvVar(ctx context.Context, clusterClient client.Client, deploy *appsv1.Deployment, namespace, envName string) (string, bool)

func ResourceWithDependsOn

func ResourceWithDependsOn(name string, deps []string) openapi.StackResource

func ResourceWithPort

func ResourceWithPort(name string, port int32) openapi.StackResource

func RevokeInvite

func RevokeInvite(client *openapi.APIClient, orgID, inviteID string)

func RevokeInviteExpectError

func RevokeInviteExpectError(client *openapi.APIClient, orgID, inviteID string, expectedStatus int)

func RollbackRelease

func RollbackRelease(client *openapi.APIClient, orgID, projectName, stackID, fromReleaseID string) *openapi.StackRelease

func SecretEnvConnection

func SecretEnvConnection(secretID, targetResource, envName, outputKey string) openapi.StackConnection

func ServeDeclaredPorts

func ServeDeclaredPorts(r *openapi.StackResource)

ServeDeclaredPorts makes TestImage listen on every port the resource declares. The cluster-agent synthesizes a TCP readiness probe on the primary declared port, so a resource declaring a port stock nginx does not serve never becomes Ready and its stack never converges.

func SignupNewUser

func SignupNewUser(name, email, password, orgName string) *openapi.UserSignupResponse

func SignupWithInvite

func SignupWithInvite(inviteToken, name, email, password string) *openapi.UserSignupResponse

func SignupWithInviteExpectError

func SignupWithInviteExpectError(inviteToken, name, email, password string, expectedStatus int)

func SimpleResource

func SimpleResource(name string) openapi.StackResource

func TriggerBackup

func TriggerBackup(apiClient *openapi.APIClient, orgID, projectName, addonID string)

TriggerBackup triggers an immediate backup for a postgres addon.

func UnauthenticatedClient

func UnauthenticatedClient() *openapi.APIClient

func UpdateObjectStore

func UpdateObjectStore(client *openapi.APIClient, orgID, projectName, storeID string, store *openapi.ObjectStore) *openapi.ObjectStore

func UpdateObjectStoreExpectError

func UpdateObjectStoreExpectError(client *openapi.APIClient, orgID, projectName, storeID string, store *openapi.ObjectStore, expectedStatus int) *openapi.GenericOpenAPIError

func UpdatePostgresAddon

func UpdatePostgresAddon(client *openapi.APIClient, orgID, projectName, addonID string, addon *openapi.PostgresAddon) *openapi.PostgresAddon

func UpdatePostgresAddonExpectError

func UpdatePostgresAddonExpectError(client *openapi.APIClient, orgID, projectName, addonID string, addon *openapi.PostgresAddon, expectedStatus int) *openapi.GenericOpenAPIError

func UpdateStack

func UpdateStack(client *openapi.APIClient, orgID, projectName, stackID string, stack *openapi.Stack) *openapi.Stack

func UpdateStackConnection

func UpdateStackConnection(client *openapi.APIClient, orgID, projectName, stackID, connectionID string, connection *openapi.StackConnection) *openapi.StackConnection

func UpdateStackConnectionExpectError

func UpdateStackConnectionExpectError(client *openapi.APIClient, orgID, projectName, stackID, connectionID string, connection *openapi.StackConnection, expectedStatus int) *openapi.GenericOpenAPIError

func UpdateStackExpectError

func UpdateStackExpectError(client *openapi.APIClient, orgID, projectName, stackID string, stack *openapi.Stack, expectedStatus int) *openapi.GenericOpenAPIError

func UpdateStackResourceH

func UpdateStackResourceH(client *openapi.APIClient, orgID, projectName, stackID, resourceName string, resource *openapi.StackResource) *openapi.StackResource

func UpdateStackShellH

func UpdateStackShellH(client *openapi.APIClient, orgID, projectName, stackID string, stack *openapi.Stack) *openapi.Stack

UpdateStackShellH updates a stack via the shell-only PUT endpoint. The server updates shell fields (name, labels, etc.) and ignores any inline children, so existing resources/connections are preserved.

func VerifyCRLabel

func VerifyCRLabel(cr *addonsv1alpha1.PostgresCluster, addonID string)

VerifyCRLabel checks that the CR has the expected addon ID label.

func VerifyCRSpec

func VerifyCRSpec(cr *addonsv1alpha1.PostgresCluster, expectedInstances int, expectedMajorVersion int, expectedStorage string)

VerifyCRSpec asserts that the PostgresCluster CR spec matches expected values.

func VerifyGitCredentialsSecretExists

func VerifyGitCredentialsSecretExists(ctx context.Context, clusterClient client.Client, namespace, stackID string)

func VerifyStackCRLabel

func VerifyStackCRLabel(cr *corev1alpha1.Stack, stackID string)

func VolumeMountConn

func VolumeMountConn(volumeName, targetResource, mountPath, subPath string) openapi.StackConnection

func WaitForAddonDeleted

func WaitForAddonDeleted(apiClient *openapi.APIClient, orgID, projectName, addonID string, timeout time.Duration)

WaitForAddonDeleted polls the API until the addon returns 404.

func WaitForAddonReady

func WaitForAddonReady(apiClient *openapi.APIClient, orgID, projectName, addonID string, timeout time.Duration) *openapi.PostgresAddon

WaitForAddonReady polls the API until the addon status is "Ready".

func WaitForAddonState

func WaitForAddonState(apiClient *openapi.APIClient, orgID, projectName, addonID, expectedState string, timeout time.Duration) *openapi.PostgresAddon

WaitForAddonState polls the API until the addon status matches the expected state.

func WaitForBackupPhase

func WaitForBackupPhase(apiClient *openapi.APIClient, orgID, projectName, addonID, expectedPhase string, timeout time.Duration)

WaitForBackupPhase polls until at least one backup reaches the expected phase.

func WaitForBuildLastFailureDetail

func WaitForBuildLastFailureDetail(apiClient *openapi.APIClient, orgID, projectName, stackID, resourceName string, timeout time.Duration) *openapi.BuildFailureDetail

WaitForBuildLastFailureDetail polls the API until last_build_failure_detail is populated on the named resource's most recent image build.

func WaitForCRDeleted

func WaitForCRDeleted(ctx context.Context, clusterClient client.Client, name, namespace string, timeout time.Duration)

WaitForCRDeleted polls the cluster until the PostgresCluster CR no longer exists.

func WaitForCRExists

func WaitForCRExists(ctx context.Context, clusterClient client.Client, name, namespace string, timeout time.Duration) *addonsv1alpha1.PostgresCluster

WaitForCRExists polls the cluster until a PostgresCluster CR exists with the given name and namespace.

func WaitForConditionTrue

func WaitForConditionTrue(apiClient *openapi.APIClient, orgID, projectName, addonID, conditionType string, timeout time.Duration)

WaitForConditionTrue polls the API until a specific condition on the addon is True.

func WaitForReleaseReleased

func WaitForReleaseReleased(client *openapi.APIClient, orgID, projectName, stackID, releaseID string, timeout time.Duration) *openapi.StackReleaseDetail

func WaitForReleaseState

func WaitForReleaseState(client *openapi.APIClient, orgID, projectName, stackID, releaseID, expectedState string, timeout time.Duration) *openapi.StackReleaseDetail

func WaitForStackActive

func WaitForStackActive(apiClient *openapi.APIClient, orgID, projectName, stackID string, timeout time.Duration) *openapi.Stack

WaitForStackActive polls the stack API until it responds 200 with an active lifecycle. The wait for stacks that never deploy (e.g. skip-cluster- provisioning fixtures): they have no releases, so WaitForStackReady's converged_release gate would never pass.

func WaitForStackCRDeleted

func WaitForStackCRDeleted(ctx context.Context, clusterClient client.Client, name, namespace string, timeout time.Duration)

func WaitForStackCRExists

func WaitForStackCRExists(ctx context.Context, clusterClient client.Client, name, namespace string, timeout time.Duration) *corev1alpha1.Stack

func WaitForStackDeleted

func WaitForStackDeleted(apiClient *openapi.APIClient, orgID, projectName, stackID string, timeout time.Duration)

func WaitForStackReady

func WaitForStackReady(apiClient *openapi.APIClient, orgID, projectName, stackID string, timeout time.Duration) *openapi.Stack

WaitForStackReady polls the stack API until the current release has converged (Released) and its live status is healthy (Ok) — the release-centric equivalent of the old "stack.status.state == Ready" wait.

func WaitForStackReadyWithDump

func WaitForStackReadyWithDump(apiClient *openapi.APIClient, orgID, projectName, stackID string, timeout time.Duration, clusterClient client.Client, namespace string) *openapi.Stack

WaitForStackReadyWithDump is WaitForStackReady plus a cluster-state dump (ImageBuild CRs, Jobs, Pods, Events in the stack namespace) appended to the failure message when the wait times out.

func WaitForStackResourceCRAvailable

func WaitForStackResourceCRAvailable(ctx context.Context, clusterClient client.Client, name, namespace string, timeout time.Duration) *corev1alpha1.StackResource

func WaitForStackResourceFailed

func WaitForStackResourceFailed(apiClient *openapi.APIClient, orgID, projectName, stackID, resourceName string, timeout time.Duration) *openapi.StackResourceStatus

WaitForStackResourceFailed polls the API until the named resource reaches Failed state.

func WaitForStackResourceLastFailure

func WaitForStackResourceLastFailure(apiClient *openapi.APIClient, orgID, projectName, stackID, resourceName string, timeout time.Duration) *openapi.StackResourceFailure

WaitForStackResourceLastFailure polls the API until last_failure is populated on the named resource.

Types

This section is empty.

Jump to

Keyboard shortcuts

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