Skip to content
This repository was archived by the owner on Jun 21, 2022. It is now read-only.

PMM-10078 Extract portal client, add dev env variables for portal address overwriting #1136

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
PMM-10078 Remove unused code
artemgavrilov committed Jun 2, 2022
commit 813114336197578756239055b8f5f00cfacdcab1
15 changes: 0 additions & 15 deletions services/management/ia/templates_service.go
Original file line number Diff line number Diff line change
@@ -44,7 +44,6 @@ import (
"github.com/percona/pmm-managed/data"
"github.com/percona/pmm-managed/models"
"github.com/percona/pmm-managed/utils/dir"
"github.com/percona/pmm-managed/utils/envvars"
"github.com/percona/pmm-managed/utils/platform"
)

@@ -72,9 +71,6 @@ type TemplatesService struct {
portalClient *platform.Client
userTemplatesPath string

host string
publicKeys []string

rw sync.RWMutex
templates map[string]templateInfo

@@ -90,25 +86,14 @@ func NewTemplatesService(db *reform.DB, portalClient *platform.Client) (*Templat
l.Error(err)
}

host, err := envvars.GetPlatformAddress()
if err != nil {
return nil, err
}

s := &TemplatesService{
db: db,
l: l,
portalClient: portalClient,
userTemplatesPath: templatesDir,
host: host,
templates: make(map[string]templateInfo),
}

if k := envvars.GetPublicKeys(); k != nil {
l.Warnf("Public keys changed to %q.", k)
s.publicKeys = k
}

return s, nil
}

2 changes: 0 additions & 2 deletions services/management/ia/templates_service_test.go
Original file line number Diff line number Diff line change
@@ -137,8 +137,6 @@ func TestDownloadTemplates(t *testing.T) {

svc, err := NewTemplatesService(db, portalClient)
require.NoError(t, err)
svc.host = devPortalAddress
svc.publicKeys = []string{devPortalPublicKey}

t.Run("normal", func(t *testing.T) {
assert.Empty(t, svc.getTemplates())