-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1586 from umohnani8/farms
Add Farms to config
- Loading branch information
Showing
8 changed files
with
126 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,6 +79,8 @@ type Config struct { | |
Secrets SecretConfig `toml:"secrets"` | ||
// ConfigMap section defines configurations for the configmaps management | ||
ConfigMaps ConfigMapConfig `toml:"configmaps"` | ||
// Farms defines configurations for the buildfarm farms | ||
Farms FarmConfig `toml:"farms"` | ||
} | ||
|
||
// ContainersConfig represents the "containers" TOML config table | ||
|
@@ -676,6 +678,14 @@ type MachineConfig struct { | |
Provider string `toml:"provider,omitempty"` | ||
} | ||
|
||
// FarmConfig represents the "farm" TOML config tabls | ||
type FarmConfig struct { | ||
// Default is the default farm to be used when farming out builds | ||
Default string `toml:"default,omitempty"` | ||
// List is a map of farms created where key=farm-name and value=list of connections | ||
List map[string][]string `toml:"list,omitempty"` | ||
} | ||
|
||
// Destination represents destination for remote service | ||
type Destination struct { | ||
// URI, required. Example: ssh://[email protected]:22/run/podman/podman.sock | ||
|
@@ -1241,6 +1251,10 @@ func ReadCustomConfig() (*Config, error) { | |
return nil, err | ||
} | ||
} | ||
// Let's always initialize the farm list so it is never nil | ||
if newConfig.Farms.List == nil { | ||
newConfig.Farms.List = make(map[string][]string) | ||
} | ||
return newConfig, nil | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters