schema

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package schema defines all config types representing the processed quartz.yaml

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultApplicationEnvironments

func DefaultApplicationEnvironments() map[string]ApplicationEnvironmentConfig

DefaultApplicationEnvironments returns the default application environments.

Types

type AlertsConfig

type AlertsConfig struct {
	Subscriptions []AlertsSubscriptionsConfig `koanf:"subscriptions"` // A list of alert subscriptions.
}

AlertsConfig represents the configuration for alerts.

type AlertsSubscriptionsConfig

type AlertsSubscriptionsConfig struct {
	Protocol string `koanf:"protocol"` // The protocol used for the subscription (e.g., "email", "sms").
	Endpoint string `koanf:"endpoint"` // The endpoint for the subscription (e.g., email address or phone number).
}

AlertsSubscriptionsConfig represents the configuration for an individual alert subscription.

type ApplicationCallbackConfig

type ApplicationCallbackConfig struct {
	Url  string `koanf:"url"`
	Path string `koanf:"path"`
}

ApplicationCallbackConfig represents the callback configuration for an application.

type ApplicationDbConfig

type ApplicationDbConfig struct {
	Enabled  bool   `koanf:"enabled"`
	Admin    bool   `koanf:"admin"`
	Username string `koanf:"username"`
	DbName   string `koanf:"db_name"`
}

ApplicationDbConfig represents the database configuration for an application.

type ApplicationEnvironmentConfig

type ApplicationEnvironmentConfig struct {
	Name                string                          `koanf:"name"`
	Description         string                          `koanf:"description"`
	Next                string                          `koanf:"next"`
	Type                string                          `koanf:"type"`
	RegistrationAllowed bool                            `koanf:"registration_allowed"`
	CustomThemeEnabled  bool                            `koanf:"custom_theme_enabled"`
	Otp                 ApplicationEnvironmentOtpConfig `koanf:"otp"`
	Enabled             bool                            `koanf:"enabled"`
	Keycloak            map[string]interface{}          `koanf:"keycloak"`
}

ApplicationEnvironmentConfig represents the configuration for an application environment.

func NewApplicationEnvironmentConfig

func NewApplicationEnvironmentConfig(name string, desc string, next string) ApplicationEnvironmentConfig

NewApplicationEnvironmentConfig creates a new ApplicationEnvironmentConfig with default values.

type ApplicationEnvironmentOtpConfig

type ApplicationEnvironmentOtpConfig struct {
	Enabled  bool `koanf:"enabled"`
	Required bool `koanf:"required"`
}

type ApplicationLookupConfig

type ApplicationLookupConfig struct {
	Enabled          bool                               `koanf:"enabled"`
	AdminCredentials ApplicationLookupCredentialsConfig `koanf:"admin_credentials"`
	Ingress          ApplicationLookupIngressConfig     `koanf:"ingress"`
}

ApplicationLookupConfig represents the configuration for looking up application resources.

func NewApplicationLookupConfig

func NewApplicationLookupConfig(ns string, adminSecret string, adminUsername string, adminUsernameKey string, adminPasswordKey string, ingressName string) ApplicationLookupConfig

type ApplicationLookupCredentialsConfig

type ApplicationLookupCredentialsConfig struct {
	Username string                                   `koanf:"username"`
	Secret   ApplicationLookupCredentialsSecretConfig `koanf:"secret"`
}

type ApplicationLookupCredentialsSecretConfig

type ApplicationLookupCredentialsSecretConfig struct {
	Name        string `koanf:"name"`
	Namespace   string `koanf:"namespace"`
	UsernameKey string `koanf:"username_key"`
	PasswordKey string `koanf:"password_key"`
}

type ApplicationLookupIngressConfig

type ApplicationLookupIngressConfig struct {
	Name      string `koanf:"name"`
	Namespace string `koanf:"namespace"`
	Kind      string `koanf:"kind"`
	Group     string `koanf:"group"`
	Version   string `koanf:"version"`
}

type ApplicationRepositoryConfig

