Skip to content

Commit

Permalink
Merge branch 'v3' of github.com:percona/pmm into v3
Browse files Browse the repository at this point in the history
  • Loading branch information
ademidoff committed Sep 18, 2024
2 parents 7e51659 + 6d2825b commit 9bc2a01
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion admin/commands/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (a listResultAgent) HumanReadableAgentType() string {
}

func (a listResultAgent) NiceAgentStatus() string {
res := a.Status
res, _ := strings.CutPrefix(a.Status, "AGENT_STATUS_")
if res == "" {
res = "unknown" //nolint:goconst
}
Expand Down
3 changes: 3 additions & 0 deletions api-tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ run:
go test -count=1 -p 1 -v ./... 2>&1 | tee pmm-api-tests-output.txt
cat pmm-api-tests-output.txt | bin/go-junit-report > pmm-api-tests-junit-report.xml

run-dev:
go test -count=1 -p 1 -v ./...

run-race:
go test -count=1 -p 1 -v -race ./... 2>&1 | tee pmm-api-tests-output.txt
cat pmm-api-tests-output.txt | bin/go-junit-report > pmm-api-tests-junit-report.xml
Expand Down
6 changes: 3 additions & 3 deletions api-tests/server/settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ func TestSettings(t *testing.T) {
assert.Empty(t, res)
})

t.Run("ChangeSSHKey", func(t *testing.T) {
t.Run("ChangeSSHKey only on AMI and OVF", func(t *testing.T) {
defer restoreSettingsDefaults(t)

sshKey := "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQClY/8sz3w03vA2bY6mBFgUzrvb2FIoHw8ZjUXGGClJzJg5HC" +
Expand All @@ -535,8 +535,8 @@ func TestSettings(t *testing.T) {
},
Context: pmmapitests.Context,
})
require.NoError(t, err)
assert.Equal(t, sshKey, res.Payload.Settings.SSHKey)
pmmapitests.AssertAPIErrorf(t, err, 500, codes.Internal, `SSH key can be set only on AMI and OVF distributions`)
assert.Empty(t, res)
})

t.Run("OK", func(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion managed/services/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,8 @@ func (s *Server) ChangeSettings(ctx context.Context, req *serverv1.ChangeSetting
// absent value means "do not change"
if req.SshKey != nil {
if err = s.writeSSHKey(pointer.GetString(req.SshKey)); err != nil {
return errors.WithStack(err)
s.l.Error(errors.WithStack(err))
return status.Errorf(codes.Internal, err.Error())
}
}

Expand Down

0 comments on commit 9bc2a01

Please sign in to comment.