Skip to content

Commit ea5b26e

Browse files
committed
Remove dead functions
1 parent 1b3bd7d commit ea5b26e

File tree

2 files changed

+1
-72
lines changed

2 files changed

+1
-72
lines changed

gateway/gateway-controller/pkg/storage/sql_store.go

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,38 +1509,6 @@ func (s *sqlStore) Close() error {
15091509
return nil
15101510
}
15111511

1512-
// addDeploymentConfigs adds deployment configuration details to the database
1513-
func (s *sqlStore) addDeploymentConfigs(cfg *models.StoredConfig) (bool, error) {
1514-
query := `INSERT INTO deployment_configs (id, configuration, source_configuration) VALUES (?, ?, ?)`
1515-
1516-
stmt, err := s.prepare(query)
1517-
if err != nil {
1518-
return false, fmt.Errorf("failed to prepare statement: %w", err)
1519-
}
1520-
defer stmt.Close()
1521-
1522-
configJSON, err := json.Marshal(cfg.Configuration)
1523-
if err != nil {
1524-
return false, fmt.Errorf("failed to marshal configuration: %w", err)
1525-
}
1526-
sourceConfigJSON, err := json.Marshal(cfg.SourceConfiguration)
1527-
if err != nil {
1528-
return false, fmt.Errorf("failed to marshal source configuration: %w", err)
1529-
}
1530-
1531-
_, err = stmt.Exec(
1532-
cfg.ID,
1533-
string(configJSON),
1534-
string(sourceConfigJSON),
1535-
)
1536-
1537-
if err != nil {
1538-
return false, fmt.Errorf("failed to insert deployment configuration: %w", err)
1539-
}
1540-
1541-
return true, nil
1542-
}
1543-
15441512
func (s *sqlStore) addDeploymentConfigsTx(tx *sqlStoreTx, cfg *models.StoredConfig) (bool, error) {
15451513
query := `INSERT INTO deployment_configs (id, configuration, source_configuration) VALUES (?, ?, ?)`
15461514

@@ -1571,45 +1539,6 @@ func (s *sqlStore) addDeploymentConfigsTx(tx *sqlStoreTx, cfg *models.StoredConf
15711539
return true, nil
15721540
}
15731541

1574-
// updateDeploymentConfigs updates deployment configuration details in the database
1575-
func (s *sqlStore) updateDeploymentConfigs(cfg *models.StoredConfig) (bool, error) {
1576-
query := `UPDATE deployment_configs SET configuration = ?, source_configuration = ? WHERE id = ?`
1577-
1578-
stmt, err := s.prepare(query)
1579-
if err != nil {
1580-
return false, fmt.Errorf("failed to prepare statement: %w", err)
1581-
}
1582-
defer stmt.Close()
1583-
1584-
configJSON, err := json.Marshal(cfg.Configuration)
1585-
if err != nil {
1586-
return false, fmt.Errorf("failed to marshal configuration: %w", err)
1587-
}
1588-
sourceConfigJSON, err := json.Marshal(cfg.SourceConfiguration)
1589-
if err != nil {
1590-
return false, fmt.Errorf("failed to marshal source configuration: %w", err)
1591-
}
1592-
1593-
result, err := stmt.Exec(
1594-
string(configJSON),
1595-
string(sourceConfigJSON),
1596-
cfg.ID,
1597-
)
1598-
if err != nil {
1599-
return false, fmt.Errorf("failed to update deployment configuration: %w", err)
1600-
}
1601-
1602-
rows, err := result.RowsAffected()
1603-
if err != nil {
1604-
return false, fmt.Errorf("failed to get rows affected: %w", err)
1605-
}
1606-
if rows == 0 {
1607-
return false, fmt.Errorf("no deployment config found for id=%s", cfg.ID)
1608-
}
1609-
1610-
return true, nil
1611-
}
1612-
16131542
func (s *sqlStore) updateDeploymentConfigsTx(tx *sqlStoreTx, cfg *models.StoredConfig) (bool, error) {
16141543
query := `UPDATE deployment_configs SET configuration = ?, source_configuration = ? WHERE id = ?`
16151544

gateway/it/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ test-postgres:
6060
COMPOSE_FILE=docker-compose.test.postgres.yaml $(MAKE) test
6161

6262
# Run tests with verbose output
63-
test-verbose:
63+
test-verbose: ensure-test-tags
6464
COMPOSE_FILE=$(COMPOSE_FILE) go test -v -count=1 -timeout 30m ./...
6565

6666
# Clean up test artifacts

0 commit comments

Comments
 (0)