v1alpha1

package
v0.10.0 Latest Latest
Warning

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

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

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the diverge v1alpha1 API group +kubebuilder:object:generate=true +groupName=diverge.io

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "diverge.io", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} //nolint:staticcheck // kubebuilder scaffold pattern

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func DefaultEnvVarForProtocol added in v0.2.0

func DefaultEnvVarForProtocol(protocol string) string

DefaultEnvVarForProtocol returns the default environment variable name for a protocol.

func SetupPreviewGroupWebhookWithManager

func SetupPreviewGroupWebhookWithManager(mgr ctrl.Manager) error

SetupPreviewGroupWebhookWithManager registers the validating webhook.

Types

type AsyncRouteSpec added in v0.2.0

type AsyncRouteSpec struct {
	// Protocol is the async protocol type.
	// +kubebuilder:validation:Enum=temporal;kafka
	Protocol string `json:"protocol" yaml:"protocol"`

	// Target is the baseline resource name (e.g., task queue name or topic name).
	// +kubebuilder:validation:Pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]*$"
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=249
	Target string `json:"target" yaml:"target"`

	// EnvVarMapping maps provisioned targets to environment variable names.
	// If empty, sensible defaults are used based on protocol:
	// - temporal: TEMPORAL_TASK_QUEUE
	// - kafka: KAFKA_CONSUMER_GROUP
	// +optional
	EnvVarMapping map[string]string `json:"envVarMapping,omitempty" yaml:"envVarMapping,omitempty"`
}

AsyncRouteSpec defines an async routing target for event-driven services.

func (*AsyncRouteSpec) DeepCopy added in v0.3.0

func (in *AsyncRouteSpec) DeepCopy() *AsyncRouteSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AsyncRouteSpec.

func (*AsyncRouteSpec) DeepCopyInto added in v0.3.0