type ApplicationRepositoryConfig struct {
	Name         string                      `koanf:"repo"`
	RepoUrl      string                      `koanf:"repo_url"`
	Provider     string                      `koanf:"provider"`
	Organization string                      `koanf:"organization"`
	Branch       string                      `koanf:"branch"`
	Type         string                      `koanf:"type"`
	Db           ApplicationDbConfig         `koanf:"db"`
	BaseUrl      string                      `koanf:"base_url"`
	CallbackUrls []ApplicationCallbackConfig `koanf:"callback_urls"`
	Keycloak     map[string]interface{}      `koanf:"keycloak"`

	// Cloud specific and other schema-less settings for the app
	Settings map[string]interface{} `koanf:"settings"`
}

ApplicationRepositoryConfig represents the configuration for an application repository.

func (ApplicationRepositoryConfig) RepositoryConfig

func (c ApplicationRepositoryConfig) RepositoryConfig() RepositoryConfig

RepositoryConfig converts an ApplicationRepositoryConfig to a RepositoryConfig.

type AuthConfig

type AuthConfig struct {
	ServiceAccount AuthServiceAccountConfig   `koanf:"service_account"` // Configuration for the service account.
	Users          map[string]AuthUserConfig  `koanf:"users"`           // Configuration for individual users.
	Groups         map[string]AuthGroupConfig `koanf:"groups"`          // Configuration for user groups.
}

AuthConfig represents the authentication configuration, including service accounts, users, and groups.

func DefaultAuthConfig

func DefaultAuthConfig() AuthConfig

DefaultAuthConfig returns the default authentication configuration.

type AuthGroupConfig

type AuthGroupConfig struct {
	Disabled     bool     `koanf:"disabled"`     // Indicates if the group is disabled.
	Roles        []string `koanf:"roles"`        // The roles assigned to the group.
	Environments []string `koanf:"environments"` // The environments the group has access to.
}

AuthGroupConfig represents the configuration for a user group.

type AuthServiceAccountConfig

type AuthServiceAccountConfig struct {
	Enabled           bool   `koanf:"enabled"`            // Indicates if the service account is enabled.
	Name              string `koanf:"name"`               // The name of the service account.
	Namespace         string `koanf:"namespace"`          // The namespace of the service account.
	ExpirationSeconds int64  `koanf:"expiration_seconds"` // The expiration time for the service account token in seconds.
}

AuthServiceAccountConfig represents the configuration for a Kubernetes service account.

type AuthUserConfig

type AuthUserConfig struct {
	Disabled     bool                   `koanf:"disabled"`      // Indicates if the user is disabled.
	FirstName    string                 `koanf:"first_name"`    // The first name of the user.
	LastName     string                 `koanf:"last_name"`     // The last name of the user.
	EmailAddress string                 `koanf:"email_address"` // The email address of the user.
	Password     AuthUserPasswordConfig `koanf:"password"`      // The password configuration for the user.
	Groups       []string               `koanf:"groups"`        // The groups the user belongs to.
	Environments []string               `koanf:"environments"`  // The environments the user has access to.
	Test         bool                   `koanf:"test"`          // Indicates if the user is a test user.
	Count        int                    `koanf:"count"`         // The number of users to create (for bulk creation).
}

AuthUserConfig represents the configuration for an individual user.

type AuthUserPasswordConfig

type AuthUserPasswordConfig struct {
	Temporary bool   `koanf:"temporary"` // Indicates if the password is temporary.
	Value     string `koanf:"value"`     // The value of the password.
}

AuthUserPasswordConfig represents the configuration for a user's password.

type AwsConfig

type AwsConfig struct {
	Region string `koanf:"region"` // The AWS region to use.
}

AwsConfig represents the configuration for AWS in Quartz.

type ChartConfig

type ChartConfig struct {
	Path string `koanf:"path"` // The path to the Helm chart.
}

ChartConfig represents the configuration for a Helm chart.

type CloudflareCredentials

type CloudflareCredentials struct {
	AccountId string `koanf:"account_id"` // The Cloudflare account ID.
	ApiToken  string `koanf:"api_token"`  // The API token for Cloudflare.
	Email     string `koanf:"email"`      // The email associated with the Cloudflare account.
}

CloudflareCredentials represents the credentials for accessing Cloudflare.

type DnsConfig

type DnsConfig struct {
	Zone   string `koanf:"zone"`   // The DNS zone.
	Domain string `koanf:"domain"` // The DNS domain.
}

