Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into v3
Browse files Browse the repository at this point in the history
# Conflicts:
#	api-tests/server/settings_test.go
#	api/managementpb/dbaas/components.pb.gw.go
#	api/managementpb/dbaas/db_clusters.pb.gw.go
#	api/managementpb/dbaas/kubernetes.pb.gw.go
#	api/managementpb/dbaas/logs.pb.gw.go
#	api/managementpb/dbaas/psmdb_clusters.pb.gw.go
#	api/managementpb/dbaas/pxc_clusters.pb.gw.go
#	api/managementpb/dbaas/templates.pb.gw.go
#	api/managementpb/ia/alerts.pb.gw.go
#	api/managementpb/ia/channels.pb.gw.go
#	api/managementpb/ia/rules.pb.gw.go
#	api/serverpb/server.pb.gw.go
#	build/packages/deb/files
#	build/packages/deb/install
#	descriptor.bin
#	go.mod
#	go.sum
#	managed/data/gen.go
#	managed/models/kubernetes_helpers_test.go
#	managed/models/models.go
#	managed/services/alertmanager/alertmanager.go
#	managed/services/dbaas/dbaas_client.go
#	managed/services/dbaas/kubernetes/client/client.go
#	managed/services/dbaas/kubernetes/client/database/database.go
#	managed/services/dbaas/kubernetes/client/kubeclient_interface.go
#	managed/services/dbaas/kubernetes/client/load_config.go
#	managed/services/dbaas/kubernetes/kubernetes.go
#	managed/services/dbaas/kubernetes/types.go
#	managed/services/management/dbaas/components_service.go
#	managed/services/management/dbaas/components_service_test.go
#	managed/services/management/dbaas/db_cluster_service.go
#	managed/services/management/dbaas/kube_clients.go
#	managed/services/management/dbaas/kubernetes_server.go
#	managed/services/management/dbaas/kubernetes_server_test.go
#	managed/services/management/dbaas/psmdb_cluster_service.go
#	managed/services/management/dbaas/pxc_cluster_service.go
#	managed/services/management/dbaas/template_service.go
#	managed/services/management/dbaas/version_service_client.go
#	managed/services/management/ia/channels_service.go
#	managed/services/management/ia/rules_service.go
#	managed/services/supervisord/supervisord.go
#	managed/services/supervisord/supervisord_test.go
#	update/ansible/playbook/tasks/roles/initialization/tasks/main.yml
  • Loading branch information
BupycHuk committed Feb 20, 2024
2 parents 9310b83 + 805419a commit 65513d9
Show file tree
Hide file tree
Showing 245 changed files with 5,806 additions and 2,719 deletions.
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
* @percona/pmm-review-be
/agent/agents/postgres/ @JiriCtvrtka @percona/pmm-review-be
/agent/runner/ @artemgavrilov @percona/pmm-review-be
/api/ @BupycHuk @percona/pmm-review-be
/managed/services/checks/ @idoqo @percona/pmm-review-be
/update/ @BupycHuk @talhabinrizwan @percona/pmm-review-be
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ description: File a bug report
labels: ["bug", "triage"]
assignees:
- BupycHuk
- artemgavrilov
body:
- type: markdown
attributes:
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ description: Suggest an idea for this project
labels: ["feature", "triage"]
assignees:
- BupycHuk
- artemgavrilov
body:
- type: markdown
attributes:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/admin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
cache: false

- name: Enable Go build cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-${{ github.ref }}-${{ hashFiles('**') }}
Expand All @@ -48,7 +48,7 @@ jobs:
${{ runner.os }}-go-build-
- name: Enable Go modules cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
cache: false

- name: Enable Go build cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-${{ github.ref }}-${{ hashFiles('**') }}
Expand All @@ -112,7 +112,7 @@ jobs:
${{ runner.os }}-go-build-
- name: Enable Go modules cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
cache: false

- name: Enable Go build cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-${{ github.ref }}-${{ hashFiles('**') }}
Expand All @@ -82,7 +82,7 @@ jobs:
${{ runner.os }}-go-build-
- name: Enable Go modules cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/clean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ jobs:
lfs: true

