Skip to content

Commit

Permalink
Revert "PMM-11670 Set the cluster label if empty (#2459)"
Browse files Browse the repository at this point in the history
This reverts commit 3c58ed9.
  • Loading branch information
Alex Tymchuk authored Sep 28, 2023
1 parent bbb794f commit 9483977
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 104 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/managed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ jobs:
- name: Run debug commands on failure
if: ${{ failure() }}
run: |
env | sort
go env | sort
env
go version
go env
pwd
git status
kubectl version --short --output json
1 change: 0 additions & 1 deletion api-tests/inventory/nodes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,6 @@ func TestRemoveNode(t *testing.T) {
Address: "localhost",
Port: 3306,
ServiceName: serviceName,
Cluster: serviceName,
},
},
}, listAgentsOK.Payload)
Expand Down
12 changes: 0 additions & 12 deletions api-tests/inventory/services_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ func TestMySQLService(t *testing.T) {
Address: "localhost",
Port: 3306,
ServiceName: serviceName,
Cluster: serviceName,
},
},
}, res)
Expand All @@ -373,7 +372,6 @@ func TestMySQLService(t *testing.T) {
Address: "localhost",
Port: 3306,
ServiceName: serviceName,
Cluster: serviceName,
},
},
}, serviceRes)
Expand Down Expand Up @@ -555,7 +553,6 @@ func TestMongoDBService(t *testing.T) {
ServiceID: serviceID,
NodeID: genericNodeID,
ServiceName: serviceName,
Cluster: serviceName,
Address: "localhost",
Port: 27017,
},
Expand All @@ -576,7 +573,6 @@ func TestMongoDBService(t *testing.T) {
ServiceID: serviceID,
NodeID: genericNodeID,
ServiceName: serviceName,
Cluster: serviceName,
Address: "localhost",
Port: 27017,
},
Expand Down Expand Up @@ -733,7 +729,6 @@ func TestMongoDBService(t *testing.T) {
ServiceID: serviceID,
NodeID: genericNodeID,
ServiceName: serviceName,
Cluster: serviceName,
Socket: "/tmp/mongodb-27017.sock",
},
},
Expand Down Expand Up @@ -775,7 +770,6 @@ func TestPostgreSQLService(t *testing.T) {
DatabaseName: defaultPostgresDBName,
Port: 5432,
ServiceName: serviceName,
Cluster: serviceName,
},
},
}, res)
Expand All @@ -797,7 +791,6 @@ func TestPostgreSQLService(t *testing.T) {
DatabaseName: defaultPostgresDBName,
Port: 5432,
ServiceName: serviceName,
Cluster: serviceName,
},
},
}, serviceRes)
Expand Down Expand Up @@ -980,7 +973,6 @@ func TestProxySQLService(t *testing.T) {
Address: "localhost",
Port: 5432,
ServiceName: serviceName,
Cluster: serviceName,
},
},
}, res)
Expand All @@ -1001,7 +993,6 @@ func TestProxySQLService(t *testing.T) {
Address: "localhost",
Port: 5432,
ServiceName: serviceName,
Cluster: serviceName,
},
},
}, serviceRes)
Expand Down Expand Up @@ -1193,7 +1184,6 @@ func TestExternalService(t *testing.T) {
ServiceID: serviceID,
NodeID: genericNodeID,
ServiceName: serviceName,
Cluster: serviceName,
Group: "redis",
},
},
Expand All @@ -1213,7 +1203,6 @@ func TestExternalService(t *testing.T) {
ServiceID: serviceID,
NodeID: genericNodeID,
ServiceName: serviceName,
Cluster: serviceName,
Group: "redis",
},
},
Expand Down Expand Up @@ -1345,7 +1334,6 @@ func TestExternalService(t *testing.T) {
ServiceID: serviceID,
NodeID: genericNodeID,
ServiceName: serviceName,
Cluster: serviceName,
Group: "external",
},
},
Expand Down
2 changes: 0 additions & 2 deletions api-tests/management/external_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ func TestAddExternal(t *testing.T) {
ServiceID: serviceID,
NodeID: nodeID,
ServiceName: serviceName,
Cluster: serviceName,
Group: "external",
},
}, *serviceOK.Payload)
Expand Down Expand Up @@ -226,7 +225,6 @@ func TestAddExternal(t *testing.T) {
ServiceID: serviceID,
NodeID: nodeID,
ServiceName: serviceName,
Cluster: serviceName,
Group: "external",
},
}, *serviceOK.Payload)
Expand Down
2 changes: 0 additions & 2 deletions api-tests/management/haproxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ func TestAddHAProxy(t *testing.T) {
ServiceID: serviceID,
NodeID: nodeID,
ServiceName: serviceName,
Cluster: serviceName,
},
}, *serviceOK.Payload)