DnsConfig represents the configuration for DNS in Quartz.

type ExportConfig

type ExportConfig struct {
	Path        string               `koanf:"path"`
	Annotations map[string]string    `koanf:"annotations"`
	Objects     []ExportObjectConfig `koanf:"objects"`
}

ExportConfig represents the configuration for exporting resources in Quartz.

func NewExportConfig

func NewExportConfig() ExportConfig

NewExportConfig returns a new ExportConfig instance with default values.

type ExportObjectConfig

type ExportObjectConfig struct {
	Kind      string `koanf:"kind"`
	Name      string `koanf:"name"`
	Namespace string `koanf:"namespace"`
}

ExportObjectConfig represents the configuration for an individual object to export.

type GithubConfig

type GithubConfig struct {
	TagReleaseEnabled bool           `koanf:"tag_release"`
	Webhooks          GithubWebhooks `koanf:"webhooks"`
	Organization      string         `koanf:"organization"`
}

GithubConfig represents the configuration for GitHub integration.

func NewGithubConfig

func NewGithubConfig() GithubConfig

NewGithubConfig returns a new GithubConfig instance with default values.

type GithubCredentials

type GithubCredentials struct {
	Username string `koanf:"username"`
	Token    string `koanf:"token"`
}

GithubCredentials represents the credentials for accessing GitHub.

type GithubWebhooks

type GithubWebhooks struct {
	Build   bool `koanf:"build"`
	Release bool `koanf:"release"`
}

GithubWebhooks represents the configuration for GitHub webhooks.

type GitopsConfig

type GitopsConfig struct {
	Core RepositoryConfig `koanf:"core"`
	Apps RepositoryConfig `koanf:"apps"`
}

GitopsConfig represents the configuration for GitOps in Quartz.

func DefaultGitopsConfig

func DefaultGitopsConfig(p string) GitopsConfig

DefaultGitopsConfig returns a new GitopsConfig instance with default values.

type InfrastructureApplicationConfig

type InfrastructureApplicationConfig struct {
	Disabled                   bool                              `koanf:"disabled"`
	Description                string                            `koanf:"description"`
	BaseUrl                    string                            `koanf:"base_url"`
	CallbackUrls               []ApplicationCallbackConfig       `koanf:"callback_urls"`
	Db                         InfrastructureApplicationDbConfig `koanf:"db"`
	DefaultPath                string                            `koanf:"default_path"`
	Scopes                     []string                          `koanf:"scopes"`
	AccessTokenLifespanSeconds int                               `koanf:"access_token_lifespan_seconds"`
	Keycloak                   map[string]interface{}            `koanf:"keycloak"`
	Lookup                     ApplicationLookupConfig           `koanf:"lookup"`
}

InfrastructureApplicationConfig represents the configuration for an infrastructure application.

type InfrastructureApplicationDbConfig

type InfrastructureApplicationDbConfig struct {
	Enabled  bool   `koanf:"enabled"`
	Admin    bool   `koanf:"admin"`
	Username string `koanf:"username"`
	DbName   string `koanf:"db_name"`
}

type InfrastructureEnvironmentConfig

type InfrastructureEnvironmentConfig struct {
	Name                string                                     `koanf:"name"`
	Description         string                                     `koanf:"description"`
	Type                string                                     `koanf:"type"`
	RegistrationAllowed bool                                       `koanf:"registration_allowed"`
	CustomThemeEnabled  bool                                       `koanf:"custom_theme_enabled"`
	Otp                 ApplicationEnvironmentOtpConfig            `koanf:"otp"`
	Applications        map[string]InfrastructureApplicationConfig `koanf:"applications"`
}

InfrastructureEnvironmentConfig represents the configuration for an infrastructure environment.

func NewInfrastructureEnvironmentConfig

func NewInfrastructureEnvironmentConfig(name string, desc string) InfrastructureEnvironmentConfig

NewInfrastructureEnvironmentConfig creates a new InfrastructureEnvironmentConfig with default values.

type InstallerConfig

type InstallerConfig struct {
	Summary InstallerSummaryConfig `koanf:"summary"`
}

InstallerConfig represents the configuration for the installer.

type InstallerSummaryConfig

type InstallerSummaryConfig struct {
	Enabled bool `koanf:"enabled"`
}

