Provisioning: Configurable Repository Types in monolith and operators (#110822)
* Configurable repository types in monolith and operator * Default to Github in operators * Regenerate wire * Fix and implement unit tests * Same types for enterprise tests * Remove unnecessary conversion * Remove the issue with import cycles
This commit is contained in:
@@ -134,6 +134,7 @@ type Cfg struct {
|
||||
PermittedProvisioningPaths []string
|
||||
// Provisioning config
|
||||
ProvisioningDisableControllers bool
|
||||
ProvisioningRepositoryTypes []string
|
||||
ProvisioningLokiURL string
|
||||
ProvisioningLokiUser string
|
||||
ProvisioningLokiPassword string
|
||||
@@ -2103,6 +2104,19 @@ func (cfg *Cfg) readProvisioningSettings(iniFile *ini.File) error {
|
||||
}
|
||||
}
|
||||
|
||||
repositoryTypes := strings.TrimSpace(valueAsString(iniFile.Section("provisioning"), "repository_types", "github|local"))
|
||||
if repositoryTypes != "|" && repositoryTypes != "" {
|
||||
cfg.ProvisioningRepositoryTypes = strings.Split(repositoryTypes, "|")
|
||||
for i, s := range cfg.ProvisioningRepositoryTypes {
|
||||
s = strings.TrimSpace(s)
|
||||
if s == "" {
|
||||
return fmt.Errorf("a provisioning repository type is empty in '%s' (at index %d)", repositoryTypes, i)
|
||||
}
|
||||
|
||||
cfg.ProvisioningRepositoryTypes[i] = s
|
||||
}
|
||||
}
|
||||
|
||||
cfg.ProvisioningDisableControllers = iniFile.Section("provisioning").Key("disable_controllers").MustBool(false)
|
||||
|
||||
// Read job history configuration
|
||||
|
||||
Reference in New Issue
Block a user