mirror of
https://github.com/containers/podman.git
synced 2025-06-02 19:02:10 +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:
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()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user