Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyStackExpectError(client *openapi.APIClient, orgID, projectName, stackID string, ...) *openapi.GenericOpenAPIError
- func AuthenticatedClient(token string) *openapi.APIClient
- func CRNameForAddon(addonName string) string
- func CancelRelease(client *openapi.APIClient, orgID, projectName, stackID, releaseID string)
- func CnpgClusterName(addonName string, majorVersion int) string
- func ConnectToPostgres(host string, port int32, username, password, dbName, sslMode string) *sql.DB
- func CreateAzureCredentialsSecret(name string) *openapi.Secret
- func CreateCrashingStack(name string) *openapi.Stack
- func CreateFullStack(name string, addonID string, database string, secretID string) *openapi.Stack
- func CreateGCSCredentialsSecret(name string) *openapi.Secret
- func CreateGenericSecret(name string, data map[string]string) *openapi.Secret
- func CreateGitCredentialsIntegration(client *openapi.APIClient, orgID, host, username, password string) *openapi.GitIntegration
- func CreateGitCredentialsSecret(name string, token string) *openapi.Secret
- func CreateInvite(client *openapi.APIClient, orgID string, req openapi.OrgInviteCreateRequest) *openapi.OrgInviteCreateResponse
- func CreateInviteExpectError(client *openapi.APIClient, orgID string, req openapi.OrgInviteCreateRequest, ...)
- func CreateMinimalPostgresAddon(name string) *openapi.PostgresAddon
- func CreateMultiResourceStack(name string) *openapi.Stack
- func CreateObjectStore(client *openapi.APIClient, orgID, projectName string, ...) *openapi.ObjectStore
- func CreateObjectStoreExpectError(client *openapi.APIClient, orgID, projectName string, ...) *openapi.GenericOpenAPIError
- func CreateObjectStoreWithAzure(name string, secretID string) *openapi.ObjectStore
- func CreateObjectStoreWithGCS(name string, secretID string) *openapi.ObjectStore
- func CreateObjectStoreWithRetention(name string, secretID string, retention string) *openapi.ObjectStore
- func CreateObjectStoreWithS3(name string, secretID string) *openapi.ObjectStore
- func CreateObjectStoreWithS3Endpoint(name string, secretID string, endpoint string) *openapi.ObjectStore
- func CreatePostgresAddon(client *openapi.APIClient, orgID, projectName string, ...) *openapi.PostgresAddon
- func CreatePostgresAddonExpectError(client *openapi.APIClient, orgID, projectName string, ...) *openapi.GenericOpenAPIError
- func CreatePostgresAddonForUpdate(name string) *openapi.PostgresAddon
- func CreatePostgresAddonWithBackup(name string) *openapi.PostgresAddon
- func CreatePostgresAddonWithHA(name string) *openapi.PostgresAddon
- func CreatePostgresAddonWithResources(name string) *openapi.PostgresAddon
- func CreatePostgresAddonWithSuperuser(name string) *openapi.PostgresAddon
- func CreateProject(client *openapi.APIClient, orgID, projectName string) *openapi.Project
- func CreateRelease(client *openapi.APIClient, orgID, projectName, stackID string) *openapi.StackRelease
- func CreateReleaseExpectError(client *openapi.APIClient, orgID, projectName, stackID string, ...) *openapi.GenericOpenAPIError
- func CreateS3CredentialsSecret(name string) *openapi.Secret
- func CreateSecret(client *openapi.APIClient, orgID, projectName string, secret *openapi.Secret) *openapi.Secret
- func CreateShellStack(client *openapi.APIClient, orgID, projectName string, stack *openapi.Stack) *openapi.Stack
- func CreateSimpleStack(name string) *openapi.Stack
- func CreateSimulatedReleaseStack(name string, resources []openapi.StackResource, state string) *openapi.Stack
- func CreateSimulatedReleaseStackWithConnections(name string, resources []openapi.StackResource, ...) *openapi.Stack
- func CreateSkipProvisioningStack(name string, resources []openapi.StackResource) *openapi.Stack
- func CreateSkipProvisioningStackFull(name string, resources []openapi.StackResource, volumes []openapi.Volume, ...) *openapi.Stack
- func CreateSkipProvisioningStackWithConnections(name string, resources []openapi.StackResource, ...) *openapi.Stack
- func CreateSkipProvisioningStackWithVolumes(name string, resources []openapi.StackResource, volumes []openapi.Volume) *openapi.Stack
- func CreateStack(client *openapi.APIClient, orgID, projectName string, stack *openapi.Stack) *openapi.Stack
- func CreateStackAndDeploy(client *openapi.APIClient, orgID, projectName string, stack *openapi.Stack) (*openapi.Stack, *openapi.StackRelease)
- func CreateStackConnection(client *openapi.APIClient, orgID, projectName, stackID string, ...) *openapi.StackConnection
- func CreateStackConnectionExpectError(client *openapi.APIClient, orgID, projectName, stackID string, ...) *openapi.GenericOpenAPIError
- func CreateStackExpectError(client *openapi.APIClient, orgID, projectName string, stack *openapi.Stack, ...) *openapi.GenericOpenAPIError
- func CreateStackResource(client *openapi.APIClient, orgID, projectName, stackID string, ...) *openapi.StackResource
- func CreateStackResourceExpectError(client *openapi.APIClient, orgID, projectName, stackID string, ...) *openapi.GenericOpenAPIError
- func CreateStackWithBrokenBuildSource(name string, repoURL string) *openapi.Stack
- func CreateStackWithBuildSource(name string, repoURL string) *openapi.Stack
- func CreateStackWithDependencies(name string) *openapi.Stack
- func CreateStackWithEnvAndPorts(name string) *openapi.Stack
- func CreateStackWithInitContainer(name string) *openapi.Stack
- func CreateStackWithNamedBuildSource(name, resourceName, repoURL string) *openapi.Stack
- func CreateStackWithPostgresAddon(name string, addonID string, database string) *openapi.Stack
- func CreateStackWithPostgresAddonSuperuser(name string, addonID string) *openapi.Stack
- func DeleteGitIntegration(client *openapi.APIClient, orgID, integrationID string)
- func DeleteObjectStore(client *openapi.APIClient, orgID, projectName, storeID string)
- func DeletePostgresAddon(client *openapi.APIClient, orgID, projectName, addonID string)
- func DeleteSecret(client *openapi.APIClient, orgID, projectName, secretID string)
- func DeleteSecretRaw(client *openapi.APIClient, orgID, projectName, secretID string) (*http.Response, error)
- func DeleteStack(client *openapi.APIClient, orgID, projectName, stackID string) *openapi.Stack
- func DeleteStackConnection(client *openapi.APIClient, orgID, projectName, stackID, connectionID string)
- func DeleteStackConnectionExpectError(client *openapi.APIClient, orgID, projectName, stackID, connectionID string, ...)
- func DeleteStackResourceH(client *openapi.APIClient, orgID, projectName, stackID, resourceName string)
- func DumpBuildSourceDebugInfo(ctx context.Context, apiClient *openapi.APIClient, clusterClient client.Client, ...)
- func DumpCrashDetectionDebugInfo(ctx context.Context, clusterClient client.Client, ...)
- func DumpNamespaceDiagnostics(ctx context.Context, clusterClient client.Client, namespace string) string
- func EnvConnection(fromType, fromName, toType, toName string, ...) openapi.StackConnection
- func EnvConnectionWithID(fromType, fromID, toType, toName string, mappings []openapi.ConnectionMapping) openapi.StackConnection
- func ErrorValidationCodes(apiErr *openapi.GenericOpenAPIError) []string
- func ExpectPostgresAddonEqual(expected, actual *openapi.PostgresAddon)
- func GetContainerEnvVar(deploy *appsv1.Deployment, envName string) (string, bool)
- func GetContainerEnvVarSecretRef(deploy *appsv1.Deployment, envName string) (*corev1.SecretKeySelector, bool)
- func GetContainerVolumeMount(deploy *appsv1.Deployment, mountPath string) (*corev1.VolumeMount, bool)
- func GetCredentials(apiClient *openapi.APIClient, orgID, projectName, addonID, database string) *openapi.PostgresCredentials
- func GetDeploymentForStackResource(ctx context.Context, clusterClient client.Client, namespace, name string) (*appsv1.Deployment, error)
- func GetIngressesForStackResource(ctx context.Context, clusterClient client.Client, ...) ([]networkingv1.Ingress, error)
- func GetInvite(client *openapi.APIClient, orgID, inviteID string) *openapi.OrgInvite
- func GetInviteExpectError(client *openapi.APIClient, orgID, inviteID string, expectedStatus int)
- func GetInviteInfo(client *openapi.APIClient, token string) *openapi.OrgInviteInfo
- func GetInviteInfoExpectError(client *openapi.APIClient, token string, expectedStatus int)
- func GetObjectStore(client *openapi.APIClient, orgID, projectName, storeID string) *openapi.ObjectStore
- func GetObjectStoreExpectError(client *openapi.APIClient, orgID, projectName, storeID string, ...) *openapi.GenericOpenAPIError
- func GetPostgresAddon(client *openapi.APIClient, orgID, projectName, addonID string) *openapi.PostgresAddon
- func GetPostgresAddonExpectError(client *openapi.APIClient, orgID, projectName, addonID string, ...) *openapi.GenericOpenAPIError
- func GetPostgresClusterCR(ctx context.Context, clusterClient client.Client, name, namespace string) (*addonsv1alpha1.PostgresCluster, error)
- func GetRelease(client *openapi.APIClient, orgID, projectName, stackID, releaseID string) *openapi.StackReleaseDetail
- func GetSecret(client *openapi.APIClient, orgID, projectName, secretID string) *openapi.Secret
- func GetServiceForStackResource(ctx context.Context, clusterClient client.Client, namespace, name string) (*corev1.Service, error)
- func GetStack(client *openapi.APIClient, orgID, projectName, stackID string) *openapi.Stack
- func GetStackCR(ctx context.Context, clusterClient client.Client, name, namespace string) (*corev1alpha1.Stack, error)
- func GetStackResourceCR(ctx context.Context, clusterClient client.Client, name, namespace string) (*corev1alpha1.StackResource, error)
- func GetStackTopology(client *openapi.APIClient, orgID, projectName, stackID string) *openapi.StackTopology
- func GetStackTopologyExpectError(client *openapi.APIClient, orgID, projectName, stackID string, ...)
- func GetSuperuserCredentials(apiClient *openapi.APIClient, orgID, projectName, addonID string) *openapi.PostgresCredentials
- func HostMapping() openapi.ConnectionMapping
- func ListBackups(apiClient *openapi.APIClient, orgID, projectName, addonID string) []openapi.PostgresBackup
- func ListInvites(client *openapi.APIClient, orgID string) *openapi.OrgInviteList
- func ListObjectStores(client *openapi.APIClient, orgID, projectName string) *openapi.ObjectStoreList
- func ListPostgresAddons(client *openapi.APIClient, orgID, projectName string) *openapi.PostgresAddonList
- func ListProjectMembers(client *openapi.APIClient, orgID, projectName string) *openapi.ProjectMembershipList
- func ListReleaseEvents(client *openapi.APIClient, orgID, projectName, stackID, releaseID string) *openapi.ReleaseEventList
- func ListReleases(client *openapi.APIClient, orgID, projectName, stackID string) *openapi.StackReleaseList
- func ListStackBuilds(apiClient *openapi.APIClient, orgID, projectName, stackID string) []openapi.ImageBuild
- func ListStackConnections(client *openapi.APIClient, orgID, projectName, stackID string) []openapi.StackConnection
- func ListStackConnectionsExpectError(client *openapi.APIClient, orgID, projectName, stackID string, ...)
- func ListStacks(client *openapi.APIClient, orgID, projectName string) *openapi.StackList
- func MinIOEndpoint() string
- func NewInviteCreateRequest(email, projectName, role string, expiresInDays int) openapi.OrgInviteCreateRequest
- func PortForwardPod(restConfig *rest.Config, clientset *kubernetes.Clientset, ...) (int32, chan struct{})
- func PortForwardPostgres(ctx context.Context, restConfig *rest.Config, clientset *kubernetes.Clientset, ...) (int32, chan struct{})
- func PortForwardStackResource(ctx context.Context, restConfig *rest.Config, clientset *kubernetes.Clientset, ...) (int32, chan struct{})
- func PostgresMapping(output, envName string) openapi.ConnectionMapping
- func ResendInvite(client *openapi.APIClient, orgID, inviteID string)
- func ResendInviteExpectError(client *openapi.APIClient, orgID, inviteID string, expectedStatus int)
- func ResolveContainerEnvVar(ctx context.Context, clusterClient client.Client, deploy *appsv1.Deployment, ...) (string, bool)
- func ResourceWithDependsOn(name string, deps []string) openapi.StackResource
- func ResourceWithPort(name string, port int32) openapi.StackResource
- func RevokeInvite(client *openapi.APIClient, orgID, inviteID string)
- func RevokeInviteExpectError(client *openapi.APIClient, orgID, inviteID string, expectedStatus int)
- func RollbackRelease(client *openapi.APIClient, orgID, projectName, stackID, fromReleaseID string) *openapi.StackRelease
- func SecretEnvConnection(secretID, targetResource, envName, outputKey string) openapi.StackConnection
- func ServeDeclaredPorts(r *openapi.StackResource)
- func SignupNewUser(name, email, password, orgName string) *openapi.UserSignupResponse
- func SignupWithInvite(inviteToken, name, email, password string) *openapi.UserSignupResponse
- func SignupWithInviteExpectError(inviteToken, name, email, password string, expectedStatus int)
- func SimpleResource(name string) openapi.StackResource
- func TriggerBackup(apiClient *openapi.APIClient, orgID, projectName, addonID string)
- func UnauthenticatedClient() *openapi.APIClient
- func UpdateObjectStore(client *openapi.APIClient, orgID, projectName, storeID string, ...) *openapi.ObjectStore
- func UpdateObjectStoreExpectError(client *openapi.APIClient, orgID, projectName, storeID string, ...) *openapi.GenericOpenAPIError
- func UpdatePostgresAddon(client *openapi.APIClient, orgID, projectName, addonID string, ...) *openapi.PostgresAddon
- func UpdatePostgresAddonExpectError(client *openapi.APIClient, orgID, projectName, addonID string, ...) *openapi.GenericOpenAPIError
- func UpdateStack(client *openapi.APIClient, orgID, projectName, stackID string, ...) *openapi.Stack
- func UpdateStackConnection(client *openapi.APIClient, orgID, projectName, stackID, connectionID string, ...) *openapi.StackConnection
- func UpdateStackConnectionExpectError(client *openapi.APIClient, orgID, projectName, stackID, connectionID string, ...) *openapi.GenericOpenAPIError
- func UpdateStackExpectError(client *openapi.APIClient, orgID, projectName, stackID string, ...) *openapi.GenericOpenAPIError
- func UpdateStackResourceH(client *openapi.APIClient, orgID, projectName, stackID, resourceName string, ...) *openapi.StackResource
- func UpdateStackShellH(client *openapi.APIClient, orgID, projectName, stackID string, ...) *openapi.Stack
- func VerifyCRLabel(cr *addonsv1alpha1.PostgresCluster, addonID string)
- func VerifyCRSpec(cr *addonsv1alpha1.PostgresCluster, expectedInstances int, ...)
- func VerifyGitCredentialsSecretExists(ctx context.Context, clusterClient client.Client, namespace, stackID string)
- func VerifyStackCRLabel(cr *corev1alpha1.Stack, stackID string)
- func VolumeMountConn(volumeName, targetResource, mountPath, subPath string) openapi.StackConnection
- func WaitForAddonDeleted(apiClient *openapi.APIClient, orgID, projectName, addonID string, ...)
- func WaitForAddonReady(apiClient *openapi.APIClient, orgID, projectName, addonID string, ...) *openapi.PostgresAddon
- func WaitForAddonState(apiClient *openapi.APIClient, ...) *openapi.PostgresAddon
- func WaitForBackupPhase(apiClient *openapi.APIClient, ...)
- func WaitForBuildLastFailureDetail(apiClient *openapi.APIClient, orgID, projectName, stackID, resourceName string, ...) *openapi.BuildFailureDetail
- func WaitForCRDeleted(ctx context.Context, clusterClient client.Client, name, namespace string, ...)
- func WaitForCRExists(ctx context.Context, clusterClient client.Client, name, namespace string, ...) *addonsv1alpha1.PostgresCluster
- func WaitForConditionTrue(apiClient *openapi.APIClient, ...)
- func WaitForReleaseReleased(client *openapi.APIClient, orgID, projectName, stackID, releaseID string, ...) *openapi.StackReleaseDetail
- func WaitForReleaseState(client *openapi.APIClient, ...) *openapi.StackReleaseDetail
- func WaitForStackActive(apiClient *openapi.APIClient, orgID, projectName, stackID string, ...) *openapi.Stack
- func WaitForStackCRDeleted(ctx context.Context, clusterClient client.Client, name, namespace string, ...)
- func WaitForStackCRExists(ctx context.Context, clusterClient client.Client, name, namespace string, ...) *corev1alpha1.Stack
- func WaitForStackDeleted(apiClient *openapi.APIClient, orgID, projectName, stackID string, ...)
- func WaitForStackReady(apiClient *openapi.APIClient, orgID, projectName, stackID string, ...) *openapi.Stack
- func WaitForStackReadyWithDump(apiClient *openapi.APIClient, orgID, projectName, stackID string, ...) *openapi.Stack
- func WaitForStackResourceCRAvailable(ctx context.Context, clusterClient client.Client, name, namespace string, ...) *corev1alpha1.StackResource
- func WaitForStackResourceFailed(apiClient *openapi.APIClient, orgID, projectName, stackID, resourceName string, ...) *openapi.StackResourceStatus
- func WaitForStackResourceLastFailure(apiClient *openapi.APIClient, orgID, projectName, stackID, resourceName string, ...) *openapi.StackResourceFailure
Constants ¶
const ( InitImage = "busybox:1.36" InitCommand = "echo init-done" )
InitContainer fixture values
const ( MultiResourceBackendName = "backend" MultiResourceFrontendName = "frontend" MultiResourceBackendPort = 8080 MultiResourceFrontendPort = 80 )
Multi-resource stack fixture values
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
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)
const ( CrashResourceName = "crash-app" CrashImage = "busybox:1.36" CrashMessage = "application crashed with fatal error" )
Crash detection fixture values
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
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.
const SimulateReleaseStateAnnotationKey = models.SimulateReleaseStateAnnotation
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.
const TestImage = "nginx:1.25-alpine"
Shared test image used across all stack fixtures
Variables ¶
var FullStackSecretEnvMapping = map[string]string{
"tls_cert": "TLS_CERT",
"tls_key": "TLS_KEY",
}
FullStackSecretEnvMapping maps secret output keys to env var names.
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 AuthenticatedClient ¶
func CRNameForAddon ¶
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 CnpgClusterName ¶
CnpgClusterName returns the CNPG Cluster CR name derived from addon name and PG major version.
func ConnectToPostgres ¶
ConnectToPostgres opens a real PostgreSQL connection and runs SELECT 1 to verify connectivity.
func CreateAzureCredentialsSecret ¶
CreateAzureCredentialsSecret creates a secret with Azure connection string
func CreateCrashingStack ¶
CreateCrashingStack creates a stack whose sole resource immediately exits with a non-zero code, triggering CrashLoopBackOff so the cluster-agent populates LastFailureDetails.
func CreateFullStack ¶
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 ¶
CreateGCSCredentialsSecret creates a secret with GCS service account credentials
func CreateGenericSecret ¶
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 ¶
CreateGitCredentialsSecret creates a GitCredentials secret with a GitHub PAT token
func CreateInvite ¶
func CreateInvite(client *openapi.APIClient, orgID string, req openapi.OrgInviteCreateRequest) *openapi.OrgInviteCreateResponse
func CreateInviteExpectError ¶
func CreateMinimalPostgresAddon ¶
func CreateMinimalPostgresAddon(name string) *openapi.PostgresAddon
PostgreSQL addon factory functions using OpenAPI models
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 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 ¶
CreateS3CredentialsSecret creates a secret with MinIO S3 access credentials
func CreateSecret ¶
func CreateShellStack ¶
func CreateSimpleStack ¶
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 CreateStack ¶
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 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 ¶
CreateStackWithBrokenBuildSource creates a stack pointing at a branch with a broken Dockerfile so the kaniko build fails, triggering last_build_failure_detail.
func CreateStackWithNamedBuildSource ¶
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 DeleteGitIntegration ¶
func DeleteObjectStore ¶
func DeletePostgresAddon ¶
func DeleteSecret ¶
func DeleteSecretRaw ¶
func DeleteStack ¶
func DeleteStackConnection ¶
func DeleteStackResourceH ¶
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 GetIngressesForStackResource ¶
func GetIngressesForStackResource(ctx context.Context, clusterClient client.Client, resource *corev1alpha1.StackResource) ([]networkingv1.Ingress, error)
func GetInviteExpectError ¶
func GetInviteInfo ¶
func GetInviteInfo(client *openapi.APIClient, token string) *openapi.OrgInviteInfo
func GetObjectStore ¶
func GetObjectStore(client *openapi.APIClient, orgID, projectName, storeID string) *openapi.ObjectStore
func GetPostgresAddon ¶
func GetPostgresAddon(client *openapi.APIClient, orgID, projectName, addonID string) *openapi.PostgresAddon
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 GetStackCR ¶
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 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 ListStacks ¶
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 ResendInviteExpectError ¶
func ResolveContainerEnvVar ¶
func ResourceWithDependsOn ¶
func ResourceWithDependsOn(name string, deps []string) openapi.StackResource
func ResourceWithPort ¶
func ResourceWithPort(name string, port int32) openapi.StackResource
func RevokeInvite ¶
func RevokeInviteExpectError ¶
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 SimpleResource ¶
func SimpleResource(name string) openapi.StackResource
func TriggerBackup ¶
TriggerBackup triggers an immediate backup for a postgres addon.
func UnauthenticatedClient ¶
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 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 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 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 WaitForReleaseState ¶
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 WaitForStackCRExists ¶
func WaitForStackDeleted ¶
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.