Documentation ¶
Index ¶
- Constants
- Variables
- func Execute()
- type AutomateCollectorConfig
- type AutomateConfig
- func (a *AutomateConfig) ApplyValuesFrom(other *AutomateConfig)
- func (a *AutomateConfig) ApplyValuesFromEnv()
- func (a *AutomateConfig) CreateRolloutURL() (*url.URL, error)
- func (a *AutomateConfig) Redacted() *PrivateAutomateConfig
- func (a *AutomateConfig) Test() error
- func (a *AutomateConfig) TestURL() (*url.URL, error)
- func (a *AutomateConfig) WithPrivate() *PrivateAutomateConfig
- type CLIIO
- type CiMetadata
- type Config
- func (c *Config) ApplyValuesFrom(other *Config)
- func (c *Config) ApplyValuesFromEnv()
- func (c *Config) IsAutomateCollectorConfig() bool
- func (c *Config) Redacted() *PrivateConfig
- func (c *Config) WithPrivate() *PrivateConfig
- func (c *Config) WriteRepoConfigFiles() error
- func (c *Config) WriteUserConfigFiles() error
- type ConfigLoader
- type PolicyfileLock
- type PrivateAutomateConfig
- type PrivateConfig
- type RolloutMetadata
- type SCMMetadata
Constants ¶
View Source
const ( TestCreateURLPath = "/api/beta/cfgmgmt/rollouts/test_create" CreateRolloutsURLPath = "/api/beta/cfgmgmt/rollouts/create" ConfigFileBasename = ".automate_collector.toml" PrivateConfigFileBasename = ".automate_collector_private.toml" NonHiddenConfigBasename = "automate_collector.toml" GitIgnoreContent = ` # .automate_collector_private.toml contains Chef Automate credentials: .automate_collector_private.toml ` )
View Source
const ( // Set the Automate URL to use. Overrides all configuration. AutomateURLEnvVar = "CHEF_AC_AUTOMATE_URL" // Set the Automate Auth Token to use. Overrides all configuration. AutomateTokenEnvVar = "CHEF_AC_AUTOMATE_TOKEN" // Whether to disable verification of Automate's TLS (SSL) certificates. If // set to "false", certificates will be verified. If set to any other value, // certificate verification will be disabled. AutomateInsecureTLSEnvVar = "CHEF_AC_AUTOMATE_INSECURE_TLS" // Directory where the chef-automate-collector should look for per-repo // configuration. The config loader will look for files named // `.automate_collector.toml` and `.automate_collector_private.toml` in this // directory. RepoConfigDirPathEnvVar = "CHEF_AC_REPO_CONFIG_DIR" // Directory where the chef-automate-collector should look for per-user // configuration. The config loader will look for a file named // `automate_collector.toml` inside this directory. UserConfigDirPathEnvVar = "CHEF_AC_USER_CONFIG_DIR" // Directory where the chef-automate-collector should look for systemwide // configuration. The config loader will look for a file named // `automate_collector.toml` inside this directory. SystemConfigDirPathEnvVar = "CHEF_AC_SYSTEM_CONFIG_DIR" // Whether to disable loading per-repo configuration. If set to "false," // per-repo config will be loaded. If set to any other value, per-repo config // will not be loaded. NoRepoConfigEnvVar = "CHEF_AC_NO_REPO_CONFIG" // Whether to disable loading per-user configuration. If set to "false," // per-repo config will be loaded. If set to any other value, per-user config // will not be loaded. NoUserConfigEnvVar = "CHEF_AC_NO_USER_CONFIG" // Whether to disable loading systemwide configuration. If set to "false," // per-repo config will be loaded. If set to any other value, systemwide // config will not be loaded. NoSystemConfigEnvVar = "CHEF_AC_NO_SYSTEM_CONFIG" // Whether to disable reporting new rollouts to Chef Automate. If set to // "false," reports will be sent. If set to any other value, reports will not // be sent. DisableReportNewRolloutEnvVar = "CHEF_AC_DISABLE_COLLECTOR" // Name of the git remote to use when detecting the git URL. The default // remote name to check is "origin" GitRemoteNameEnvVar = "CHEF_AC_GIT_REMOTE_NAME" )
Variables ¶
View Source
var SCMType_GIT = req.SCMType_name[int32(req.SCMType_SCM_TYPE_GIT)]
View Source
var SCMType_UNKNOWN_SCM = req.SCMType_name[int32(req.SCMType_SCM_TYPE_UNKNOWN_SCM)]
View Source
var SCMWebType_GITHUB = req.SCMWebType_name[int32(req.SCMWebType_SCM_WEB_TYPE_GITHUB)]
View Source
var SCMWebType_UNKNOWN_SCM_WEB = req.SCMWebType_name[int32(req.SCMWebType_SCM_WEB_TYPE_UNKNOWN_SCM_WEB)]
Functions ¶
Types ¶
type AutomateCollectorConfig ¶
type AutomateCollectorConfig interface {
IsAutomateCollectorConfig() bool
}
type AutomateConfig ¶
type AutomateConfig struct { URL string `toml:"url"` InsecureTLS bool `toml:"-"` // contains filtered or unexported fields }
func (*AutomateConfig) ApplyValuesFrom ¶
func (a *AutomateConfig) ApplyValuesFrom(other *AutomateConfig)
func (*AutomateConfig) ApplyValuesFromEnv ¶
func (a *AutomateConfig) ApplyValuesFromEnv()
func (*AutomateConfig) CreateRolloutURL ¶
func (a *AutomateConfig) CreateRolloutURL() (*url.URL, error)
func (*AutomateConfig) Redacted ¶
func (a *AutomateConfig) Redacted() *PrivateAutomateConfig
func (*AutomateConfig) Test ¶
func (a *AutomateConfig) Test() error
func (*AutomateConfig) WithPrivate ¶
func (a *AutomateConfig) WithPrivate() *PrivateAutomateConfig
type CiMetadata ¶
func (*CiMetadata) ReadBuildkiteMetadata ¶
func (c *CiMetadata) ReadBuildkiteMetadata()
func (*CiMetadata) ReadCIMetadata ¶
func (c *CiMetadata) ReadCIMetadata()
func (*CiMetadata) ReadDefaultCiMetadata ¶
func (c *CiMetadata) ReadDefaultCiMetadata()
func (*CiMetadata) ReadJenkinsMetadata ¶
func (c *CiMetadata) ReadJenkinsMetadata()
type Config ¶
type Config struct {
Automate *AutomateConfig `toml:"automate"`
}
func (*Config) ApplyValuesFrom ¶
func (*Config) ApplyValuesFromEnv ¶
func (c *Config) ApplyValuesFromEnv()
func (*Config) IsAutomateCollectorConfig ¶
func (*Config) Redacted ¶
func (c *Config) Redacted() *PrivateConfig
func (*Config) WithPrivate ¶
func (c *Config) WithPrivate() *PrivateConfig
func (*Config) WriteRepoConfigFiles ¶
func (*Config) WriteUserConfigFiles ¶
type ConfigLoader ¶
type ConfigLoader struct { RepoConfigPath string RepoPrivateConfigPath string UserConfigPath string SystemConfigPath string LoadedConfig *Config }
func NewConfigLoader ¶
func NewConfigLoader() *ConfigLoader
func (*ConfigLoader) Load ¶
func (l *ConfigLoader) Load() error
func (*ConfigLoader) ViableConfigPaths ¶
func (l *ConfigLoader) ViableConfigPaths() []string
type PolicyfileLock ¶
type PrivateAutomateConfig ¶
type PrivateAutomateConfig struct { *AutomateConfig AuthToken string `toml:"auth_token"` InsecureTLS bool `toml:"insecure_tls"` }
func (*PrivateAutomateConfig) ToConfig ¶
func (p *PrivateAutomateConfig) ToConfig() *AutomateConfig
type PrivateConfig ¶
type PrivateConfig struct {
Automate *PrivateAutomateConfig `toml:"automate"`
}
func (*PrivateConfig) IsAutomateCollectorConfig ¶
func (p *PrivateConfig) IsAutomateCollectorConfig() bool
func (*PrivateConfig) ToConfig ¶
func (p *PrivateConfig) ToConfig() *Config
type RolloutMetadata ¶
type RolloutMetadata struct { PolicyName string `json:"policy_name"` PolicyNodeGroup string `json:"policy_node_group"` PolicyRevisionID string `json:"policy_revision_id"` PolicyDomainURL string `json:"policy_domain_url"` Description string `json:"description"` SCMMetadata CiMetadata // contains filtered or unexported fields }
func (*RolloutMetadata) ReadPolicyfileMetadata ¶
func (r *RolloutMetadata) ReadPolicyfileMetadata() error
type SCMMetadata ¶
type SCMMetadata struct { SCMType string `json:"scm_type"` SCMWebType string `json:"scm_web_type"` PolicySCMURL string `json:"policy_scm_url"` PolicySCMWebURL string `json:"policy_scm_web_url"` PolicySCMCommit string `json:"policy_scm_commit"` PolicySCMCommitMessage string `json:"policy_scm_commit_message"` SCMAuthorName string `json:"scm_author_name"` SCMAuthorEmail string `json:"scm_author_email"` // contains filtered or unexported fields }
func (*SCMMetadata) ReadGitMetadata ¶
func (s *SCMMetadata) ReadGitMetadata() error
Click to show internal directories.
Click to hide internal directories.