Help us shape the future of Go! Take the 2026 Go Developer Survey

settings

package
v0.51.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	PACApplicationNameDefaultValue = "Pipelines as Code CI"

	HubURLKey                  = "hub-url"
	HubCatalogNameKey          = "hub-catalog-name"
	ArtifactHubURLDefaultValue = "https://artifacthub.io"

	CustomConsoleNameKey         = "custom-console-name"
	CustomConsoleURLKey          = "custom-console-url"
	CustomConsolePRDetailKey     = "custom-console-url-pr-details"
	CustomConsolePRTaskLogKey    = "custom-console-url-pr-tasklog"
	CustomConsoleNamespaceURLKey = "custom-console-url-namespace"

	SecretGhAppTokenRepoScopedKey = "secret-github-app-token-scoped" //nolint: gosec

	// TrustedProviderHostnamesKey is the ConfigMap key holding the comma
	// separated list of hosted VCS hostnames this controller is allowed to send
	// credentials to.
	TrustedProviderHostnamesKey = "trusted-provider-hostnames"

	// DefaultAPIRetryMaxAttempts is the fallback number of attempts (initial
	// request included) used when api-retry-max-attempts is unset or invalid.
	DefaultAPIRetryMaxAttempts = 4
	// DefaultAPIRetryMaxWaitSeconds is the fallback cap on the wait between
	// attempts used when api-retry-max-wait-seconds is unset or invalid.
	DefaultAPIRetryMaxWaitSeconds = 120
)

Variables

View Source
var (
	TknBinaryName = `tkn`
	TknBinaryURL  = `https://tekton.dev/docs/cli/#installation`
)

Functions

func DefaultValidators added in v0.27.1

func DefaultValidators() map[string]func(string) error

func SyncConfig added in v0.26.0

func SyncConfig(logger *zap.SugaredLogger, setting *Settings, config map[string]string, validators map[string]func(string) error) error

Types

type HubCatalog added in v0.20.0

type HubCatalog struct {
	Index string
	Name  string
	URL   string
}

type Settings

type Settings struct {
	ApplicationName                     string `default:"Pipelines as Code CI" json:"application-name"`
	HubCatalogs                         *sync.Map
	RemoteTasks                         bool   `default:"true"                                 json:"remote-tasks"`
	MaxKeepRunsUpperLimit               int    `json:"max-keep-run-upper-limit"`
	DefaultMaxKeepRuns                  int    `json:"default-max-keep-runs"`
	BitbucketCloudCheckSourceIP         bool   `default:"true"                                 json:"bitbucket-cloud-check-source-ip"`
	BitbucketCloudAdditionalSourceIP    string `json:"bitbucket-cloud-additional-source-ip"`
	TektonDashboardURL                  string `json:"tekton-dashboard-url"`
	AutoConfigureNewGitHubRepo          bool   `default:"false"                                json:"auto-configure-new-github-repo"`
	AutoConfigureRepoNamespaceTemplate  string `json:"auto-configure-repo-namespace-template"`
	AutoConfigureRepoRepositoryTemplate string `json:"auto-configure-repo-repository-template"`

	// TrustedProviderHostnames is the comma separated allowlist of hosted VCS
	// hostnames this controller may send credentials to.
	//
	// It is here so that the value is validated on every ConfigMap change and
	// surfaced with the rest of the settings. The security gate in
	// pkg/hostpolicy deliberately does NOT read this field: it reads the
	// ConfigMap live, because the informer cache may lag behind an administrator
	// narrowing the allowlist, and because trust on first use has to update the
	// learned-host annotation under a read-modify-write it can retry on conflict.
	TrustedProviderHostnames string `json:"trusted-provider-hostnames"`

	SecretAutoCreation               bool   `default:"true"                             json:"secret-auto-create"`
	SecretGHAppRepoScoped            bool   `default:"true"                             json:"secret-github-app-token-scoped"`
	SecretGhAppTokenScopedExtraRepos string `json:"secret-github-app-scope-extra-repos"`

	ErrorLogSnippet              bool   `default:"true"                                                                          json:"error-log-snippet"`
	ErrorLogSnippetNumberOfLines int    `` /* 128-byte string literal not displayed */
	ErrorDetection               bool   `` /* 130-byte string literal not displayed */
	ErrorDetectionNumberOfLines  int    `` /* 130-byte string literal not displayed */
	ErrorDetectionSimpleRegexp   string `default:"^(?P<filename>[^:]*):(?P<line>[0-9]+):(?P<column>[0-9]+)?([ ]*)?(?P<error>.*)" json:"error-detection-simple-regexp"`

	EnableCancelInProgressOnPullRequests bool `json:"enable-cancel-in-progress-on-pull-requests"`
	EnableCancelInProgressOnPush         bool `json:"enable-cancel-in-progress-on-push"`

	SkipPushEventForPRCommits bool `json:"skip-push-event-for-pr-commits" default:"true"` // nolint:tagalign

	CustomConsoleName         string `json:"custom-console-name"`
	CustomConsoleURL          string `json:"custom-console-url"`
	CustomConsolePRdetail     string `json:"custom-console-url-pr-details"`
	CustomConsolePRTaskLog    string `json:"custom-console-url-pr-tasklog"`
	CustomConsoleNamespaceURL string `json:"custom-console-url-namespace"`

	RememberOKToTest   bool `json:"remember-ok-to-test"`
	RequireOkToTestSHA bool `json:"require-ok-to-test-sha"`

	// Retry Git provider API requests on rate limits and transient errors.
	// Disabled by default.
	EnableAPIRetry         bool `default:"false" json:"enable-api-retry"`
	APIRetryMaxAttempts    int  `default:"4"     json:"api-retry-max-attempts"`
	APIRetryMaxWaitSeconds int  `default:"120"   json:"api-retry-max-wait-seconds"`

	// Tracing label names. Defaults in config/302-pac-configmap.yaml.
	TracingLabelAction      string `json:"tracing-label-action"`
	TracingLabelApplication string `json:"tracing-label-application"`
	TracingLabelComponent   string `json:"tracing-label-component"`
}

if there is a change performed on the default value, update the same on "config/302-pac-configmap.yaml".

func DefaultSettings added in v0.26.0

func DefaultSettings() Settings

func (*Settings) DeepCopy added in v0.23.0

func (s *Settings) DeepCopy(out *Settings)

Jump to

Keyboard shortcuts

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