Skip to content

Commit

Permalink
Merge pull request #281 from flanksource/cleanup-metadata
Browse files Browse the repository at this point in the history
fix: remove comments and tabs from properties file
  • Loading branch information
moshloop authored Jul 12, 2023
2 parents 64532f0 + 137530b commit 1a516d7
Show file tree
Hide file tree
Showing 7 changed files with 945 additions and 55 deletions.
6 changes: 5 additions & 1 deletion db/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/flanksource/commons/logger"
"github.com/flanksource/duty"
"github.com/flanksource/duty/migrate"
"github.com/jackc/pgx/v5/pgxpool"
"github.com/spf13/pflag"
"gorm.io/gorm"
Expand Down Expand Up @@ -63,7 +64,10 @@ func Init(connection string) error {
}

if runMigrations {
if err = duty.Migrate(connection, nil); err != nil {
opts := &migrate.MigrateOptions{
IgnoreFiles: []string{"012_changelog.sql"},
}
if err = duty.Migrate(connection, opts); err != nil {
return err
}
}
Expand Down
70 changes: 42 additions & 28 deletions fixtures/expected/file-git.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,48 @@
"source": "github.com/flanksource/canary-checker/fixtures/minimal/http_pass_single.yaml",
"id": "http-pass-single",
"config_class": "Canary",
"config": {
"apiVersion": "canaries.flanksource.com/v1",
"kind": "Canary",
"metadata": {
"labels": {
"canary": "http"
},
"name": "http-pass-single"
},
"spec": {
"http": [
{
"endpoint": "https://httpbin.demo.aws.flanksource.com/status/200",
"maxSSLExpiry": 7,
"name": "sample-check",
"responseCodes": [
201,
200,
301
],
"responseContent": "",
"test": {
"expr": "code == 200"
"config":{
"apiVersion": "canaries.flanksource.com/v1",
"kind": "Canary",
"metadata": {
"labels": {
"canary": "http"
},
"thresholdMillis": 3000
"name": "http-pass-single"
},
"spec": {
"http": [
{
"endpoint": "https://httpbin.demo.aws.flanksource.com/status/200",
"name": "http-deprecated-endpoint"
},
{
"name": "http-minimal-check",
"url": "https://httpbin.demo.aws.flanksource.com/status/200"
},
{
"maxSSLExpiry": 7,
"name": "http-param-tests",
"responseCodes": [
201,
200,
301
],
"responseContent": "",
"url": "https://httpbin.demo.aws.flanksource.com/status/200"
},
{
"display": {
"template": "code={{.code}}, age={{.sslAge}}"
},
"name": "http-expr-tests",
"test": {
"expr": "code in [200,201,301] and sslAge \u003e Duration('7d')"
},
"url": "https://httpbin.demo.aws.flanksource.com/status/200"
}
],
"interval": 30
}
],
"interval": 30
}
}
}
}]
61 changes: 61 additions & 0 deletions fixtures/expected/file-postgres-properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
[{
"last_modified": "0001-01-01T00:00:00Z",
"id": "postgresql-properties",
"config_class": "PostgreSQLProperties",
"config":{
"authentication_timeout": "1min",
"checkpoint_completion_target": "0.5",
"checkpoint_flush_after": "256kB",
"cluster_name": "'main'",
"cron.database_name": "'postgres'",
"data_directory": "'/var/lib/postgresql/data'",
"db_user_namespace": "off",
"default_text_search_config": "'pg_catalog.english'",
"effective_cache_size": "128MB",
"extra_float_digits": "0",
"hba_file": "'/etc/postgresql/pg_hba.conf'",
"ident_file": "'/etc/postgresql/pg_ident.conf'",
"jit_provider": "'llvmjit'",
"lc_messages": "'en_US.UTF-8'",
"lc_monetary": "'en_US.UTF-8'",
"lc_numeric": "'en_US.UTF-8'",
"lc_time": "'en_US.UTF-8'",
"listen_addresses": "'*'",
"log_destination": "'csvlog'",
"log_directory": "'/var/log/postgresql'",
"log_file_mode": "0640",
"log_filename": "'postgresql.log'",
"log_line_prefix": "'%h %m [%p] %q%u@%d '",
"log_rotation_age": "0",
"log_rotation_size": "0",
"log_statement": "'all'",
"log_timezone": "'UTC'",
"logging_collector": "on",
"max_replication_slots": "5",
"max_slot_wal_keep_size": "1024",
"max_wal_senders": "10",
"password_encryption": "scram-sha-256",
"pgsodium.getkey_script": "'/usr/lib/postgresql/14/bin/pgsodium_getkey_urandom.sh'",
"pljava.libjvm_location": "'/usr/lib/jvm/java-11-openjdk-amd64/lib/server/libjvm.so'",
"row_security": "on",
"shared_buffers": "128MB",
"shared_preload_libraries": "'pg_stat_statements, pgaudit, plpgsql, plpgsql_check, pg_cron, pg_net, pgsodium'",
"ssl": "off",
"ssl_ca_file": "''",
"ssl_cert_file": "''",
"ssl_ciphers": "'HIGH:MEDIUM:+3DES:!aNULL'",
"ssl_crl_dir": "''",
"ssl_crl_file": "''",
"ssl_dh_params_file": "''",
"ssl_ecdh_curve": "'prime256v1'",
"ssl_key_file": "''",
"ssl_max_protocol_version": "''",
"ssl_min_protocol_version": "'TLSv1.2'",
"ssl_passphrase_command": "''",
"ssl_passphrase_command_supports_reload": "off",
"ssl_prefer_server_ciphers": "on",
"timezone": "'UTC'",
"unix_socket_directories": "'/var/run/postgresql'",
"wal_level": "logical"
}
}]
Loading

0 comments on commit 1a516d7

Please sign in to comment.