InstallerSummaryConfig represents the configuration for the installer summary.

type InternalConfig

type InternalConfig struct {
	Installer InstallerConfig `koanf:"installer"`
}

InternalConfig exposes options to customize features not yet or ever intended for common usage.

func NewInternalConfig

func NewInternalConfig() InternalConfig

NewInternalConfig returns a new InternalConfig instance with default values.

type IronbankCredentials

type IronbankCredentials struct {
	Username string `koanf:"username"`
	Password string `koanf:"password"`
	Email    string `koanf:"email"`
}

IronbankCredentials represents the credentials for accessing Ironbank.

type Kubeconfig

type Kubeconfig struct {
	ApiVersion     string              `koanf:"apiVersion"`
	Kind           string              `koanf:"kind"`
	CurrentContext string              `koanf:"current-context"`
	Preferences    interface{}         `koanf:"preferences"`
	Clusters       []KubeconfigCluster `koanf:"clusters"`
	Contexts       []KubeconfigContext `koanf:"contexts"`
	Users          []KubeconfigUser    `koanf:"users"`
}

Kubeconfig represents the structure of a Kubernetes kubeconfig file.

type KubeconfigCluster

type KubeconfigCluster struct {
	Name    string                `koanf:"name"`
	Cluster KubeconfigClusterInfo `koanf:"cluster"`
}

KubeconfigCluster represents a cluster entry in a kubeconfig file.

type KubeconfigClusterInfo

type KubeconfigClusterInfo struct {
	Server                   string `koanf:"server"`
	CertificateAuthorityData string `koanf:"certificate-authority-data"`
}

type KubeconfigContext

type KubeconfigContext struct {
	Name    string                `koanf:"name"`
	Context KubeconfigContextInfo `koanf:"context"`
}

KubeconfigContext represents a context entry in a kubeconfig file.

type KubeconfigContextInfo

type KubeconfigContextInfo struct {
	Cluster string `koanf:"cluster"`
	User    string `koanf:"user"`
}

type KubeconfigUser

type KubeconfigUser struct {
	Name string             `koanf:"name"`
	User KubeconfigUserInfo `koanf:"user"`
}

KubeconfigUser represents a user entry in a kubeconfig file.

type KubeconfigUserExec

type KubeconfigUserExec struct {
	ApiVersion string   `koanf:"apiVersion"`
	Command    string   `koanf:"command"`
	Args       []string `koanf:"args"`
}

type KubeconfigUserInfo

type KubeconfigUserInfo struct {
	Token *string             `koanf:"token"`
	Exec  *KubeconfigUserExec `koanf:"exec"`
}

type KubernetesConfig

type KubernetesConfig struct {
	Version        string `koanf:"version"`
	KubeconfigPath string `koanf:"kubeconfig_path"`
}

KubernetesConfig represents the configuration for Kubernetes.

type MirrorConfig

type MirrorConfig struct {
	ImageRepository MirrorImageRepositoryConfig `koanf:"image_repository"`
	Grype           bool                        `koanf:"grype"`
}

MirrorConfig represents the configuration for mirroring resources in Quartz.

func NewMirrorConfig

func NewMirrorConfig() MirrorConfig

NewMirrorConfig returns a new MirrorConfig instance with default values.

type MirrorImageRepositoryConfig

type MirrorImageRepositoryConfig struct {
	Enabled          bool     `koanf:"enabled"`
	Target           string   `koanf:"target"`
	SourceRegistries []string `koanf:"source_registries"`
}

MirrorImageRepositoryConfig represents the configuration for mirroring image repositories.

type ProvidersConfig

type ProvidersConfig struct {
	Cloud         string `koanf:"cloud"`
	Dns           string `koanf:"dns"`
	SourceControl string `koanf:"source_control"`
	Monitoring    string `koanf:"monitoring"`
	Secrets       string `koanf:"secrets"`
	Oidc          string `koanf:"oidc"`
	CiCd          string `koanf:"cicd"`
}

ProvidersConfig represents the configuration for various providers used in Quartz.

func NewProvidersConfig

func NewProvidersConfig() ProvidersConfig

NewProvidersConfig returns a new ProvidersConfig instance with default values.

type QuartzConfig

