(name string, client *client.Client, config *container.Config, hostConf *container.HostConfig, networkConf *container.NetworkSettings)
| 1944 | } |
| 1945 | |
| 1946 | func reCreateAfterUpdate(name string, client *client.Client, config *container.Config, hostConf *container.HostConfig, networkConf *container.NetworkSettings) { |
| 1947 | ctx := context.Background() |
| 1948 | |
| 1949 | oldContainer, err := createContainerWithOldNetworks(ctx, client, config, hostConf, networkConf, name) |
| 1950 | if err != nil { |
| 1951 | global.LOG.Errorf("recreate after container update failed, err: %v", err) |
| 1952 | return |
| 1953 | } |
| 1954 | if err := client.ContainerStart(ctx, oldContainer.ID, container.StartOptions{}); err != nil { |
| 1955 | global.LOG.Errorf("restart after container update failed, err: %v", err) |
| 1956 | } |
| 1957 | global.LOG.Info("recreate after container update successful") |
| 1958 | } |
| 1959 | |
| 1960 | func createContainerWithOldNetworks(ctx context.Context, client *client.Client, config *container.Config, hostConf *container.HostConfig, networkSettings *container.NetworkSettings, name string) (container.CreateResponse, error) { |
| 1961 | networkConf, extraNetworks := buildContainerRecoverNetworkConfig(networkSettings, hostConf) |
no test coverage detected