- name: Enable Go modules cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ matrix.os }}-go-${{ matrix.go.version }}-modules-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ matrix.os }}-go-${{ matrix.go.version }}-modules-
- name: Enable Go build cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/go-build
key: ${{ matrix.os }}-go-${{ matrix.go.version }}-build-${{ github.ref }}-${{ hashFiles('**') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dockerhub-readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ jobs:
- uses: actions/checkout@v4

- name: Update Docker Hub Readme for perconalab/pmm-server
uses: peter-evans/dockerhub-description@v3
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
repository: perconalab/pmm-server
readme-filepath: ./build/docker/server/README.md

- name: Update Docker Hub Readme for percona/pmm-server
uses: peter-evans/dockerhub-description@v3
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
cache: false

- name: Enable Go build cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-${{ github.ref }}-${{ hashFiles('**') }}
Expand All @@ -36,7 +36,7 @@ jobs:
${{ runner.os }}-go-build-
- name: Enable Go modules cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/managed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

- name: Enable Go build cache
if: ${{ fromJSON(env.DEVCONTAINER_CACHE_ENABLED) }}
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-${{ github.ref }}-${{ hashFiles('**') }}
Expand All @@ -49,7 +49,7 @@ jobs:
- name: Enable Go modules cache
if: ${{ fromJSON(env.DEVCONTAINER_CACHE_ENABLED) }}
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/qan-api2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
cache: false

- name: Enable Go build cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-${{ github.ref }}-${{ hashFiles('**') }}
Expand All @@ -49,7 +49,7 @@ jobs:
${{ runner.os }}-go-build-
- name: Enable Go modules cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/vmproxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
cache: false

- name: Enable Go build cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-${{ github.ref }}-${{ hashFiles('**') }}
Expand All @@ -49,7 +49,7 @@ jobs:
${{ runner.os }}-go-build-
- name: Enable Go modules cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
Expand Down
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ linters:

# TODO: carefully review all the rules below and either fix the code
# or leave disabled and provide a reason why
- tagliatelle
- revive
#- tagliatelle
#- revive
- paralleltest
- gocognit
- tagalign
Expand Down
20 changes: 0 additions & 20 deletions .whitesource

This file was deleted.

10 changes: 6 additions & 4 deletions admin/agentlocal/agentlocal.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ func SetTransport(ctx context.Context, debug bool, port uint32) {
client.Default.SetTransport(transport)
}

// NetworkInfo represents information about the network.
type NetworkInfo bool

const (
RequestNetworkInfo NetworkInfo = true
DoNotRequestNetworkInfo NetworkInfo = false
Localhost = "127.0.0.1"
DefaultPMMAgentListenPort = 7777
RequestNetworkInfo NetworkInfo = true //nolint:revive
DoNotRequestNetworkInfo NetworkInfo = false //nolint:revive
Localhost = "127.0.0.1" //nolint:revive
DefaultPMMAgentListenPort = 7777 //nolint:revive
)

// ErrNotSetUp is returned by GetStatus when pmm-agent is running, but not set up.
Expand Down Expand Up @@ -81,6 +82,7 @@ type Status struct {
ConnectionUptime float32 `json:"connection_uptime"`
}

// AgentStatus represents the status of the agent.
type AgentStatus struct {
AgentID string `json:"agent_id"`
AgentType string `json:"agent_type"`
Expand Down
2 changes: 2 additions & 0 deletions admin/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func (c *PMMAdminCommands) Run(ctx *kong.Context, globals *flags.GlobalFlags) er
return run(ctx, globals)
}

// GetGlobalFlags returns the global flags for PMMAdminCommands.
func (c *PMMAdminCommands) GetGlobalFlags() *flags.GlobalFlags {
return &c.GlobalFlags
}
Expand All @@ -81,6 +82,7 @@ type PMMCommands struct {
Completion commands.CompletionCommand `cmd:"" help:"Outputs shell code for initialising tab completions"`
}

// GetGlobalFlags returns the global flags for PMMAdminCommands.
func (c *PMMCommands) GetGlobalFlags() *flags.GlobalFlags {
return &c.GlobalFlags
}
Expand Down
2 changes: 1 addition & 1 deletion admin/cmd/pmm-admin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Package main.
package main

import (
Expand Down
2 changes: 1 addition & 1 deletion admin/cmd/pmm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Package main.
package main

import (
Expand Down
4 changes: 4 additions & 0 deletions admin/commands/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,19 @@ func ReadFromSource(src string) (*Credentials, error) {
return &creds, nil
}

// ErrorResponse defines the interface for error responses.
type ErrorResponse interface {
error
Code() int
}

// Error represents an error with additional information.
type Error struct {
Code int `json:"code"`
Error string `json:"error"`
}

// GetError converts an ErrorResponse to an Error.
func GetError(err ErrorResponse) Error {
v := reflect.ValueOf(err)
p := v.Elem().FieldByName("Payload")
Expand All @@ -131,6 +134,7 @@ func GetError(err ErrorResponse) Error {
}
}

// ParseTemplate parses the input text into a template.Template.
func ParseTemplate(text string) *template.Template {
t := template.New("").Option("missingkey=error")
return template.Must(t.Parse(strings.TrimSpace(text)))
Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/add_agent_external_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type AddAgentExternalExporterCommand struct {
PushMetrics bool `help:"Enables push metrics model flow, it will be sent to the server by an agent"`
}

// RunCmd executes the AddAgentExternalExporterCommand and returns the result.
func (cmd *AddAgentExternalExporterCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)

Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/add_agent_mongodb_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ type AddAgentMongodbExporterCommand struct {
LogLevel string `enum:"debug,info,warn,error,fatal" default:"warn" help:"Service logging level. One of: [debug, info, warn, error, fatal]"`
}

// RunCmd executes the AddAgentMongodbExporterCommand and returns the result.
func (cmd *AddAgentMongodbExporterCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)

Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/add_agent_mysqld_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ type AddAgentMysqldExporterCommand struct {
LogLevel string `enum:"debug,info,warn,error" default:"warn" help:"Service logging level. One of: [debug, info, warn, error]"`
}

// RunCmd executes the AddAgentMysqldExporterCommand and returns the result.
func (cmd *AddAgentMysqldExporterCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)

Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/add_agent_node_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ type AddAgentNodeExporterCommand struct {
LogLevel string `enum:"debug,info,warn,error" default:"warn" help:"Service logging level. One of: [debug, info, warn, error]"`
}

// RunCmd runs the command for AddAgentNodeExporterCommand.
func (cmd *AddAgentNodeExporterCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)
params := &agents.AddNodeExporterParams{
Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/add_agent_pmm_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type AddPMMAgentCommand struct {
CustomLabels map[string]string `mapsep:"," help:"Custom user-assigned labels"`
}

// RunCmd executes the AddPMMAgentCommand and returns the result.
func (cmd *AddPMMAgentCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)
params := &agents.AddPMMAgentParams{
Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/add_agent_postgres_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ type AddAgentPostgresExporterCommand struct {
AutoDiscoveryLimit int32 `default:"0" placeholder:"NUMBER" help:"Auto-discovery will be disabled if there are more than that number of databases (default: server-defined, -1: always disabled)"`
}

// RunCmd executes the AddAgentPostgresExporterCommand and returns the result.
func (cmd *AddAgentPostgresExporterCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)

Expand Down
1 change: 1 addition & 0 deletions admin/commands/inventory/add_agent_proxysql_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ type AddAgentProxysqlExporterCommand struct {
LogLevel string `enum:"debug,info,warn,error,fatal" default:"warn" help:"Service logging level. One of: [debug, info, warn, error, fatal]"`
}

// RunCmd executes the AddAgentProxysqlExporterCommand and returns the result.
func (cmd *AddAgentProxysqlExporterCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)
params := &agents.AddProxySQLExporterParams{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ type AddAgentQANMongoDBProfilerAgentCommand struct {
LogLevel string `enum:"debug,info,warn,error,fatal" default:"warn" help:"Service logging level. One of: [debug, info, warn, error, fatal]"`
}

// RunCmd executes the AddAgentQANMongoDBProfilerAgentCommand and returns the result.
func (cmd *AddAgentQANMongoDBProfilerAgentCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ type AddAgentQANMySQLPerfSchemaAgentCommand struct {
LogLevel string `enum:"debug,info,warn,error,fatal" default:"warn" help:"Service logging level. One of: [debug, info, warn, error, fatal]"`
}

// RunCmd runs the command for AddAgentQANMySQLPerfSchemaAgentCommand.
func (cmd *AddAgentQANMySQLPerfSchemaAgentCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ type AddAgentQANMySQLSlowlogAgentCommand struct {
LogLevel string `enum:"debug,info,warn,error,fatal" default:"warn" help:"Service logging level. One of: [debug, info, warn, error, fatal]"`
}

// RunCmd executes the AddAgentQANMySQLSlowlogAgentCommand and returns the result.
func (cmd *AddAgentQANMySQLSlowlogAgentCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ type AddAgentQANPostgreSQLPgStatementsAgentCommand struct {
LogLevel string `enum:"debug,info,warn,error,fatal" default:"warn" help:"Service logging level. One of: [debug, info, warn, error, fatal]"`
}

// RunCmd executes the AddAgentQANPostgreSQLPgStatementsAgentCommand and returns the result.
func (cmd *AddAgentQANPostgreSQLPgStatementsAgentCommand) RunCmd() (commands.Result, error) {
customLabels := commands.ParseCustomLabels(cmd.CustomLabels)

Expand Down
Loading

0 comments on commit 65513d9

Please sign in to comment.