Skip to content

Commit

Permalink
PMM-7 DBaaS leftovers to remove. (#2539)
Browse files Browse the repository at this point in the history
  • Loading branch information
BupycHuk authored Oct 19, 2023
1 parent b108991 commit 37715cf
Show file tree
Hide file tree
Showing 18 changed files with 70 additions and 307 deletions.
4 changes: 0 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ linters-settings:
goimports:
local-prefixes: github.com/percona/pmm

gomoddirectives:
replace-allow-list:
- github.com/percona-platform/dbaas-api

ireturn:
allow:
- anon
Expand Down
2 changes: 1 addition & 1 deletion Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ clean: clean_swagger ## Remove generated files
test-common: ## Run tests from API (and other shared) packages only (i.e it ignores directories that are explicitly listed)
go test $(shell go list ./... | grep -v -e admin -e agent -e managed -e api-tests -e qan-api2 -e update)

api-test: ## Run API tests on dev env. Use `PMM_KUBECONFIG=/path/to/kubeconfig.yaml make api-test` to run tests for DBaaS
api-test: ## Run API tests on dev env.
go test -count=1 -race -p 1 -v ./api-tests/... -pmm.server-insecure-tls

check: ## Run required checkers and linters
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ See the [PMM Documentation](https://www.percona.com/doc/percona-monitoring-and-m
* Spot critical performance issues faster, understand the root cause of incidents better and troubleshoot them more efficiently.
* Zoom-in, drill-down database performance from node to single query levels. Perform in-depth troubleshooting and performance optimization.
* Built-in Advisors run regular checks of the databases connected to PMM. The checks identify and alert you of potential security threats, performance degradation, data loss and data corruption.
* DBaaS: Create and configure database clusters no matter where the infrastructure is deployed.
* Backup and restore databases up to a specific moment with Point-in-Time-Recovery.

## Architecture
Expand Down
15 changes: 1 addition & 14 deletions api-tests/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,14 @@ var (
// Hostname contains local hostname that is used for generating test data.
Hostname string

// True if -debug or -trace flag is passed.
// Debug is true if -debug or -trace flag is passed.
Debug bool

// RunUpdateTest is true if PMM Server update should be tested.
RunUpdateTest bool

// RunSTTTests is true if STT tests should be run.
RunSTTTests bool

// Kubeconfig contains kubeconfig.
Kubeconfig string
)

// NginxError is an error type for nginx HTML response.
Expand Down Expand Up @@ -129,7 +126,6 @@ func init() {
serverURLF := flag.String("pmm.server-url", "https://admin:admin@localhost/", "PMM Server URL [PMM_SERVER_URL].")
serverInsecureTLSF := flag.Bool("pmm.server-insecure-tls", false, "Skip PMM Server TLS certificate validation [PMM_SERVER_INSECURE_TLS].")
runUpdateTestF := flag.Bool("pmm.run-update-test", false, "Run PMM Server update test [PMM_RUN_UPDATE_TEST].")
kubeconfigF := flag.String("pmm.kubeconfig", "", "Pass kubeconfig file to run DBaaS tests.")

// FIXME we should rethink it once https://jira.percona.com/browse/PMM-5106 is implemented
runSTTTestsF := flag.Bool("pmm.run-stt-tests", false, "Run STT tests that require connected clients [PMM_RUN_STT_TESTS].")
Expand All @@ -144,7 +140,6 @@ func init() {
"PMM_SERVER_INSECURE_TLS": flag.Lookup("pmm.server-insecure-tls"),
"PMM_RUN_UPDATE_TEST": flag.Lookup("pmm.run-update-test"),
"PMM_RUN_STT_TESTS": flag.Lookup("pmm.run-stt-tests"),
"PMM_KUBECONFIG": flag.Lookup("pmm.kubeconfig"),
} {
env, ok := os.LookupEnv(envVar)
if ok {
Expand Down Expand Up @@ -197,14 +192,6 @@ func init() {
logrus.Fatalf("Failed to detect hostname: %s", err)
}

if *kubeconfigF != "" {
data, err := os.ReadFile(*kubeconfigF)
if err != nil {
logrus.Fatalf("Failed to read kubeconfig: %s", err)
}
Kubeconfig = string(data)
}

transport := Transport(BaseURL, *serverInsecureTLSF)
alertmanagerTransport := Transport(BaseURL, *serverInsecureTLSF)
alertmanagerTransport.BasePath = "/alertmanager/api/v2"
Expand Down
50 changes: 20 additions & 30 deletions api/managementpb/azure/json/azure.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"swagger": "2.0",
"info": {
"title": "PMM DBaaS API",
"title": "PMM Azure API",
"version": "v1beta1"
},
"paths": {
Expand Down Expand Up @@ -185,33 +185,25 @@
"code": {
"type": "integer",
"format": "int32",
"x-order": 1
"x-order": 0
},
"details": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type_url": {
"@type": {
"type": "string",
"x-order": 0
},
"value": {
"type": "string",
"format": "byte",
"x-order": 1
}
}
},
"additionalProperties": false
},
"x-order": 3
},
"error": {
"type": "string",
"x-order": 0
"x-order": 2
},
"message": {
"type": "string",
"x-order": 2
"x-order": 1
}
}
}
Expand All @@ -228,6 +220,7 @@
"operationId": "DiscoverAzureDatabase",
"parameters": [
{
"description": "DiscoverAzureDatabaseRequest discover azure databases request.",
"name": "body",
"in": "body",
"required": true,
Expand Down Expand Up @@ -343,39 +336,36 @@
"code": {
"type": "integer",
"format": "int32",
"x-order": 1
"x-order": 0
},
"details": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type_url": {
"@type": {
"type": "string",
"x-order": 0
},
"value": {
"type": "string",
"format": "byte",
"x-order": 1
}
}
},
"additionalProperties": false
},
"x-order": 3
},
"error": {
"type": "string",
"x-order": 0
"x-order": 2
},
"message": {
"type": "string",
"x-order": 2
"x-order": 1
}
}
}
}
}
}
}
}
},
"tags": [
{
"name": "AzureDatabase"
}
]
}

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

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

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

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

11 changes: 11 additions & 0 deletions api/managementpb/azure/json/header.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"swagger": "2.0",
"info": {
"title": "PMM Azure API",
"version": "v1beta1"
},
"schemes": [
"https",
"http"
]
}
Loading

0 comments on commit 37715cf

Please sign in to comment.