diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-12-08 06:15:40 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-08 06:15:40 -0500 |
commit | 9b3a81a002e570b8a49e60c3dd3feb65d742f286 (patch) | |
tree | 78f983912e8efe3aa055b3d5db6abec0939f4fa3 /pkg/domain/infra/abi | |
parent | e2f91207fc3e515c0a9f828433aaf80727f4b7c5 (diff) | |
parent | b0286d6b43ebec367c0d9ed87bc6566d76ece8f8 (diff) | |
download | podman-9b3a81a002e570b8a49e60c3dd3feb65d742f286.tar.gz podman-9b3a81a002e570b8a49e60c3dd3feb65d742f286.tar.bz2 podman-9b3a81a002e570b8a49e60c3dd3feb65d742f286.zip |
Merge pull request #8571 from Luap99/podman-network-reload
Implement pod-network-reload
Diffstat (limited to 'pkg/domain/infra/abi')
-rw-r--r-- | pkg/domain/infra/abi/network.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/pkg/domain/infra/abi/network.go b/pkg/domain/infra/abi/network.go index 6a219edd5..e5ecf5c72 100644 --- a/pkg/domain/infra/abi/network.go +++ b/pkg/domain/infra/abi/network.go @@ -60,6 +60,26 @@ func (ic *ContainerEngine) NetworkInspect(ctx context.Context, namesOrIds []stri return rawCNINetworks, errs, nil } +func (ic *ContainerEngine) NetworkReload(ctx context.Context, names []string, options entities.NetworkReloadOptions) ([]*entities.NetworkReloadReport, error) { + ctrs, err := getContainersByContext(options.All, options.Latest, names, ic.Libpod) + if err != nil { + return nil, err + } + + reports := make([]*entities.NetworkReloadReport, 0, len(ctrs)) + for _, ctr := range ctrs { + report := new(entities.NetworkReloadReport) + report.Id = ctr.ID() + report.Err = ctr.ReloadNetwork() + if options.All && errors.Cause(report.Err) == define.ErrCtrStateInvalid { + continue + } + reports = append(reports, report) + } + + return reports, nil +} + func (ic *ContainerEngine) NetworkRm(ctx context.Context, namesOrIds []string, options entities.NetworkRmOptions) ([]*entities.NetworkRmReport, error) { reports := []*entities.NetworkRmReport{} |