From d03865a4662f683d2b20ed41c97fe8314792bb96 Mon Sep 17 00:00:00 2001 From: Alex Demidoff Date: Thu, 11 Jul 2024 16:18:00 +0300 Subject: [PATCH] PMM-13054 minor cleanup --- .github/workflows/managed.yml | 6 ++++-- api-tests/server/auth_test.go | 2 -- managed/services/grafana/auth_server.go | 8 ++------ 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/managed.yml b/.github/workflows/managed.yml index e423045c19..4b6ca3f1b8 100644 --- a/.github/workflows/managed.yml +++ b/.github/workflows/managed.yml @@ -43,6 +43,7 @@ jobs: - name: Launch PMM Server (see docker-compose.yml) run: | make env-compose-up # the container workdir is /root/go/src/github.com/percona/pmm + docker exec -t pmm-server id -Z || : docker logs pmm-server - name: Mark the root directory of pmm as safe @@ -120,7 +121,8 @@ jobs: docker exec pmm-server go env | sort docker exec pmm-server supervisorctl status || true services=$(docker exec pmm-server supervisorctl status | awk '{print $1}') - while IFS= read -r service; do + services=(`echo ${services}`) + for service in "${services[@]}"; do echo "Logs for $service:" docker exec pmm-server supervisorctl tail $service - done <<< "$services" \ No newline at end of file + done diff --git a/api-tests/server/auth_test.go b/api-tests/server/auth_test.go index 507467fb08..0430f11d1e 100644 --- a/api-tests/server/auth_test.go +++ b/api-tests/server/auth_test.go @@ -500,10 +500,8 @@ func TestServiceAccountPermissions(t *testing.T) { } for _, test := range tests { - test := test t.Run(test.name, func(t *testing.T) { for _, user := range test.userCase { - user := user t.Run(fmt.Sprintf("Service Token auth %s", user.userType), func(t *testing.T) { // make a BaseURL without authentication u, err := url.Parse(pmmapitests.BaseURL.String()) diff --git a/managed/services/grafana/auth_server.go b/managed/services/grafana/auth_server.go index 61be2bf866..4379d23ad0 100644 --- a/managed/services/grafana/auth_server.go +++ b/managed/services/grafana/auth_server.go @@ -77,12 +77,8 @@ var rules = map[string]role{ "/v1/server/updates:start": admin, "/v1/server/updates:getStatus": none, // special token-based auth "/v1/server/settings": admin, - "/v1/platform:connect": admin, - "/v1/platform:disconnect": admin, - "/v1/platform/organization/": viewer, - "/v1/platform/contact": viewer, - "/v1/platform/server": viewer, - "/v1/platform/user": viewer, + "/v1/platform:": admin, + "/v1/platform/": viewer, "/v1/users": viewer, // must be available without authentication for health checking