Chore: Fix various spelling errors in back-end code (#25241)

* Chore: Fix various spelling errors in back-end code
Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>>
This commit is contained in:
Arve Knudsen
2020-06-01 17:11:25 +02:00
committed by GitHub
co-authored by Sofia Papagiannaki Josh Soref
parent 13787294c6
commit 07582a8e85
60 changed files with 174 additions and 168 deletions
+1 -1
View File
@@ -119,7 +119,7 @@ var adminCommands = []*cli.Command{
{
Name: "encrypt-datasource-passwords",
Usage: "Migrates passwords from unsecured fields to secure_json_data field. Return ok unless there is an error. Safe to execute multiple times.",
Action: runDbCommand(datamigrations.EncryptDatasourcePaswords),
Action: runDbCommand(datamigrations.EncryptDatasourcePasswords),
},
},
},
@@ -25,9 +25,9 @@ var (
}
)
// EncryptDatasourcePaswords migrates un-encrypted secrets on datasources
// EncryptDatasourcePasswords migrates unencrypted secrets on datasources
// to the secureJson Column.
func EncryptDatasourcePaswords(c utils.CommandLine, sqlStore *sqlstore.SqlStore) error {
func EncryptDatasourcePasswords(c utils.CommandLine, sqlStore *sqlstore.SqlStore) error {
return sqlStore.WithDbSession(context.Background(), func(session *sqlstore.DBSession) error {
passwordsUpdated, err := migrateColumn(session, "password")
if err != nil {
@@ -39,22 +39,22 @@ func TestPasswordMigrationCommand(t *testing.T) {
}
_, err := session.Insert(&datasources)
assert.Nil(t, err)
require.NoError(t, err)
// force secure_json_data to be null to verify that migration can handle that
_, err = session.Exec("update data_source set secure_json_data = null where name = 'influxdb'")
assert.Nil(t, err)
require.NoError(t, err)
//run migration
c, err := commandstest.NewCliContext(map[string]string{})
require.Nil(t, err)
err = EncryptDatasourcePaswords(c, sqlstore)
assert.Nil(t, err)
err = EncryptDatasourcePasswords(c, sqlstore)
require.NoError(t, err)
//verify that no datasources still have password or basic_auth
var dss []*models.DataSource
err = session.SQL("select * from data_source").Find(&dss)
assert.Nil(t, err)
require.NoError(t, err)
assert.Equal(t, len(dss), 4)
for _, ds := range dss {
@@ -8,7 +8,7 @@ import (
"github.com/stretchr/testify/assert"
)
func TestVersionComparsion(t *testing.T) {
func TestVersionComparison(t *testing.T) {
t.Run("Validate that version is outdated", func(t *testing.T) {
versions := []models.Version{
{Version: "1.1.1"},