type QuartzConfig struct {
	Name    string `koanf:"name"`
	Project string `koanf:"project"`

	Tmp   string      `koanf:"tmp"`
	Chart ChartConfig `koanf:"chart"`

	Providers ProvidersConfig `koanf:"providers"`
	Auth      AuthConfig      `koanf:"auth"`
	Dns       DnsConfig       `koanf:"dns"`

	Aws    AwsConfig    `koanf:"aws"`
	Github GithubConfig `koanf:"github"`

	Core         InfrastructureEnvironmentConfig         `koanf:"core"`
	Environments map[string]ApplicationEnvironmentConfig `koanf:"environments"`
	Alerts       AlertsConfig                            `koanf:"alerts"`

	Kubernetes KubernetesConfig `koanf:"kubernetes"`
	Terraform  TerraformConfig  `koanf:"terraform"`

	StagePaths []string               `koanf:"stage_paths"`
	Stages     map[string]StageConfig `koanf:"stages"`

	Administrators []string                               `koanf:"administrators"`
	Gitops         GitopsConfig                           `koanf:"gitops"`
	Applications   map[string]ApplicationRepositoryConfig `koanf:"applications"`
	Mirror         MirrorConfig                           `koanf:"mirror"`

	Export ExportConfig `koanf:"export"`
	State  StateConfig  `koanf:"state"`

	Log log.LogOptionsConfig `koanf:"log"`

	Internal InternalConfig `koanf:"__internal__"`
}

QuartzConfig represents the root configuration struct of the Quartz framework.

func (QuartzConfig) KubeconfigPath

func (c QuartzConfig) KubeconfigPath() string

KubeconfigPath derives the expected kubeconfig path based on optional overrides in QuartzConfig.

func (*QuartzConfig) StagesOrdered

func (c *QuartzConfig) StagesOrdered() []StageConfig

StagesOrdered sorts the configured stages map and returns an ordered slice.

func (QuartzConfig) TfVarFilePath

func (c QuartzConfig) TfVarFilePath() string

TfVarFilePath derives the expected Terraform tfvars path based on optional overrides in QuartzConfig.

type QuartzSecrets

type QuartzSecrets struct {
	Ironbank   IronbankCredentials   `koanf:"ironbank"`
	Github     GithubCredentials     `koanf:"github"`
	Cloudflare CloudflareCredentials `koanf:"cloudflare"`
}

QuartzSecrets contains credentials intended to be kept isolated from the QuartzConfig to avoid unintentional exposure when serialized/logged.

type RepositoryConfig

type RepositoryConfig struct {
	Name         string `koanf:"repo"`
	RepoUrl      string `koanf:"repo_url"`
	Provider     string `koanf:"provider"`
	Organization string `koanf:"organization"`
	Branch       string `koanf:"branch"`
}

RepositoryConfig represents the configuration for a repository.

type StageChecksConfig

type StageChecksConfig struct {
	Before     []string                      `koanf:"before"`
	After      []string                      `koanf:"after"`
	Http       []StageChecksHttpConfig       `koanf:"http"`
	Kubernetes []StageChecksKubernetesConfig `koanf:"kubernetes"`
	State      []StageChecksStateConfig      `koanf:"state"`
	Order      int                           `koanf:"order"`
}

StageChecksConfig represents the configuration for checks associated with a stage.

type StageChecksHttpConfig

type StageChecksHttpConfig struct {
	Url         string                       `koanf:"url"`
	Path        string                       `koanf:"path"`
	App         string                       `koanf:"app"`
	StatusCodes []int                        `koanf:"status_codes"`
	Content     StageChecksHttpContentConfig `koanf:"content"`
	Verify      bool                         `koanf:"verify"`
	Retry       StageChecksRetryConfig       `koanf:"retry"`
}

StageChecksHttpConfig represents the configuration for HTTP-based checks in a stage.

type StageChecksHttpContentConfig

type StageChecksHttpContentConfig struct {
	Json  StageChecksHttpJsonContentConfig `koanf:"json"`
	Value string                           `koanf:"value"`
}

StageChecksHttpContentConfig represents the configuration for HTTP content checks.

type StageChecksHttpJsonContentConfig