func (in *AsyncRouteSpec) DeepCopyInto(out *AsyncRouteSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type AtlasPolicySpec added in v0.7.0

type AtlasPolicySpec struct {
	// Destructive controls how destructive schema changes are handled.
	// +kubebuilder:validation:Enum=error;warn;allow
	// +kubebuilder:default=error
	Destructive string `json:"destructive,omitempty"`
}

AtlasPolicySpec configures Atlas Operator safety policies.

func (*AtlasPolicySpec) DeepCopy added in v0.7.0

func (in *AtlasPolicySpec) DeepCopy() *AtlasPolicySpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AtlasPolicySpec.

func (*AtlasPolicySpec) DeepCopyInto added in v0.7.0

func (in *AtlasPolicySpec) DeepCopyInto(out *AtlasPolicySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type AtlasSpec added in v0.7.0

type AtlasSpec struct {
	// Mode selects the Atlas migration paradigm.
	// +kubebuilder:validation:Enum=versioned;declarative
	Mode string `json:"mode,omitempty"` // versioned (AtlasMigration) or declarative (AtlasSchema)
	// MigrationConfigMap references a ConfigMap containing versioned .sql migration files and atlas.sum.
	MigrationConfigMap string `json:"migrationConfigMap,omitempty"`
	// SchemaConfigMap references a ConfigMap containing the desired schema (SQL or HCL).
	SchemaConfigMap string `json:"schemaConfigMap,omitempty"`
	// Blocking controls whether the Environment waits for Atlas to report Ready.
	// +kubebuilder:default=true
	// +optional
	Blocking *bool `json:"blocking,omitempty"`
	// Policy configures Atlas safety policies.
	// +optional
	Policy *AtlasPolicySpec `json:"policy,omitempty"`
}

AtlasSpec configures Atlas Operator integration for database schema management.

func (*AtlasSpec) DeepCopy added in v0.7.0

func (in *AtlasSpec) DeepCopy() *AtlasSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AtlasSpec.

func (*AtlasSpec) DeepCopyInto added in v0.7.0

func (in *AtlasSpec) DeepCopyInto(out *AtlasSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BannerSpec added in v0.4.0

type BannerSpec struct {
	// Enabled controls whether the preview banner is injected into HTTP responses.
	Enabled bool `json:"enabled,omitempty"`
	// Text specifies the text to display inside the preview banner.
	// +kubebuilder:default="Preview Environment"
	Text string `json:"text,omitempty"`
	// Position determines where the banner is displayed on the screen.
	// +kubebuilder:validation:Enum=top;bottom
	// +kubebuilder:default=top
	Position string `json:"position,omitempty"`
	// Color is the hex color code for the banner background.
	// +kubebuilder:validation:Pattern="^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"
	// +kubebuilder:default="#FF6B00"
	Color string `json:"color,omitempty"`
}

BannerSpec configures the visual preview environment indicator injected into responses.

func (*BannerSpec) DeepCopy added in v0.4.0

func (in *BannerSpec) DeepCopy() *BannerSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BannerSpec.

func (*BannerSpec) DeepCopyInto added in v0.4.0

func (in *BannerSpec) DeepCopyInto(out *BannerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CookieSpec added in v0.4.0

type CookieSpec struct {
	Enabled bool `json:"enabled,omitempty"`
	// +kubebuilder:validation:Minimum=0
	MaxAge int `json:"maxAge,omitempty"` // seconds, default 86400 (24h)
	// +kubebuilder:validation:Enum=Lax;Strict;None
	SameSite string `json:"sameSite,omitempty"` // Lax, Strict, None
	Secure   bool   `json:"secure,omitempty"`
}

CookieSpec defines the configuration for sticky routing cookies.

func (*CookieSpec) DeepCopy added in v0.4.0

func (in *CookieSpec) DeepCopy() *CookieSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CookieSpec.

func (*CookieSpec) DeepCopyInto added in v0.4.0

func (in *CookieSpec) DeepCopyInto(out *CookieSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DiscoveredIngressPath added in v0.8.0

type DiscoveredIngressPath struct {
	// Entrypoint is the gateway service name where the path originates.
	Entrypoint string `json:"entrypoint"`

	// Target is the destination service name.
	Target string `json:"target"`

	// Hops is the ordered list of services along the path,
	// from entrypoint to target inclusive.
	Hops []string `json:"hops"`
}

DiscoveredIngressPath represents a resolved routing path from a gateway entrypoint to a target service.

func (*DiscoveredIngressPath) DeepCopy added in v0.8.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiscoveredIngressPath.

func (*DiscoveredIngressPath) DeepCopyInto added in v0.8.0

func (in *DiscoveredIngressPath) DeepCopyInto(out *DiscoveredIngressPath)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EnvVar

type EnvVar struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

EnvVar represents an environment variable for a preview container.

func (*EnvVar) DeepCopy

func (in *EnvVar) DeepCopy() *EnvVar

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvVar.

func (*EnvVar) DeepCopyInto

func (in *EnvVar) DeepCopyInto(out *EnvVar)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Environment

type Environment struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   EnvironmentSpec   `json:"spec,omitempty"`
	Status EnvironmentStatus `json:"status,omitempty"`
}

Environment is the Schema for the environments API

func (*Environment) DeepCopy

func (in *Environment) DeepCopy() *Environment

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Environment.

func (*Environment) DeepCopyInto

func (in *Environment) DeepCopyInto(out *Environment)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Environment) DeepCopyObject

func (in *Environment) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Environment) PreviewNamespace

func (e *Environment) PreviewNamespace() string

PreviewNamespace returns the namespace name used for this environment's preview resources when running in "create" namespace mode. The name is sanitized to a valid DNS-1123 label (lowercase alphanumeric and hyphens, max 63 characters) with a stable hash suffix when truncation is needed. The hash incorporates both Name and Namespace to prevent collisions across namespaces.

type EnvironmentDatabase

type EnvironmentDatabase struct {
	// +kubebuilder:validation:Enum=shared;schema;snapshot;fresh
	Mode          string            `json:"mode,omitempty"` // shared, schema, snapshot, fresh
	ConnectionRef string            `json:"connectionRef,omitempty"`
	SeedSource    string            `json:"seedSource,omitempty"`
	MigrationJob  *MigrationJobSpec `json:"migrationJob,omitempty"`
	Atlas         *AtlasSpec        `json:"atlas,omitempty"`
}

EnvironmentDatabase defines the database configuration

func (*EnvironmentDatabase) DeepCopy

func (in *EnvironmentDatabase) DeepCopy() *EnvironmentDatabase

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentDatabase.

func (*EnvironmentDatabase) DeepCopyInto

func (in *EnvironmentDatabase) DeepCopyInto(out *EnvironmentDatabase)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EnvironmentDeploy

type EnvironmentDeploy struct {
	// +kubebuilder:validation:Enum=delta;full
	Mode string `json:"mode,omitempty"` // delta or full
	// +kubebuilder:validation:Enum=same;create
	// +kubebuilder:default=same
	Namespace string `json:"namespace,omitempty"` // same = deploy in CR's namespace, create = new diverge-* namespace
	// +optional
	NamespaceLabels map[string]string `json:"namespaceLabels,omitempty"`
	ChangedServices []string          `json:"changedServices,omitempty"`
	BaselineRef     string            `json:"baselineRef,omitempty"`
	// Manifests specifies where pre-rendered manifests are stored.
	// Required when using the direct deployer.
	// +optional
	Manifests *ManifestSource `json:"manifests,omitempty"`
	// EnvFrom specifies environment variables to inject from Secrets.
	// +optional
	EnvFrom []SecretRef `json:"envFrom,omitempty"`
}

EnvironmentDeploy defines the deployment configuration

func (*EnvironmentDeploy) DeepCopy

func (in *EnvironmentDeploy) DeepCopy() *EnvironmentDeploy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentDeploy.

func (*EnvironmentDeploy) DeepCopyInto

func (in *EnvironmentDeploy) DeepCopyInto(out *EnvironmentDeploy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EnvironmentLifecycle

type EnvironmentLifecycle struct {
	TTL            *metav1.Duration `json:"ttl,omitempty"`
	CleanupOnMerge bool             `json:"cleanupOnMerge,omitempty"`
}

EnvironmentLifecycle defines the lifecycle configuration

func (*EnvironmentLifecycle) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentLifecycle.

func (*EnvironmentLifecycle) DeepCopyInto

func (in *EnvironmentLifecycle) DeepCopyInto(out *EnvironmentLifecycle)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EnvironmentList

type EnvironmentList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Environment `json:"items"`
}

EnvironmentList contains a list of Environment

func (*EnvironmentList) DeepCopy

func (in *EnvironmentList) DeepCopy() *EnvironmentList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentList.

func (*EnvironmentList) DeepCopyInto

func (in *EnvironmentList) DeepCopyInto(out *EnvironmentList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*EnvironmentList) DeepCopyObject

func (in *EnvironmentList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type EnvironmentPhase

type EnvironmentPhase string

EnvironmentPhase defines the phases an Environment can be in

const (
	// PhasePending ...
	PhasePending EnvironmentPhase = "Pending"
	// PhaseDeploying ...
	PhaseDeploying EnvironmentPhase = "Deploying"
	// PhaseRunning ...
	PhaseRunning EnvironmentPhase = "Running"
	// PhaseFailed ...
	PhaseFailed EnvironmentPhase = "Failed"
	// PhaseTerminating ...
	PhaseTerminating EnvironmentPhase = "Terminating"
)

type EnvironmentRouting

type EnvironmentRouting struct {
	// +kubebuilder:validation:Enum=header;namespace;subdomain
	Mode string `json:"mode,omitempty"` // header, namespace, subdomain
	// +kubebuilder:validation:Enum=istio;gateway
	// +kubebuilder:default=gateway
	Provider    string `json:"provider,omitempty"`
	HeaderKey   string `json:"headerKey,omitempty"`
	HeaderValue string `json:"headerValue,omitempty"`
	ExternalURL string `json:"externalUrl,omitempty"`
	DevIP       string `json:"devIP,omitempty"`
	// BaseDomain is the base domain for subdomain routing (e.g., "preview.app.dev").
	// When mode is "subdomain", HTTPRoutes are created with hostname "<env-name>.<baseDomain>".
	// +optional
	BaseDomain string `json:"baseDomain,omitempty"`
	// AsyncRoutes defines async routing targets for event-driven backends.
	// +optional
	// +kubebuilder:validation:MaxItems=50
	AsyncRoutes []AsyncRouteSpec `json:"asyncRoutes,omitempty"`
	// Cookie enables sticky routing using cookies.
	// +optional
	Cookie *CookieSpec `json:"cookie,omitempty"`
	// Banner configures a preview indicator banner to inject into responses.
	// +optional
	Banner *BannerSpec `json:"banner,omitempty"`
}

EnvironmentRouting defines the routing configuration

func (*EnvironmentRouting) DeepCopy

func (in *EnvironmentRouting) DeepCopy() *EnvironmentRouting

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentRouting.

func (*EnvironmentRouting) DeepCopyInto

func (in *EnvironmentRouting) DeepCopyInto(out *EnvironmentRouting)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EnvironmentSource

type EnvironmentSource struct {
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Enum=gitlab;github
	Provider string `json:"provider"` // e.g., gitlab
	// +kubebuilder:validation:Required
	Project string `json:"project"`
	MR      int    `json:"mr,omitempty"`
	// +kubebuilder:validation:Required
	Branch    string `json:"branch"`
	CommitSHA string `json:"commitSHA,omitempty"`
}

EnvironmentSource defines the source code origin for the environment

func (*EnvironmentSource) DeepCopy

func (in *EnvironmentSource) DeepCopy() *EnvironmentSource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentSource.

func (*EnvironmentSource) DeepCopyInto

func (in *EnvironmentSource) DeepCopyInto(out *EnvironmentSource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EnvironmentSpec

type EnvironmentSpec struct {
	Source    EnvironmentSource    `json:"source,omitempty"`
	Deploy    EnvironmentDeploy    `json:"deploy,omitempty"`
	Routing   EnvironmentRouting   `json:"routing,omitempty"`
	Database  EnvironmentDatabase  `json:"database,omitempty"`
	Lifecycle EnvironmentLifecycle `json:"lifecycle,omitempty"`
	// Testing configures automated test integration.
	// +optional
	Testing *TestingSpec `json:"testing,omitempty"`
	// ServiceConfig holds preview configuration for multi-repo mode.
	// When set, the controller deploys a single preview pod based on
	// this config rather than using ManifestFetcher.
	// +optional
	ServiceConfig *ServicePreviewConfig `json:"serviceConfig,omitempty"`
	// EnvFrom specifies environment variables to inject from Secrets.
	// +optional
	EnvFrom []SecretRef `json:"envFrom,omitempty"`
}

EnvironmentSpec defines the desired state of Environment

func (*EnvironmentSpec) DeepCopy

func (in *EnvironmentSpec) DeepCopy() *EnvironmentSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentSpec.

func (*EnvironmentSpec) DeepCopyInto

func (in *EnvironmentSpec) DeepCopyInto(out *EnvironmentSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EnvironmentStatus

type EnvironmentStatus struct {
	Phase              EnvironmentPhase   `json:"phase,omitempty"`
	URL                string             `json:"url,omitempty"`
	Services           []string           `json:"services,omitempty"`
	DatabaseStatus     string             `json:"databaseStatus,omitempty"`
	CreatedAt          *metav1.Time       `json:"createdAt,omitempty"`
	ExpiresAt          *metav1.Time       `json:"expiresAt,omitempty"`
	ObservedGeneration int64              `json:"observedGeneration,omitempty"`
	Conditions         []metav1.Condition `json:"conditions,omitempty"`
	CommitSHA          string             `json:"commitSHA,omitempty"`
	CommentID          int                `json:"commentID,omitempty"`
	CommitStatusURL    string             `json:"commitStatusURL,omitempty"`
	// TestStatus tracks the state of the test run for this environment.
	// +optional
	TestStatus *TestStatus `json:"testStatus,omitempty"`

	// AsyncEnvVars contains environment variables injected by async route provisioners.
	// +optional
	AsyncEnvVars map[string]string `json:"asyncEnvVars,omitempty"`

	// MigrationStatus tracks the state of the migration hook.
	// +optional
	MigrationStatus string `json:"migrationStatus,omitempty"` // Pending, Running, Succeeded, Failed
	// MigrationMessage provides details about the migration hook state.
	// +optional
	MigrationMessage string `json:"migrationMessage,omitempty"`
	// PostDeployStatus tracks the state of the post-deploy hook.
	// +optional
	PostDeployStatus string `json:"postDeployStatus,omitempty"`
}

EnvironmentStatus defines the observed state of Environment

func (*EnvironmentStatus) DeepCopy

func (in *EnvironmentStatus) DeepCopy() *EnvironmentStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentStatus.

func (*EnvironmentStatus) DeepCopyInto

func (in *EnvironmentStatus) DeepCopyInto(out *EnvironmentStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type KEDASpec added in v0.7.0

type KEDASpec struct {
	// Enabled enables KEDA autoscaling for this service.
	// +optional
	Enabled *bool `json:"enabled,omitempty"`
	// MinReplicas is the minimum number of replicas. Set to 0 for scale-to-zero.
	// When nil, falls back to the controller CLI flag (--keda-min-replicas).
	// +kubebuilder:validation:Minimum=0
	// +optional
	MinReplicas *int32 `json:"minReplicas,omitempty"`
	// MaxReplicas is the maximum number of replicas.
	// When nil, falls back to the controller CLI flag (--keda-max-replicas).
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=100
	// +optional
	MaxReplicas *int32 `json:"maxReplicas,omitempty"`
	// CooldownPeriod is the cooldown period in seconds before scaling down.
	// When nil, falls back to the controller CLI flag (--keda-cooldown).
	// +kubebuilder:validation:Minimum=0
	// +optional
	CooldownPeriod *int32 `json:"cooldownPeriod,omitempty"`
	// PollingInterval is the interval in seconds KEDA checks metrics. Default: 30.
	// +kubebuilder:validation:Minimum=1
	// +optional
	PollingInterval *int32 `json:"pollingInterval,omitempty"`
	// TargetQueueSize is the target backlog per replica for queue-based scaling. Default: 5.
	// +optional
	TargetQueueSize *int32 `json:"targetQueueSize,omitempty"`
}

KEDASpec defines per-service autoscaling configuration for KEDA.

func (*KEDASpec) DeepCopy added in v0.7.0

func (in *KEDASpec) DeepCopy() *KEDASpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KEDASpec.

func (*KEDASpec) DeepCopyInto added in v0.7.0

func (in *KEDASpec) DeepCopyInto(out *KEDASpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ManifestSource

type ManifestSource struct {
	// Type is the manifest source type: "configmap" or "url".
	// +kubebuilder:validation:Enum=configmap;url
	Type string `json:"type"`
	// URL for HTTP-based manifest fetching (when type=url).
	// +kubebuilder:validation:Pattern="^https?://.*"
	URL string `json:"url,omitempty"`
}

ManifestSource specifies how pre-rendered manifests are provided to the DirectDeployer.

func (*ManifestSource) DeepCopy

func (in *ManifestSource) DeepCopy() *ManifestSource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManifestSource.

func (*ManifestSource) DeepCopyInto

func (in *ManifestSource) DeepCopyInto(out *ManifestSource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MigrationJobSpec

type MigrationJobSpec struct {
	// Image is the container image to use for the migration job.
	Image string `json:"image,omitempty"`
	// Args specifies the arguments to pass to the migration job container.
	Args []string `json:"args,omitempty"`
	// EnvFrom specifies environment variables to inject from Secrets.
	EnvFrom []SecretRef `json:"envFrom,omitempty"`
	// TimeoutSeconds is the maximum duration the migration job can run before being terminated.
	TimeoutSeconds int32 `json:"timeoutSeconds,omitempty"` // Default 120
	// Blocking controls whether the Environment waits for the migration to complete.
	// +kubebuilder:default=true
	// +optional
	Blocking *bool `json:"blocking,omitempty"` // Default true
}

MigrationJobSpec configures a Kubernetes Job for database migrations.

func (*MigrationJobSpec) DeepCopy

func (in *MigrationJobSpec) DeepCopy() *MigrationJobSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MigrationJobSpec.

func (*MigrationJobSpec) DeepCopyInto

func (in *MigrationJobSpec) DeepCopyInto(out *MigrationJobSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PostDeploySpec added in v0.7.0

type PostDeploySpec struct {
	// Image is the container image to use for the post-deploy job.
	Image string `json:"image,omitempty"`
	// Args specifies the arguments to pass to the post-deploy container.
	Args []string `json:"args,omitempty"`
	// EnvFrom specifies environment variables to inject from Secrets.
	EnvFrom []SecretRef `json:"envFrom,omitempty"`
	// TimeoutSeconds is the maximum duration before the job is terminated.
	TimeoutSeconds int32 `json:"timeoutSeconds,omitempty"` // Default 60
	// Blocking controls whether the Environment waits for the post-deploy job.
	// +kubebuilder:default=false
	// +optional
	Blocking *bool `json:"blocking,omitempty"` // Default false
}

PostDeploySpec configures a generic post-deployment Job hook.

func (*PostDeploySpec) DeepCopy added in v0.7.0

func (in *PostDeploySpec) DeepCopy() *PostDeploySpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostDeploySpec.

func (*PostDeploySpec) DeepCopyInto added in v0.7.0

func (in *PostDeploySpec) DeepCopyInto(out *PostDeploySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PreviewGroup

type PreviewGroup struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   PreviewGroupSpec   `json:"spec,omitempty"`
	Status PreviewGroupStatus `json:"status,omitempty"`
}

PreviewGroup is a collection of related preview services deployed together from a single MR/PR. It acts as an "operator of operators", creating and managing child Environment CRs across multiple namespaces.

PreviewGroup is cluster-scoped because services in a preview group may span multiple namespaces (e.g. product-rad, product-clinical, platform-core).

func (*PreviewGroup) DeepCopy

func (in *PreviewGroup) DeepCopy() *PreviewGroup

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PreviewGroup.

func (*PreviewGroup) DeepCopyInto

func (in *PreviewGroup) DeepCopyInto(out *PreviewGroup)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PreviewGroup) DeepCopyObject

func (in *PreviewGroup) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PreviewGroupLifecycle

type PreviewGroupLifecycle struct {
	// TTL is the time-to-live for the preview group.
	// After this duration, the group is automatically deleted.
	// +optional
	TTL *metav1.Duration `json:"ttl,omitempty"`

	// CleanupOnMerge controls whether to automatically delete the preview group
	// when the source MR/PR is merged or closed.
	// +optional
	CleanupOnMerge bool `json:"cleanupOnMerge,omitempty"`
}

PreviewGroupLifecycle configures automatic cleanup and TTL for the group.

func (*PreviewGroupLifecycle) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PreviewGroupLifecycle.

func (*PreviewGroupLifecycle) DeepCopyInto

func (in *PreviewGroupLifecycle) DeepCopyInto(out *PreviewGroupLifecycle)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PreviewGroupList

type PreviewGroupList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []PreviewGroup `json:"items"`
}

PreviewGroupList contains a list of PreviewGroup

func (*PreviewGroupList) DeepCopy

func (in *PreviewGroupList) DeepCopy() *PreviewGroupList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PreviewGroupList.

func (*PreviewGroupList) DeepCopyInto

func (in *PreviewGroupList) DeepCopyInto(out *PreviewGroupList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PreviewGroupList) DeepCopyObject

func (in *PreviewGroupList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PreviewGroupPhase

type PreviewGroupPhase string

PreviewGroupPhase represents the lifecycle state of a PreviewGroup.

const (
	// PreviewGroupPhasePending indicates the preview group has been created but deployment hasn't started.
	PreviewGroupPhasePending PreviewGroupPhase = "Pending"
	// PreviewGroupPhaseDeploying indicates one or more services in the group are currently deploying.
	PreviewGroupPhaseDeploying PreviewGroupPhase = "Deploying"
	// PreviewGroupPhaseRunning indicates all services in the group are deployed and running successfully.
	PreviewGroupPhaseRunning PreviewGroupPhase = "Running"
	// PreviewGroupPhaseDegraded indicates the group is mostly running but one or more services are failing.
	PreviewGroupPhaseDegraded PreviewGroupPhase = "Degraded"
	// PreviewGroupPhaseFailed indicates the deployment of the preview group has failed critically.
	PreviewGroupPhaseFailed PreviewGroupPhase = "Failed"
	// PreviewGroupPhaseTerminating indicates the preview group is currently being torn down and deleted.
	PreviewGroupPhaseTerminating PreviewGroupPhase = "Terminating"
	// PreviewGroupPhaseAbandoned indicates the preview group was abandoned or orphaned by its creator.
	PreviewGroupPhaseAbandoned PreviewGroupPhase = "Abandoned"
)

type PreviewGroupRouting

type PreviewGroupRouting struct {
	// Mode is the routing mode.
	// +kubebuilder:validation:Enum=header;subdomain
	// +kubebuilder:default=header
	// +optional
	Mode string `json:"mode,omitempty"`

	// HeaderKey is the HTTP header key used for routing.
	// Defaults to "x-preview-env".
	// +kubebuilder:default="x-preview-env"
	// +optional
	HeaderKey string `json:"headerKey,omitempty"`

	// HeaderValue is the value that identifies this preview group.
	// Typically set to the MR number (e.g. "42") or branch name.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	HeaderValue string `json:"headerValue"`

	// ExternalURL is an optional shareable URL for non-engineer access
	// (e.g. "https://mr-42.preview.dev.azra-ai.com").
	// +optional
	ExternalURL string `json:"externalUrl,omitempty"`

	// BaseDomain is the base domain for subdomain routing.
	// +optional
	BaseDomain string `json:"baseDomain,omitempty"`
}

PreviewGroupRouting configures how traffic reaches preview services.

func (*PreviewGroupRouting) DeepCopy

func (in *PreviewGroupRouting) DeepCopy() *PreviewGroupRouting

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PreviewGroupRouting.

func (*PreviewGroupRouting) DeepCopyInto

func (in *PreviewGroupRouting) DeepCopyInto(out *PreviewGroupRouting)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PreviewGroupServiceSpec

type PreviewGroupServiceSpec struct {
	// Name of the Kubernetes Service to preview. Must match an existing Service.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	Name string `json:"name"`

	// Image is the container image to deploy for mode=image.
	// Required when mode is "image", ignored for "local" and "baseline".
	// +optional
	Image string `json:"image,omitempty"`

	// Mode defines how this service participates in the preview group.
	// +kubebuilder:validation:Enum=image;local;baseline
	// +kubebuilder:default=image
	// +optional
	Mode ServiceMode `json:"mode,omitempty"`

	// Endpoint is the external endpoint for mode=local
	// (e.g. "100.64.23.42:8080" for a developer's Tailscale IP).
	// Required when mode is "local", ignored otherwise.
	// +optional
	Endpoint string `json:"endpoint,omitempty"`

	// Namespace is the Kubernetes namespace where the service will be deployed. Required. If omitted, falls back to the controller's default namespace.
	// +optional
	Namespace string `json:"namespace,omitempty"`

	// Port is the container port. Auto-discovered from existing Service if 0.
	// +optional
	Port int32 `json:"port,omitempty"`

	// ParentRef is the Gateway API parentRef name (e.g. the Istio waypoint proxy
	// or a gateway). Auto-discovered if empty.
	// +optional
	ParentRef string `json:"parentRef,omitempty"`

	// PathPrefix scopes HTTPRoute matching to a specific path prefix
	// (e.g. "/api/payments") to avoid shadowing the baseline service.
	// Auto-discovered if empty.
	// +kubebuilder:validation:Pattern=`^/.*$`
	// +optional
	PathPrefix string `json:"pathPrefix,omitempty"`

	// Protocol determines whether to generate an HTTPRoute or GRPCRoute.
	// +kubebuilder:validation:Enum=http;grpc
	// +kubebuilder:default=http
	// +optional
	Protocol ServiceProtocol `json:"protocol,omitempty"`

	// AsyncRoutes defines async routing targets to provision for this service.
	// +optional
	AsyncRoutes []AsyncRouteSpec `json:"asyncRoutes,omitempty"`

	// ImagePullPolicy overrides the container image pull policy.
	// +kubebuilder:validation:Enum=Always;Never;IfNotPresent
	// +optional
	ImagePullPolicy string `json:"imagePullPolicy,omitempty"`

	// Env specifies additional environment variables for the preview pod.
	// +optional
	Env []EnvVar `json:"env,omitempty"`

	// Resources overrides the baseline resource requests/limits for preview pods.
	// If unset, the controller defaults to conservative values (100m CPU, 256Mi RAM).
	// +optional
	Resources *ResourceOverride `json:"resources,omitempty"`

	// Database overrides the group-level database configuration for this service.
	// +optional
	Database *EnvironmentDatabase `json:"database,omitempty"`

	// PostDeploy configures a generic post-deployment Job hook for this service.
	// +optional
	PostDeploy *PostDeploySpec `json:"postDeploy,omitempty"`

	// KEDA configures per-service autoscaling and scale-to-zero settings.
	// Overrides controller-level CLI flags when set.
	// +optional
	KEDA *KEDASpec `json:"keda,omitempty"`
}

PreviewGroupServiceSpec defines a single service in a preview group. Only Name is required; Port, ParentRef, and PathPrefix are auto-discovered from existing Kubernetes Services if omitted.

func (*PreviewGroupServiceSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PreviewGroupServiceSpec.

func (*PreviewGroupServiceSpec) DeepCopyInto

func (in *PreviewGroupServiceSpec) DeepCopyInto(out *PreviewGroupServiceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PreviewGroupServiceStatus

type PreviewGroupServiceStatus struct {
	// Name is the service name.
	Name string `json:"name"`

	// EnvironmentName is the name of the child Environment CR created for this service.
	EnvironmentName string `json:"environmentName,omitempty"`

	// Namespace is where the preview pod is deployed.
	Namespace string `json:"namespace,omitempty"`

	// Phase is the current lifecycle phase of this service's preview.
	Phase EnvironmentPhase `json:"phase,omitempty"`

	// URL is the reachable URL for this service's preview.
	URL string `json:"url,omitempty"`

	// Message is a human-readable status message.
	Message string `json:"message,omitempty"`

	// Reason is a machine-readable failure reason
	// (e.g. "CrashLoopBackOff", "ImagePullBackOff", "OOMKilled").
	Reason string `json:"reason,omitempty"`

	// LastLogSnippet contains the last few lines from the preview pod's
	// container logs, enabling quick debugging from the MR comment.
	LastLogSnippet string `json:"lastLogSnippet,omitempty"`

	// ChangedServices lists the services that were modified in this preview,
	// sourced from the child Environment's spec.deploy.changedServices.
	ChangedServices []string `json:"changedServices,omitempty"`
}

PreviewGroupServiceStatus reports the current state of a single service within a PreviewGroup.

func (*PreviewGroupServiceStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PreviewGroupServiceStatus.

func (*PreviewGroupServiceStatus) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PreviewGroupSpec

type PreviewGroupSpec struct {
	// Source identifies the SCM context (GitLab MR, GitHub PR, etc.)
	// +kubebuilder:validation:Required
	Source EnvironmentSource `json:"source"`

	// Routing configures header-based traffic routing shared by all services.
	// +kubebuilder:validation:Required
	Routing PreviewGroupRouting `json:"routing"`

	// Services defines the services included in this preview group.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinItems=1
	Services []PreviewGroupServiceSpec `json:"services"`

	// Database provides group-level database configuration.
	// Individual services can override this in their own database field.
	// +optional
	Database *EnvironmentDatabase `json:"database,omitempty"`

	// Lifecycle configures TTL and automatic cleanup.
	// +optional
	Lifecycle *PreviewGroupLifecycle `json:"lifecycle,omitempty"`

	// Owner is the username of the developer who created this PreviewGroup.
	// Used for collision detection and audit.
	Owner string `json:"owner,omitempty"`

	// TopologyOverrides provides inline service dependency edges for environments
	// created via CI/CD or webhooks where .diverge.yaml is not accessible.
	// These override auto-discovered edges from Gateway API and Prometheus.
	// +optional
	TopologyOverrides []TopologyEdge `json:"topologyOverrides,omitempty"`
}

PreviewGroupSpec defines the desired state of a PreviewGroup.

func (*PreviewGroupSpec) DeepCopy

func (in *PreviewGroupSpec) DeepCopy() *PreviewGroupSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PreviewGroupSpec.

func (*PreviewGroupSpec) DeepCopyInto

func (in *PreviewGroupSpec) DeepCopyInto(out *PreviewGroupSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PreviewGroupStatus

type PreviewGroupStatus struct {
	// Phase is the aggregated phase across all services.
	// +kubebuilder:validation:Enum=Pending;Deploying;Running;Degraded;Failed;Terminating
	Phase PreviewGroupPhase `json:"phase,omitempty"`

	// ServiceCount is the total number of services in the group.
	ServiceCount int32 `json:"serviceCount,omitempty"`

	// Services contains per-service status.
	// +optional
	Services []PreviewGroupServiceStatus `json:"services,omitempty"`

	// ObservedGeneration is the last observed generation of the spec.
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// CreatedAt is when the preview group was first created.
	CreatedAt *metav1.Time `json:"createdAt,omitempty"`

	// ExpiresAt is when the preview group will expire (from TTL).
	ExpiresAt *metav1.Time `json:"expiresAt,omitempty"`

	// Conditions represent the latest available observations of the
	// PreviewGroup's state. Includes "Ready" and "Degraded" conditions.
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// CommentID is the ID of the comment tracking the preview group status.
	// +optional
	CommentID int64 `json:"commentID,omitempty"`

	// LeaseRenewedAt is the last time the owning CLI heartbeat renewed the lease.
	LeaseRenewedAt *metav1.Time `json:"leaseRenewedAt,omitempty"`

	// DiscoveredIngressPaths contains the resolved ingress routing paths
	// from gateway entrypoints to the changed services in this group.
	// Populated by the topology discovery engine during environment creation.
	// +optional
	DiscoveredIngressPaths []DiscoveredIngressPath `json:"discoveredIngressPaths,omitempty"`

	// GraphSource describes where the topology graph was discovered from
	// (e.g. "gateway-api+prometheus+static").
	// +optional
	GraphSource string `json:"graphSource,omitempty"`
}

PreviewGroupStatus describes the observed state of a PreviewGroup.

func (*PreviewGroupStatus) DeepCopy

func (in *PreviewGroupStatus) DeepCopy() *PreviewGroupStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PreviewGroupStatus.

func (*PreviewGroupStatus) DeepCopyInto

func (in *PreviewGroupStatus) DeepCopyInto(out *PreviewGroupStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceOverride

type ResourceOverride struct {
	// CPURequest is the CPU request for the preview pod (e.g. "100m").
	// +optional
	CPURequest string `json:"cpuRequest,omitempty"`
	// MemoryRequest is the memory request for the preview pod (e.g. "256Mi").
	// +optional
	MemoryRequest string `json:"memoryRequest,omitempty"`
	// CPULimit is the CPU limit for the preview pod.
	// +optional
	CPULimit string `json:"cpuLimit,omitempty"`
	// MemoryLimit is the memory limit for the preview pod.
	// +optional
	MemoryLimit string `json:"memoryLimit,omitempty"`
}

ResourceOverride allows preview pods to use fewer resources than baseline.

func (*ResourceOverride) DeepCopy

func (in *ResourceOverride) DeepCopy() *ResourceOverride

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceOverride.

func (*ResourceOverride) DeepCopyInto

func (in *ResourceOverride) DeepCopyInto(out *ResourceOverride)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SecretRef

type SecretRef struct {
	// Namespace is the namespace of the Secret.
	Namespace string `json:"namespace,omitempty"`
	// Name is the name of the Secret.
	Name string `json:"name,omitempty"`
	// Key is the specific key in the Secret to reference.
	Key string `json:"key,omitempty"`
}

SecretRef references a specific key within a Kubernetes Secret.

func (*SecretRef) DeepCopy

func (in *SecretRef) DeepCopy() *SecretRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretRef.

func (*SecretRef) DeepCopyInto

func (in *SecretRef) DeepCopyInto(out *SecretRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ServiceMode

type ServiceMode string

ServiceMode defines how a service participates in a preview group.

const (
	// ServiceModeImage deploys a container image as a preview pod (default).
	ServiceModeImage ServiceMode = "image"
	// ServiceModeLocal routes traffic to an external endpoint (e.g. developer's Tailscale IP)
	// instead of deploying a pod. Enables hot-reload local dev with cloud baselines.
	ServiceModeLocal ServiceMode = "local"
	// ServiceModeBaseline includes the existing baseline service in group routing
	// without deploying a new version.
	ServiceModeBaseline ServiceMode = "baseline"
)

type ServicePreviewConfig

type ServicePreviewConfig struct {
	// ServiceName is the Kubernetes Service name to shadow.
	ServiceName string `json:"serviceName"`
	// Namespace is the namespace where the baseline service runs.
	Namespace string `json:"namespace,omitempty"`
	// Port is the container port the service listens on.
	Port int32 `json:"port"`
	// Image is the container image for the preview pod (set by CI).
	Image string `json:"image"`
	// ImagePullPolicy overrides the container image pull policy.
	// Valid values: Always, Never, IfNotPresent. Defaults to IfNotPresent.
	ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
	// DatabaseEnvKey is the environment variable name for the database connection URL.
	// Defaults to DATABASE_URL.
	DatabaseEnvKey string `json:"databaseEnvKey,omitempty"`
	// ParentRef is the Gateway API parentRef name (e.g., Istio Waypoint proxy).
	// If empty, defaults to "diverge-gateway".
	ParentRef string `json:"parentRef,omitempty"`
	// HeaderKey overrides the routing header key.
	HeaderKey string `json:"headerKey,omitempty"`
	// PathPrefix scopes HTTPRoute matching to a specific path prefix (e.g., "/api/payments") to avoid shadowing the baseline.
	// +kubebuilder:validation:Pattern=`^/.*$`
	// +optional
	PathPrefix string `json:"pathPrefix,omitempty"`
	// Env is additional environment variables for the preview container.
	Env []EnvVar `json:"env,omitempty"`
	// Protocol specifies the service protocol for routing (http or grpc).
	// When set to "grpc", the router generates a GRPCRoute instead of HTTPRoute.
	// +kubebuilder:validation:Enum=http;grpc
	// +kubebuilder:default=http
	// +optional
	Protocol string `json:"protocol,omitempty"`
	// Endpoint is the external endpoint for mode=local (e.g. Tailscale IP:port).
	// +optional
	Endpoint string `json:"endpoint,omitempty"`
	// Resources overrides the resource requests/limits for the preview pod.
	// +optional
	Resources *ResourceOverride `json:"resources,omitempty"`
	// KEDA configures per-service autoscaling. Overrides controller CLI flags.
	// +optional
	KEDA *KEDASpec `json:"keda,omitempty"`
	// WebSocket configures WebSocket proxy support.
	// +optional
	WebSocket *WebSocketSpec `json:"websocket,omitempty"`
}

ServicePreviewConfig defines how preview pods are deployed for multi-repo services, read from the .diverge.yaml file in the service repository.

func (*ServicePreviewConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServicePreviewConfig.

func (*ServicePreviewConfig) DeepCopyInto

func (in *ServicePreviewConfig) DeepCopyInto(out *ServicePreviewConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ServiceProtocol

type ServiceProtocol string

ServiceProtocol defines the transport protocol for a service.

const (
	// ServiceProtocolHTTP is standard HTTP/1.1 or HTTP/2 (including ConnectRPC).
	// Generates HTTPRoute for Gateway API routing.
	ServiceProtocolHTTP ServiceProtocol = "http"
	// ServiceProtocolGRPC is raw gRPC over HTTP/2.
	// Generates GRPCRoute instead of HTTPRoute for Gateway API routing.
	ServiceProtocolGRPC ServiceProtocol = "grpc"
)

type TestState

type TestState string

TestState represents the current state of a test run.

const (
	// TestStatePending indicates the test run is queued or starting.
	TestStatePending TestState = "pending"
	// TestStateRunning indicates the test run is currently executing.
	TestStateRunning TestState = "running"
	// TestStatePassed indicates the test run completed successfully.
	TestStatePassed TestState = "passed"
	// TestStateFailed indicates the test run completed with errors or test failures.
	TestStateFailed TestState = "failed"
	// TestStateTimedOut indicates the test run did not complete within the configured timeout.
	TestStateTimedOut TestState = "timed-out"
)

type TestStatus

type TestStatus struct {
	State       TestState    `json:"state,omitempty"`
	Summary     string       `json:"summary,omitempty"`
	URL         string       `json:"url,omitempty"`
	RunID       string       `json:"runID,omitempty"`
	StartedAt   *metav1.Time `json:"startedAt,omitempty"`
	CompletedAt *metav1.Time `json:"completedAt,omitempty"`
}

TestStatus represents the observed state of a test run.

func (*TestStatus) DeepCopy

func (in *TestStatus) DeepCopy() *TestStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestStatus.

func (*TestStatus) DeepCopyInto

func (in *TestStatus) DeepCopyInto(out *TestStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TestTriggerSpec

type TestTriggerSpec struct {
	// +kubebuilder:validation:Enum=gitlab-pipeline;github-dispatch;webhook
	Type TestTriggerType `json:"type"`
	// Project is the CI project to trigger (e.g., "team/e2e-tests").
	// Used by gitlab-pipeline and github-dispatch triggers.
	Project string `json:"project,omitempty"`
	// Ref is the git ref to trigger tests against (e.g., "main").
	Ref string `json:"ref,omitempty"`
	// EventType is the GitHub repository dispatch event type.
	// Used by github-dispatch trigger only.
	EventType string `json:"eventType,omitempty"`
	// Workflow is the GitHub Actions workflow file name to filter by.
	Workflow string `json:"workflow,omitempty"`
	// WebhookURL is the URL to POST to for webhook triggers.
	WebhookURL string `json:"webhookURL,omitempty"`
	// SecretRef references a Kubernetes Secret containing the trigger token.
	SecretRef string `json:"secretRef,omitempty"`
}

TestTriggerSpec defines how to trigger a test run.

func (*TestTriggerSpec) DeepCopy

func (in *TestTriggerSpec) DeepCopy() *TestTriggerSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTriggerSpec.

func (*TestTriggerSpec) DeepCopyInto

func (in *TestTriggerSpec) DeepCopyInto(out *TestTriggerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TestTriggerType

type TestTriggerType string

TestTriggerType defines how tests are triggered.

const (
	// TestTriggerGitLabPipeline triggers an external GitLab pipeline to run tests.
	TestTriggerGitLabPipeline TestTriggerType = "gitlab-pipeline"
	// TestTriggerGitHubDispatch triggers a GitHub repository dispatch event to run tests.
	TestTriggerGitHubDispatch TestTriggerType = "github-dispatch"
	// TestTriggerWebhook POSTs to an external webhook URL to run tests.
	TestTriggerWebhook TestTriggerType = "webhook"
)

type TestingSpec

type TestingSpec struct {
	// Enabled controls whether tests are triggered for this environment.
	Enabled bool `json:"enabled,omitempty"`
	// Trigger defines how tests are triggered.
	Trigger TestTriggerSpec `json:"trigger"`
	// Timeout is how long to wait for test results before timing out.
	// +optional
	Timeout *metav1.Duration `json:"timeout,omitempty"`
	// Required controls whether test results block the diverge/tests commit status.
	Required bool `json:"required,omitempty"`
}

TestingSpec defines the test integration configuration.

func (*TestingSpec) DeepCopy

func (in *TestingSpec) DeepCopy() *TestingSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestingSpec.

func (*TestingSpec) DeepCopyInto

func (in *TestingSpec) DeepCopyInto(out *TestingSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TopologyEdge added in v0.8.0

type TopologyEdge struct {
	// From is the source service name (the caller).
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	From string `json:"from"`

	// To is the target service name (the callee).
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	To string `json:"to"`

	// Protocol is the communication protocol (http, grpc, async).
	// +kubebuilder:validation:Enum=http;grpc;async
	// +kubebuilder:default=http
	Protocol string `json:"protocol,omitempty"`

	// Suppress removes this edge from the auto-discovered graph (tombstone).
	// Use to correct false-positive edges from Prometheus metrics.
	// +optional
	Suppress bool `json:"suppress,omitempty"`
}

TopologyEdge represents a directed dependency between two services.

func (*TopologyEdge) DeepCopy added in v0.8.0

func (in *TopologyEdge) DeepCopy() *TopologyEdge

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopologyEdge.

func (*TopologyEdge) DeepCopyInto added in v0.8.0

func (in *TopologyEdge) DeepCopyInto(out *TopologyEdge)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WebSocketSpec added in v0.4.0

type WebSocketSpec struct {
	// Enabled turns on WebSocket proxy support for the service route.
	Enabled bool `json:"enabled,omitempty"`
	// Path is the URL path prefix to match for WebSocket connections (e.g., "/ws").
	// +kubebuilder:validation:Pattern=`^/.*$`
	Path string `json:"path,omitempty"`
	// Timeout sets the maximum duration for the WebSocket connection.
	// Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
	// +kubebuilder:validation:Pattern=`^([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$`
	Timeout string `json:"timeout,omitempty"`
}

WebSocketSpec defines WebSocket proxy configuration.

func (*WebSocketSpec) DeepCopy added in v0.4.0

func (in *WebSocketSpec) DeepCopy() *WebSocketSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebSocketSpec.

func (*WebSocketSpec) DeepCopyInto added in v0.4.0

func (in *WebSocketSpec) DeepCopyInto(out *WebSocketSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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