Skip to content

Commit

Permalink
Merge branch 'v3' into PMM-13315-service-account-max-length
Browse files Browse the repository at this point in the history
  • Loading branch information
JiriCtvrtka authored Oct 11, 2024
2 parents af2bc91 + 9f00573 commit d0eb182
Show file tree
Hide file tree
Showing 82 changed files with 3,155 additions and 9,235 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:
name: Checks
runs-on: ubuntu-22.04

env:
PMM_ENCRYPTION_KEY_PATH: pmm-encryption.key

steps:
- name: Check out code
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/list_agents.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func getAgentStatus(status *string) string {
if res == "" {
res = "UNKNOWN"
}
res, _ = strings.CutPrefix(res, "AGENT_STATUS_")
return res
}

Expand Down
3 changes: 2 additions & 1 deletion admin/commands/pmm/server/docker/deps.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
tea "github.com/charmbracelet/bubbletea"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/api/types/volume"
"github.com/docker/docker/client"

Expand All @@ -47,7 +48,7 @@ type Functions interface { //nolint:interfacebloat
// Imager holds methods to interact with Docker images.
type Imager interface {
ParsePullImageProgress(r io.Reader, p *tea.Program) (<-chan struct{}, <-chan error)
PullImage(ctx context.Context, dockerImage string, opts types.ImagePullOptions) (io.Reader, error)
PullImage(ctx context.Context, dockerImage string, opts image.PullOptions) (io.Reader, error)
}

// Installer holds methods related to Docker installation.
Expand Down
4 changes: 2 additions & 2 deletions admin/commands/pmm/server/docker/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"strconv"

tea "github.com/charmbracelet/bubbletea"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/api/types/volume"
"github.com/docker/go-connections/nat"
"github.com/pkg/errors"
Expand Down Expand Up @@ -145,7 +145,7 @@ func (c *InstallCommand) runContainer(ctx context.Context, volume *volume.Volume

// pullImage pulls a docker image and displays progress.
func (c *InstallCommand) pullImage(ctx context.Context, globals *flags.GlobalFlags) (commands.Result, error) {
reader, err := c.dockerFn.PullImage(ctx, c.DockerImage, types.ImagePullOptions{})
reader, err := c.dockerFn.PullImage(ctx, c.DockerImage, image.PullOptions{})
if err != nil {
return nil, err
}
Expand Down
9 changes: 5 additions & 4 deletions admin/commands/pmm/server/docker/mock_functions_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion admin/commands/pmm/server/docker/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/api/types/mount"
"github.com/docker/docker/api/types/strslice"
"github.com/pkg/errors"
Expand Down Expand Up @@ -204,7 +205,7 @@ func (c *UpgradeCommand) backupVolumes(ctx context.Context, container *types.Con
}

func (c *UpgradeCommand) pullImage(ctx context.Context, imageName string) error {
reader, err := c.dockerFn.PullImage(ctx, imageName, types.ImagePullOptions{})
reader, err := c.dockerFn.PullImage(ctx, imageName, image.PullOptions{})
if err != nil {
return err
}
Expand Down
3 changes: 2 additions & 1 deletion admin/commands/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ func (res *statusResult) HumanReadableAgentType(agentType string) string {
}

func (res *statusResult) NiceAgentStatus(status string) string {
return cases.Title(language.English).String(strings.ToLower(status))
s, _ := strings.CutPrefix(status, "AGENT_STATUS_")
return cases.Title(language.English).String(strings.ToLower(s))
}

func (res *statusResult) Result() {}
Expand Down
4 changes: 2 additions & 2 deletions admin/pkg/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func (b *Base) GetDockerClient() *client.Client {

// FindServerContainers finds all containers running PMM Server.
func (b *Base) FindServerContainers(ctx context.Context) ([]types.Container, error) {
return b.Cli.ContainerList(ctx, types.ContainerListOptions{ //nolint:exhaustruct
return b.Cli.ContainerList(ctx, container.ListOptions{ //nolint:exhaustruct
All: true,
Filters: filters.NewArgs(filters.KeyValuePair{
Key: "label",
Expand Down Expand Up @@ -221,7 +221,7 @@ func (b *Base) RunContainer(ctx context.Context, config *container.Config, hostC
return "", err
}

if err := b.Cli.ContainerStart(ctx, res.ID, types.ContainerStartOptions{}); err != nil { //nolint:exhaustruct
if err := b.Cli.ContainerStart(ctx, res.ID, container.StartOptions{}); err != nil { //nolint:exhaustruct
return "", err
}

Expand Down
4 changes: 2 additions & 2 deletions admin/pkg/docker/pull_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ import (
"io"

tea "github.com/charmbracelet/bubbletea"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/image"

"github.com/percona/pmm/admin/pkg/bubbles/progress"
)

// PullImage pulls image from Docker registry.
func (b *Base) PullImage(ctx context.Context, dockerImage string, opts types.ImagePullOptions) (io.Reader, error) {
func (b *Base) PullImage(ctx context.Context, dockerImage string, opts image.PullOptions) (io.Reader, error) {
return b.Cli.ImagePull(ctx, dockerImage, opts)
}

Expand Down
Loading

0 comments on commit d0eb182

Please sign in to comment.