mirror of
https://github.com/containers/podman.git
synced 2025-07-17 17:43:23 +08:00
Vendor c/common changes
Vendor latest c/common with changes to add a new Farms table to containers.conf and update system connection to add a connection to a farm when --farm is set. Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
This commit is contained in:
3
vendor/github.com/containers/common/libnetwork/etchosts/hosts.go
generated
vendored
3
vendor/github.com/containers/common/libnetwork/etchosts/hosts.go
generated
vendored
@ -16,6 +16,7 @@ const (
|
||||
HostContainersInternal = "host.containers.internal"
|
||||
HostGateway = "host-gateway"
|
||||
localhost = "localhost"
|
||||
hostDockerInternal = "host.docker.internal"
|
||||
)
|
||||
|
||||
type HostEntries []HostEntry
|
||||
@ -119,7 +120,7 @@ func newHost(params *Params) error {
|
||||
l2 := HostEntry{IP: "::1", Names: lh}
|
||||
containerIPs = append(containerIPs, l1, l2)
|
||||
if params.HostContainersInternalIP != "" {
|
||||
e := HostEntry{IP: params.HostContainersInternalIP, Names: []string{HostContainersInternal}}
|
||||
e := HostEntry{IP: params.HostContainersInternalIP, Names: []string{HostContainersInternal, hostDockerInternal}}
|
||||
containerIPs = append(containerIPs, e)
|
||||
}
|
||||
containerIPs = append(containerIPs, params.ContainerIPs...)
|
||||
|
14
vendor/github.com/containers/common/pkg/config/config.go
generated
vendored
14
vendor/github.com/containers/common/pkg/config/config.go
generated
vendored
@ -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://root@example.com: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
|
||||
}
|
||||
|
||||
|
8
vendor/github.com/containers/common/pkg/config/containers.conf
generated
vendored
8
vendor/github.com/containers/common/pkg/config/containers.conf
generated
vendored
@ -798,3 +798,11 @@ default_sysctls = [
|
||||
# TOML does not provide a way to end a table other than a further table being
|
||||
# defined, so every key hereafter will be part of [machine] and not the
|
||||
# main config.
|
||||
|
||||
[farms]
|
||||
#
|
||||
# the default farm to use when farming out builds
|
||||
# default = ""
|
||||
#
|
||||
# map of existing farms
|
||||
#[farms.list]
|
||||
|
8
vendor/github.com/containers/common/pkg/config/containers.conf-freebsd
generated
vendored
8
vendor/github.com/containers/common/pkg/config/containers.conf-freebsd
generated
vendored
@ -660,3 +660,11 @@ default_sysctls = [
|
||||
# TOML does not provide a way to end a table other than a further table being
|
||||
# defined, so every key hereafter will be part of [machine] and not the
|
||||
# main config.
|
||||
|
||||
[farms]
|
||||
#
|
||||
# the default farm to use when farming out builds
|
||||
# default = ""
|
||||
#
|
||||
# map of existing farms
|
||||
#[farms.list]
|
||||
|
9
vendor/github.com/containers/common/pkg/config/default.go
generated
vendored
9
vendor/github.com/containers/common/pkg/config/default.go
generated
vendored
@ -234,6 +234,7 @@ func DefaultConfig() (*Config, error) {
|
||||
Engine: *defaultEngineConfig,
|
||||
Secrets: defaultSecretConfig(),
|
||||
Machine: defaultMachineConfig(),
|
||||
Farms: defaultFarmConfig(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@ -257,6 +258,14 @@ func defaultMachineConfig() MachineConfig {
|
||||
}
|
||||
}
|
||||
|
||||
// defaultFarmConfig returns the default farms configuration.
|
||||
func defaultFarmConfig() FarmConfig {
|
||||
emptyList := make(map[string][]string)
|
||||
return FarmConfig{
|
||||
List: emptyList,
|
||||
}
|
||||
}
|
||||
|
||||
// defaultConfigFromMemory returns a default engine configuration. Note that the
|
||||
// config is different for root and rootless. It also parses the storage.conf.
|
||||
func defaultConfigFromMemory() (*EngineConfig, error) {
|
||||
|
13
vendor/github.com/containers/common/pkg/ssh/connection_golang.go
generated
vendored
13
vendor/github.com/containers/common/pkg/ssh/connection_golang.go
generated
vendored
@ -64,6 +64,19 @@ func golangConnectionCreate(options ConnectionCreateOptions) error {
|
||||
} else {
|
||||
cfg.Engine.ServiceDestinations[options.Name] = *dst
|
||||
}
|
||||
|
||||
// Create or update an existing farm with the connection being added
|
||||
if options.Farm != "" {
|
||||
if len(cfg.Farms.List) == 0 {
|
||||
cfg.Farms.Default = options.Farm
|
||||
}
|
||||
if val, ok := cfg.Farms.List[options.Farm]; ok {
|
||||
cfg.Farms.List[options.Farm] = append(val, options.Name)
|
||||
} else {
|
||||
cfg.Farms.List[options.Farm] = []string{options.Name}
|
||||
}
|
||||
}
|
||||
|
||||
return cfg.Write()
|
||||
}
|
||||
|
||||
|
1
vendor/github.com/containers/common/pkg/ssh/types.go
generated
vendored
1
vendor/github.com/containers/common/pkg/ssh/types.go
generated
vendored
@ -24,6 +24,7 @@ type ConnectionCreateOptions struct {
|
||||
Identity string
|
||||
Socket string
|
||||
Default bool
|
||||
Farm string
|
||||
}
|
||||
|
||||
type ConnectionDialOptions struct {
|
||||
|
Reference in New Issue
Block a user