Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions rocketpool-cli/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,13 @@ func configureService(c *cli.Context) error {
return nil
}

// Let's reduce potential downtime by pulling the new containers before restarting
fmt.Println("Pulling potential new container images...")
err = rp.PullComposeImages(getComposeFiles(c))
if err != nil {
fmt.Fprintf(os.Stderr, "Warning: couldn't pull new images for updated containers: %s\n", err.Error())
}

fmt.Println()
for _, container := range md.ContainersToRestart {
fullName := fmt.Sprintf("%s_%s", prefix, container)
Expand Down
12 changes: 12 additions & 0 deletions shared/services/rocketpool/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,18 @@ func (c *Client) GetComposeImages(composeFiles []string) ([]string, error) {
return strings.Fields(string(output)), nil
}

func (c *Client) PullComposeImages(composeFiles []string) error {
cmd, err := c.compose(composeFiles, "pull -q")
if err != nil {
return err
}
err = c.printOutput(cmd)
if err != nil {
return fmt.Errorf("error pulling images: %w", err)
}
return nil
}

type DockerImage struct {
Repository string `json:"Repository"`
Tag string `json:"Tag"`
Expand Down
Loading