type StageChecksHttpJsonContentConfig struct {
	// TODO: add jsonpath support
	Key string `koanf:"key"`
}

StageChecksHttpJsonContentConfig represents the configuration for JSON content checks.

type StageChecksKubernetesConfig

type StageChecksKubernetesConfig struct {
	Name      string `koanf:"name"`
	Namespace string `koanf:"namespace"`
	Kind      string `koanf:"kind"`
	State     string `koanf:"state"`
	Timeout   int    `koanf:"timeout"`
	Restart   bool   `koanf:"restart"`
	Wait      *bool  `koanf:"wait"`
}

StageChecksKubernetesConfig represents the configuration for Kubernetes-based checks in a stage.

type StageChecksRetryConfig

type StageChecksRetryConfig struct {
	Limit       int `koanf:"limit"`
	WaitSeconds int `koanf:"wait_seconds"`
}

StageChecksRetryConfig represents the retry configuration for stage checks.

type StageChecksStateConfig

type StageChecksStateConfig struct {
	Key   string                 `koanf:"key"`
	Value string                 `koanf:"value"`
	Retry StageChecksRetryConfig `koanf:"retry"`
}

StageChecksStateConfig represents the configuration for state-based checks in a stage.

type StageConfig

type StageConfig struct {
	Id           string                       `koanf:"id"`
	Description  string                       `koanf:"description"`
	Path         string                       `koanf:"path"`
	Type         string                       `koanf:"type"`         // terraform, other
	Dependencies []string                     `koanf:"dependencies"` // slice of stages that have to run before
	Disabled     bool                         `koanf:"disabled"`
	Manual       bool                         `koanf:"manual"`
	Order        int                          `koanf:"order"`
	Providers    StageProvidersConfig         `koanf:"providers"`
	OverrideVars bool                         `koanf:"override_vars"`
	Vars         map[string]StageVarsConfig   `koanf:"vars"`
	Checks       map[string]StageChecksConfig `koanf:"checks"`
	Destroy      StageDestroyConfig           `koanf:"destroy"`
	Debug        StageDebugConfig             `koanf:"debug"`
}

StageConfig represents the configuration for a single stage in the Quartz pipeline. It includes details such as dependencies, variables, and checks.

type StageDebugConfig

type StageDebugConfig struct {
	Break bool `koanf:"break"`
}

StageDebugConfig represents the debug configuration for a stage.

type StageDestroyConfig

type StageDestroyConfig struct {
	Skip    bool     `koanf:"skip"`
	Include []string `koanf:"include"`
	Exclude []string `koanf:"exclude"`
}

StageDestroyConfig represents the configuration for destroying resources in a stage.

type StageProvidersConfig

type StageProvidersConfig struct {
	Kubernetes bool `koanf:"kubernetes"`
}

StageProvidersConfig represents the configuration for providers used in a stage.

type StageVarsConfig

type StageVarsConfig struct {
	Value  string               `koanf:"value"`
	Stage  StageVarsStageConfig `koanf:"stage"`
	Env    string               `koanf:"env"`
	Config string               `koanf:"config"`
	Secret string               `koanf:"secret"`
}

StageVarsConfig represents the configuration for input variables for a stage.

type StageVarsStageConfig

type StageVarsStageConfig struct {
	Name   string `koanf:"name"`
	Output string `koanf:"output"`
}

StageVarsStageConfig represents the configuration for a variable stage.

type StateConfig

type StateConfig struct {
	Enabled            bool   `koanf:"enabled"`            // Indicates if state management is enabled.
	ConfigMapName      string `koanf:"configMapName"`      // The name of the ConfigMap used for state management.
	ConfigMapNamespace string `koanf:"configMapNamespace"` // The namespace of the ConfigMap used for state management.
}

StateConfig represents the configuration for state management in Quartz.

func NewStateConfig

func NewStateConfig() StateConfig

NewStateConfig returns a new StateConfig instance with default values.

type TerraformConfig

type TerraformConfig struct {
	Version string `koanf:"version"` // The version of Terraform to use.
}

TerraformConfig represents the configuration for Terraform.

func NewTerraformConfig

func NewTerraformConfig() TerraformConfig

NewTerraformConfig returns a new TerraformConfig instance with default values.

Jump to

Keyboard shortcuts

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