Expand Down Expand Up @@ -226,7 +225,6 @@ func TestAddHAProxy(t *testing.T) {
ServiceID: serviceID,
NodeID: nodeID,
ServiceName: serviceName,
Cluster: serviceName,
},
}, *serviceOK.Payload)

Expand Down
7 changes: 0 additions & 7 deletions api-tests/management/mongodb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ func TestAddMongoDB(t *testing.T) {
ServiceID: serviceID,
NodeID: nodeID,
ServiceName: serviceName,
Cluster: serviceName,
Address: "10.10.10.10",
Port: 27017,
},
Expand Down Expand Up @@ -155,7 +154,6 @@ func TestAddMongoDB(t *testing.T) {
ServiceID: serviceID,
NodeID: nodeID,
ServiceName: serviceName,
Cluster: serviceName,
Address: "10.10.10.10",
Port: 27017,
},
Expand Down Expand Up @@ -391,7 +389,6 @@ func TestAddMongoDB(t *testing.T) {
ServiceID: serviceID,
NodeID: newNodeID,
ServiceName: serviceName,
Cluster: serviceName,
Address: "10.10.10.10",
Port: 27017,
},
Expand Down Expand Up @@ -610,7 +607,6 @@ func TestAddMongoDB(t *testing.T) {
ServiceID: serviceID,
NodeID: nodeID,
ServiceName: serviceName,
Cluster: serviceName,
Socket: "/tmp/mongodb-27017.sock",
},
}, *serviceOK.Payload)
Expand Down Expand Up @@ -682,7 +678,6 @@ func TestAddMongoDB(t *testing.T) {
ServiceID: serviceID,
NodeID: nodeID,
ServiceName: serviceName,
Cluster: serviceName,
Address: "10.10.10.10",
Port: 27017,
},
Expand Down Expand Up @@ -755,7 +750,6 @@ func TestAddMongoDB(t *testing.T) {
ServiceID: serviceID,
NodeID: nodeID,
ServiceName: serviceName,
Cluster: serviceName,
Address: "10.10.10.10",
Port: 27017,
},
Expand Down Expand Up @@ -827,7 +821,6 @@ func TestAddMongoDB(t *testing.T) {
ServiceID: serviceID,
NodeID: nodeID,
ServiceName: serviceName,
Cluster: serviceName,
Address: "10.10.10.10",
Port: 27017,
},
Expand Down
6 changes: 0 additions & 6 deletions api-tests/management/mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ func TestAddMySQL(t *testing.T) {
ServiceID: serviceID,
NodeID: nodeID,
ServiceName: serviceName,
Cluster: serviceName,
Address: "10.10.10.10",
Port: 3306,
},
Expand Down Expand Up @@ -160,7 +159,6 @@ func TestAddMySQL(t *testing.T) {
ServiceID: serviceID,
NodeID: nodeID,
ServiceName: serviceName,
Cluster: serviceName,
Address: "10.10.10.10",
Port: 3306,
},
Expand Down Expand Up @@ -415,7 +413,6 @@ func TestAddMySQL(t *testing.T) {
ServiceID: serviceID,
NodeID: newNodeID,
ServiceName: serviceName,
Cluster: serviceName,
Address: "10.10.10.10",
Port: 27017,
},
Expand Down Expand Up @@ -669,7 +666,6 @@ func TestAddMySQL(t *testing.T) {
ServiceID: serviceID,
NodeID: nodeID,
ServiceName: serviceName,
Cluster: serviceName,
Address: "10.10.10.10",
Port: 3306,
},
Expand Down Expand Up @@ -745,7 +741,6 @@ func TestAddMySQL(t *testing.T) {
ServiceID: serviceID,
NodeID: nodeID,
ServiceName: serviceName,
Cluster: serviceName,
Address: "10.10.10.10",
Port: 3306,
},
Expand Down Expand Up @@ -820,7 +815,6 @@ func TestAddMySQL(t *testing.T) {
ServiceID: serviceID,
NodeID: nodeID,
ServiceName: serviceName,
Cluster: serviceName,
Address: "10.10.10.10",
Port: 3306,
},
Expand Down
7 changes: 0 additions & 7 deletions api-tests/management/postgresql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ func TestAddPostgreSQL(t *testing.T) {
ServiceID: serviceID,
NodeID: nodeID,
ServiceName: serviceName,
Cluster: serviceName,
DatabaseName: defaultPostgresDBName,
Address: "10.10.10.10",
Port: 5432,
Expand Down Expand Up @@ -162,7 +161,6 @@ func TestAddPostgreSQL(t *testing.T) {
ServiceID: serviceID,
NodeID: nodeID,
ServiceName: serviceName,
Cluster: serviceName,
DatabaseName: defaultPostgresDBName,
Address: "10.10.10.10",
Port: 5432,
Expand Down Expand Up @@ -263,7 +261,6 @@ func TestAddPostgreSQL(t *testing.T) {
ServiceID: serviceID,
NodeID: nodeID,
ServiceName: serviceName,
Cluster: serviceName,
DatabaseName: defaultPostgresDBName,
Address: "10.10.10.10",
Port: 5432,
Expand Down Expand Up @@ -413,7 +410,6 @@ func TestAddPostgreSQL(t *testing.T) {
ServiceID: serviceID,
NodeID: newNodeID,
ServiceName: serviceName,
Cluster: serviceName,
DatabaseName: defaultPostgresDBName,
Address: "10.10.10.10",
Port: 27017,
Expand Down Expand Up @@ -640,7 +636,6 @@ func TestAddPostgreSQL(t *testing.T) {
ServiceID: serviceID,
NodeID: nodeID,
ServiceName: serviceName,
Cluster: serviceName,
DatabaseName: defaultPostgresDBName,
Address: "10.10.10.10",
Port: 5432,
Expand Down Expand Up @@ -716,7 +711,6 @@ func TestAddPostgreSQL(t *testing.T) {
ServiceID: serviceID,
NodeID: nodeID,
ServiceName: serviceName,
Cluster: serviceName,
DatabaseName: defaultPostgresDBName,
Address: "10.10.10.10",
Port: 5432,
Expand Down Expand Up @@ -791,7 +785,6 @@ func TestAddPostgreSQL(t *testing.T) {
ServiceID: serviceID,
NodeID: nodeID,
ServiceName: serviceName,
Cluster: serviceName,
DatabaseName: defaultPostgresDBName,
Address: "10.10.10.10",
Port: 5432,
Expand Down
16 changes: 7 additions & 9 deletions api-tests/management/proxysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ func TestAddProxySQL(t *testing.T) {
ServiceID: serviceID,
NodeID: nodeID,
ServiceName: serviceName,
Cluster: serviceName,
Address: "10.10.10.10",
Port: 3306,
},
Expand Down Expand Up @@ -156,7 +155,6 @@ func TestAddProxySQL(t *testing.T) {
ServiceID: serviceID,
NodeID: nodeID,
ServiceName: serviceName,
Cluster: serviceName,
Address: "10.10.10.10",
Port: 3306,
},
Expand Down Expand Up @@ -262,12 +260,13 @@ func TestAddProxySQL(t *testing.T) {
params := &proxysql.AddProxySQLParams{
Context: pmmapitests.Context,
Body: proxysql.AddProxySQLBody{
NodeID: nodeID,
PMMAgentID: pmmAgentID,
ServiceName: serviceName,
Address: "10.10.10.10",
Port: 3306,
Username: "username",
NodeID: nodeID,
PMMAgentID: pmmAgentID,
ServiceName: serviceName,
Address: "10.10.10.10",
Port: 3306,
Username: "username",

SkipConnectionCheck: true,
},
}
Expand Down Expand Up @@ -387,7 +386,6 @@ func TestAddProxySQL(t *testing.T) {
ServiceID: serviceID,
NodeID: newNodeID,
ServiceName: serviceName,
Cluster: serviceName,
Address: "10.10.10.10",
Port: 27017,
},
Expand Down
3 changes: 0 additions & 3 deletions managed/models/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -915,9 +915,6 @@ var databaseSchema = [][]string{
`ALTER TABLE agents
ALTER COLUMN comments_parsing_disabled DROP DEFAULT`,
},
85: {
`UPDATE services SET cluster = service_name WHERE cluster = ''`,
},
}

// ^^^ Avoid default values in schema definition. ^^^
Expand Down
Loading

0 comments on commit 9483977

Please sign in to comment.