diff --git a/Makefile b/Makefile index 80c1125..96a1538 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ NAMESPACE=severalnines NAME=clustercontrol BINARY=terraform-provider-${NAME} TARGET=./bin/${BINARY} -VERSION=0.2.21 +VERSION=0.2.22 OS_ARCH=darwin_amd64 TARGET_DIR=~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH} diff --git a/examples/elastic/versions.tf b/examples/elastic/versions.tf index bafd2e1..d88b840 100644 --- a/examples/elastic/versions.tf +++ b/examples/elastic/versions.tf @@ -2,7 +2,7 @@ # required_providers { # clustercontrol = { # source = "severalnines/clustercontrol" -# version = ">=0.2.0" +# version = ">=0.2.22" # } # } # } @@ -13,7 +13,7 @@ terraform { required_providers { clustercontrol = { source = "severalnines.com/severalnines/clustercontrol" - version = ">= 0.1" + version = ">= 0.2.22" } } diff --git a/examples/mongo/replicaset/versions.tf b/examples/mongo/replicaset/versions.tf index c1433f5..b9a8f4e 100644 --- a/examples/mongo/replicaset/versions.tf +++ b/examples/mongo/replicaset/versions.tf @@ -2,7 +2,7 @@ terraform { required_providers { clustercontrol = { source = "severalnines/clustercontrol" - version = ">=0.2.0" + version = ">=0.2.22" } } } @@ -11,7 +11,7 @@ terraform { # required_providers { # clustercontrol = { # source = "severalnines.com/severalnines/clustercontrol" -# version = ">= 0.1" +# version = ">= 0.2.22" # } # } # } \ No newline at end of file diff --git a/examples/mongo/sharded-replicaset/versions.tf b/examples/mongo/sharded-replicaset/versions.tf index c1433f5..b9a8f4e 100644 --- a/examples/mongo/sharded-replicaset/versions.tf +++ b/examples/mongo/sharded-replicaset/versions.tf @@ -2,7 +2,7 @@ terraform { required_providers { clustercontrol = { source = "severalnines/clustercontrol" - version = ">=0.2.0" + version = ">=0.2.22" } } } @@ -11,7 +11,7 @@ terraform { # required_providers { # clustercontrol = { # source = "severalnines.com/severalnines/clustercontrol" -# version = ">= 0.1" +# version = ">= 0.2.22" # } # } # } \ No newline at end of file diff --git a/examples/mssql/multi/versions.tf b/examples/mssql/multi/versions.tf index c1433f5..b9a8f4e 100644 --- a/examples/mssql/multi/versions.tf +++ b/examples/mssql/multi/versions.tf @@ -2,7 +2,7 @@ terraform { required_providers { clustercontrol = { source = "severalnines/clustercontrol" - version = ">=0.2.0" + version = ">=0.2.22" } } } @@ -11,7 +11,7 @@ terraform { # required_providers { # clustercontrol = { # source = "severalnines.com/severalnines/clustercontrol" -# version = ">= 0.1" +# version = ">= 0.2.22" # } # } # } \ No newline at end of file diff --git a/examples/mssql/single/versions.tf b/examples/mssql/single/versions.tf index c1433f5..b9a8f4e 100644 --- a/examples/mssql/single/versions.tf +++ b/examples/mssql/single/versions.tf @@ -2,7 +2,7 @@ terraform { required_providers { clustercontrol = { source = "severalnines/clustercontrol" - version = ">=0.2.0" + version = ">=0.2.22" } } } @@ -11,7 +11,7 @@ terraform { # required_providers { # clustercontrol = { # source = "severalnines.com/severalnines/clustercontrol" -# version = ">= 0.1" +# version = ">= 0.2.22" # } # } # } \ No newline at end of file diff --git a/examples/mysql-maria/galera/versions.tf b/examples/mysql-maria/galera/versions.tf index c1433f5..b9a8f4e 100644 --- a/examples/mysql-maria/galera/versions.tf +++ b/examples/mysql-maria/galera/versions.tf @@ -2,7 +2,7 @@ terraform { required_providers { clustercontrol = { source = "severalnines/clustercontrol" - version = ">=0.2.0" + version = ">=0.2.22" } } } @@ -11,7 +11,7 @@ terraform { # required_providers { # clustercontrol = { # source = "severalnines.com/severalnines/clustercontrol" -# version = ">= 0.1" +# version = ">= 0.2.22" # } # } # } \ No newline at end of file diff --git a/examples/mysql-maria/replication/versions.tf b/examples/mysql-maria/replication/versions.tf index 7c177f0..b9a8f4e 100644 --- a/examples/mysql-maria/replication/versions.tf +++ b/examples/mysql-maria/replication/versions.tf @@ -2,7 +2,7 @@ terraform { required_providers { clustercontrol = { source = "severalnines/clustercontrol" - version = ">=0.2.20" + version = ">=0.2.22" } } } @@ -11,7 +11,7 @@ terraform { # required_providers { # clustercontrol = { # source = "severalnines.com/severalnines/clustercontrol" -# version = ">= 0.2.21" +# version = ">= 0.2.22" # } # } # } \ No newline at end of file diff --git a/examples/postgres/versions.tf b/examples/postgres/versions.tf index 7c177f0..b9a8f4e 100644 --- a/examples/postgres/versions.tf +++ b/examples/postgres/versions.tf @@ -2,7 +2,7 @@ terraform { required_providers { clustercontrol = { source = "severalnines/clustercontrol" - version = ">=0.2.20" + version = ">=0.2.22" } } } @@ -11,7 +11,7 @@ terraform { # required_providers { # clustercontrol = { # source = "severalnines.com/severalnines/clustercontrol" -# version = ">= 0.2.21" +# version = ">= 0.2.22" # } # } # } \ No newline at end of file diff --git a/examples/redis/cluster/versions.tf b/examples/redis/cluster/versions.tf index 985b46a..b9a8f4e 100644 --- a/examples/redis/cluster/versions.tf +++ b/examples/redis/cluster/versions.tf @@ -2,7 +2,7 @@ terraform { required_providers { clustercontrol = { source = "severalnines/clustercontrol" - version = ">=0.2.21" + version = ">=0.2.22" } } } @@ -11,7 +11,7 @@ terraform { # required_providers { # clustercontrol = { # source = "severalnines.com/severalnines/clustercontrol" -# version = ">= 0.2.21" +# version = ">= 0.2.22" # } # } # } \ No newline at end of file diff --git a/examples/redis/sentinel/versions.tf b/examples/redis/sentinel/versions.tf index c1433f5..b9a8f4e 100644 --- a/examples/redis/sentinel/versions.tf +++ b/examples/redis/sentinel/versions.tf @@ -2,7 +2,7 @@ terraform { required_providers { clustercontrol = { source = "severalnines/clustercontrol" - version = ">=0.2.0" + version = ">=0.2.22" } } } @@ -11,7 +11,7 @@ terraform { # required_providers { # clustercontrol = { # source = "severalnines.com/severalnines/clustercontrol" -# version = ">= 0.1" +# version = ">= 0.2.22" # } # } # } \ No newline at end of file diff --git a/examples/valkey/cluster/main.tf b/examples/valkey/cluster/main.tf index 22d566e..5a082e5 100644 --- a/examples/valkey/cluster/main.tf +++ b/examples/valkey/cluster/main.tf @@ -95,10 +95,10 @@ resource "clustercontrol_db_cluster" "this" { # db_backup_retention = var.db_backup_retention # } -# resource "clustercontrol_db_cluster_maintenance" "server-upgrade-03232024" { +# resource "clustercontrol_db_cluster_maintenance" "server-upgrade-12042024" { # depends_on = [clustercontrol_db_cluster.this] # db_cluster_id = clustercontrol_db_cluster.this.id -# db_maint_start_time = "Mar-27-2024T22:00" -# db_maint_stop_time = "Mar-28-2024T22:30" +# db_maint_start_time = "Dec-04-2024T22:00" +# db_maint_stop_time = "Dec-04-2024T22:30" # db_maint_reason = "Hardware refresh March 27, 2024" # } diff --git a/examples/valkey/cluster/versions.tf b/examples/valkey/cluster/versions.tf index 985b46a..b9a8f4e 100644 --- a/examples/valkey/cluster/versions.tf +++ b/examples/valkey/cluster/versions.tf @@ -2,7 +2,7 @@ terraform { required_providers { clustercontrol = { source = "severalnines/clustercontrol" - version = ">=0.2.21" + version = ">=0.2.22" } } } @@ -11,7 +11,7 @@ terraform { # required_providers { # clustercontrol = { # source = "severalnines.com/severalnines/clustercontrol" -# version = ">= 0.2.21" +# version = ">= 0.2.22" # } # } # } \ No newline at end of file diff --git a/examples/valkey/sentinel/versions.tf b/examples/valkey/sentinel/versions.tf index fe3ddff..825eb62 100644 --- a/examples/valkey/sentinel/versions.tf +++ b/examples/valkey/sentinel/versions.tf @@ -2,7 +2,7 @@ # required_providers { # clustercontrol = { # source = "severalnines/clustercontrol" -# version = ">=0.2.21" +# version = ">=0.2.22" # } # } # } @@ -11,7 +11,7 @@ terraform { required_providers { clustercontrol = { source = "severalnines.com/severalnines/clustercontrol" - version = ">= 0.2.21" + version = ">= 0.2.22" } } } \ No newline at end of file diff --git a/internal/provider/constants.go b/internal/provider/constants.go index 8589328..7b39371 100644 --- a/internal/provider/constants.go +++ b/internal/provider/constants.go @@ -20,6 +20,7 @@ const ( CLUSTER_TYPE_MOGNODB = "mongodb" CLUSTER_TYPE_PG_SINGLE = "postgresql_single" CLUSTER_TYPE_REDIS = "redis" + CLUSTER_TYPE_VALKEY = "valkey" CLUSTER_TYPE_REDIS_SHARDED = "redis_sharded" CLUSTER_TYPE_VALKEY_SHARDED = "valkey_sharded" CLUSTER_TYPE_MSSQL_AO_ASYNC = "mssql_ao_async" @@ -49,6 +50,7 @@ const ( EXT_CLUSTER_TYPE_MONGODB = "mongo" EXT_CLUSTER_TYPE_REDIS_SENTINEL = "redis-sentinel" EXT_CLUSTER_TYPE_REDIS_SHARDED = "redis-sharded" + EXT_CLUSTER_TYPE_VALKEY_SENTINEL = "valkey-sentinel" EXT_CLUSTER_TYPE_VALKEY_SHARDED = "valkey-sharded" EXT_CLUSTER_TYPE_ELASTICSEARH = "elasticsearch" EXT_CLUSTER_TYPE_MSSQL_ASYN = "mssql-async" @@ -89,7 +91,7 @@ const ( const ( MYSQL_VERSION_8 = "8.0" MYSQL_VERSION_8_4 = "8.4" - MYSQL_VERSION_5_7 = "5.7" + //MYSQL_VERSION_5_7 = "5.7" ) const ( @@ -101,7 +103,7 @@ const ( MARIADB_VERSION_10_6 = "10.6" MARIADB_VERSION_10_5 = "10.5" MARIADB_VERSION_10_4 = "10.4" - MARIADB_VERSION_10_3 = "10.3" + //MARIADB_VERSION_10_3 = "10.3" ) const ( diff --git a/internal/provider/db_cluster.go b/internal/provider/db_cluster.go index 08a360f..44caddb 100644 --- a/internal/provider/db_cluster.go +++ b/internal/provider/db_cluster.go @@ -709,10 +709,11 @@ func resourceCreateDbCluster(ctx context.Context, d *schema.ResourceData, m inte getInputs = NewMongo() case CLUSTER_TYPE_REDIS: getInputs = NewRedis() + case CLUSTER_TYPE_VALKEY: + getInputs = NewRedis() case CLUSTER_TYPE_REDIS_SHARDED: getInputs = NewRedisSharded() case CLUSTER_TYPE_VALKEY_SHARDED: - //getInputs = NewValkeySharded() getInputs = NewRedisSharded() case CLUSTER_TYPE_MSSQL_SINGLE: getInputs = NewMsSql() @@ -730,15 +731,13 @@ func resourceCreateDbCluster(ctx context.Context, d *schema.ResourceData, m inte return diags } - if getInputs != nil { - if err = getInputs.GetInputs(d, &jobData); err != nil { - slog.Error(err.Error()) - diags = append(diags, diag.Diagnostic{ - Severity: diag.Error, - Summary: "Error getting inputs for ClusterCreate", - }) - return diags - } + if err = getInputs.GetInputs(d, &jobData); err != nil { + slog.Error(err.Error()) + diags = append(diags, diag.Diagnostic{ + Severity: diag.Error, + Summary: "Error getting inputs for ClusterCreate", + }) + return diags } jobSpec.SetJobData(jobData) @@ -869,10 +868,11 @@ func resourceReadDbCluster(ctx context.Context, d *schema.ResourceData, m interf readHandler = NewMongo() case CLUSTER_TYPE_REDIS: readHandler = NewRedis() + case CLUSTER_TYPE_VALKEY: + readHandler = NewRedis() case CLUSTER_TYPE_REDIS_SHARDED: readHandler = NewRedisSharded() case CLUSTER_TYPE_VALKEY_SHARDED: - //getInputs = NewValkeySharded() readHandler = NewRedisSharded() case CLUSTER_TYPE_MSSQL_SINGLE: readHandler = NewMsSql() @@ -890,15 +890,13 @@ func resourceReadDbCluster(ctx context.Context, d *schema.ResourceData, m interf return diags } - if readHandler != nil { - if err = readHandler.HandleRead(newCtx, d, apiClient, clusterInfo); err != nil { - slog.Error(err.Error()) - diags = append(diags, diag.Diagnostic{ - Severity: diag.Error, - Summary: "Error in DB cluster Read handler", - }) - return diags - } + if err = readHandler.HandleRead(newCtx, d, apiClient, clusterInfo); err != nil { + slog.Error(err.Error()) + diags = append(diags, diag.Diagnostic{ + Severity: diag.Error, + Summary: "Error in DB cluster Read handler", + }) + return diags } d.Set(TF_FIELD_LAST_UPDATED, time.Now().Format(time.RFC822)) @@ -953,10 +951,11 @@ func resourceUpdateDbCluster(ctx context.Context, d *schema.ResourceData, m inte updateHandler = NewMongo() case CLUSTER_TYPE_REDIS: updateHandler = NewRedis() + case CLUSTER_TYPE_VALKEY: + updateHandler = NewRedis() case CLUSTER_TYPE_REDIS_SHARDED: updateHandler = NewRedisSharded() case CLUSTER_TYPE_VALKEY_SHARDED: - //getInputs = NewValkeySharded() updateHandler = NewRedisSharded() case CLUSTER_TYPE_MSSQL_SINGLE: updateHandler = NewMsSql() @@ -974,26 +973,24 @@ func resourceUpdateDbCluster(ctx context.Context, d *schema.ResourceData, m inte return diags } - if updateHandler != nil { - // NOTE: Must always check of the allowed batch of updates is allowed or not. - if err = updateHandler.IsUpdateBatchAllowed(d); err != nil { - slog.Error(err.Error()) - diags = append(diags, diag.Diagnostic{ - Severity: diag.Error, - Summary: "Error in DB cluster update handler", - }) - return diags - } + // NOTE: Must always check of the allowed batch of updates is allowed or not. + if err = updateHandler.IsUpdateBatchAllowed(d); err != nil { + slog.Error(err.Error()) + diags = append(diags, diag.Diagnostic{ + Severity: diag.Error, + Summary: "Error in DB cluster update handler", + }) + return diags + } - // The allowed batch of updates is Good. Therefore, it is a GO for update. Do it... - if err = updateHandler.HandleUpdate(newCtx, d, apiClient, clusterInfo); err != nil { - slog.Error(err.Error()) - diags = append(diags, diag.Diagnostic{ - Severity: diag.Error, - Summary: "Error in DB cluster update handler", - }) - return diags - } + // The allowed batch of updates is Good. Therefore, it is a GO for update. Do it... + if err = updateHandler.HandleUpdate(newCtx, d, apiClient, clusterInfo); err != nil { + slog.Error(err.Error()) + diags = append(diags, diag.Diagnostic{ + Severity: diag.Error, + Summary: "Error in DB cluster update handler", + }) + return diags } d.Set(TF_FIELD_LAST_UPDATED, time.Now().Format(time.RFC822)) diff --git a/internal/provider/db_cluster_backup.go b/internal/provider/db_cluster_backup.go index 5450ad1..3f56039 100644 --- a/internal/provider/db_cluster_backup.go +++ b/internal/provider/db_cluster_backup.go @@ -2,6 +2,7 @@ package provider import ( "context" + "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/severalnines/clustercontrol-client-sdk/go/pkg/openapi" @@ -174,6 +175,12 @@ func resourceCreateDbClusterBackup(ctx context.Context, d *schema.ResourceData, backupHandler = NewMongo() case CLUSTER_TYPE_REDIS: backupHandler = NewRedis() + case CLUSTER_TYPE_VALKEY: + backupHandler = NewRedis() + case CLUSTER_TYPE_REDIS_SHARDED: + backupHandler = NewRedisSharded() + case CLUSTER_TYPE_VALKEY_SHARDED: + backupHandler = NewRedisSharded() case CLUSTER_TYPE_MSSQL_SINGLE: backupHandler = NewMsSql() case CLUSTER_TYPE_MSSQL_AO_ASYNC: @@ -181,18 +188,22 @@ func resourceCreateDbClusterBackup(ctx context.Context, d *schema.ResourceData, case CLUSTER_TYPE_ELASTIC: backupHandler = NewElastic() default: - slog.Warn(funcName, "Unknown cluster type", clusterType) + str := fmt.Sprintf("%s - Unknown cluster type: %s", funcName, clusterType) + slog.Warn(str) + diags = append(diags, diag.Diagnostic{ + Severity: diag.Error, + Summary: str, + }) + return diags } - if backupHandler != nil { - if err = backupHandler.GetBackupInputs(d, &jobData); err != nil { - slog.Error(err.Error()) - diags = append(diags, diag.Diagnostic{ - Severity: diag.Error, - Summary: "Error in DB cluster backup create handler.", - }) - return diags - } + if err = backupHandler.GetBackupInputs(d, &jobData); err != nil { + slog.Error(err.Error()) + diags = append(diags, diag.Diagnostic{ + Severity: diag.Error, + Summary: "Error in DB cluster backup create handler.", + }) + return diags } if err = backupHandler.IsValidBackupOptions(vendor, clusterType, &jobData); err != nil { @@ -292,6 +303,12 @@ func resourceDeleteDbClusterBackup(ctx context.Context, d *schema.ResourceData, backupHandler = NewMongo() case CLUSTER_TYPE_REDIS: backupHandler = NewRedis() + case CLUSTER_TYPE_VALKEY: + backupHandler = NewRedis() + case CLUSTER_TYPE_REDIS_SHARDED: + backupHandler = NewRedisSharded() + case CLUSTER_TYPE_VALKEY_SHARDED: + backupHandler = NewRedisSharded() case CLUSTER_TYPE_MSSQL_SINGLE: backupHandler = NewMsSql() case CLUSTER_TYPE_MSSQL_AO_ASYNC: @@ -299,24 +316,28 @@ func resourceDeleteDbClusterBackup(ctx context.Context, d *schema.ResourceData, case CLUSTER_TYPE_ELASTIC: backupHandler = NewElastic() default: - slog.Warn(funcName, "Unknown cluster type", clusterType) + str := fmt.Sprintf("%s - Unknown cluster type: %s", funcName, clusterType) + slog.Warn(str) + diags = append(diags, diag.Diagnostic{ + Severity: diag.Error, + Summary: str, + }) + return diags } - if backupHandler != nil { - if err = backupHandler.GetBackupInputs(d, &jobData); err != nil { - slog.Error(err.Error()) - diags = append(diags, diag.Diagnostic{ - Severity: diag.Error, - Summary: "Error in DB cluster backup create handler.", - }) - return diags - } - if !backupHandler.IsBackupRemovable(clusterInfo, &jobData) { - d.SetId("") - d.Set(TF_FIELD_LAST_UPDATED, time.Now().Format(time.RFC822)) - // Silently return. Some backups are not removable (e.g. pgbackrest) - return diags - } + if err = backupHandler.GetBackupInputs(d, &jobData); err != nil { + slog.Error(err.Error()) + diags = append(diags, diag.Diagnostic{ + Severity: diag.Error, + Summary: "Error in DB cluster backup create handler.", + }) + return diags + } + if !backupHandler.IsBackupRemovable(clusterInfo, &jobData) { + d.SetId("") + d.Set(TF_FIELD_LAST_UPDATED, time.Now().Format(time.RFC822)) + // Silently return. Some backups are not removable (e.g. pgbackrest) + return diags } deleteBackup.SetClusterId(clusterInfo.GetClusterId()) diff --git a/internal/provider/db_cluster_backup_schedule.go b/internal/provider/db_cluster_backup_schedule.go index f3e368d..f4c6506 100644 --- a/internal/provider/db_cluster_backup_schedule.go +++ b/internal/provider/db_cluster_backup_schedule.go @@ -3,6 +3,7 @@ package provider import ( "context" "encoding/json" + "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/severalnines/clustercontrol-client-sdk/go/pkg/openapi" @@ -188,6 +189,12 @@ func resourceCreateDbClusterBackupSched(ctx context.Context, d *schema.ResourceD backupHandler = NewMongo() case CLUSTER_TYPE_REDIS: backupHandler = NewRedis() + case CLUSTER_TYPE_VALKEY: + backupHandler = NewRedis() + case CLUSTER_TYPE_REDIS_SHARDED: + backupHandler = NewRedisSharded() + case CLUSTER_TYPE_VALKEY_SHARDED: + backupHandler = NewRedisSharded() case CLUSTER_TYPE_MSSQL_SINGLE: backupHandler = NewMsSql() case CLUSTER_TYPE_MSSQL_AO_ASYNC: @@ -195,18 +202,22 @@ func resourceCreateDbClusterBackupSched(ctx context.Context, d *schema.ResourceD case CLUSTER_TYPE_ELASTIC: backupHandler = NewElastic() default: - slog.Warn(funcName, "Unknown cluster type", clusterType) + str := fmt.Sprintf("%s - Unknown cluster type: %s", funcName, clusterType) + slog.Warn(str) + diags = append(diags, diag.Diagnostic{ + Severity: diag.Error, + Summary: str, + }) + return diags } - if backupHandler != nil { - if err = backupHandler.GetBackupInputs(d, &jobData); err != nil { - slog.Error(err.Error()) - diags = append(diags, diag.Diagnostic{ - Severity: diag.Error, - Summary: err.Error(), - }) - return diags - } + if err = backupHandler.GetBackupInputs(d, &jobData); err != nil { + slog.Error(err.Error()) + diags = append(diags, diag.Diagnostic{ + Severity: diag.Error, + Summary: err.Error(), + }) + return diags } if err = backupHandler.IsValidBackupOptions(vendor, clusterType, &jobData); err != nil { diff --git a/internal/provider/globals.go b/internal/provider/globals.go index ed80673..f1a0cf1 100644 --- a/internal/provider/globals.go +++ b/internal/provider/globals.go @@ -14,6 +14,7 @@ var ( CLUSTER_TYPE_PG_SINGLE: DEFAULT_POSTGRES_PORT, CLUSTER_TYPE_MOGNODB: DEFAULT_MONGO_PORT, CLUSTER_TYPE_REDIS: DEFAULT_REDIS_PORT, + CLUSTER_TYPE_VALKEY: DEFAULT_REDIS_PORT, CLUSTER_TYPE_REDIS_SHARDED: DEFAULT_REDIS_PORT, CLUSTER_TYPE_VALKEY_SHARDED: DEFAULT_REDIS_PORT, CLUSTER_TYPE_ELASTIC: DEFAULT_ELASTIC_HTTP_PORT, @@ -29,6 +30,7 @@ var ( EXT_CLUSTER_TYPE_GALERA: CLUSTER_TYPE_GALERA, EXT_CLUSTER_TYPE_MONGODB: CLUSTER_TYPE_MOGNODB, EXT_CLUSTER_TYPE_REDIS_SENTINEL: CLUSTER_TYPE_REDIS, + EXT_CLUSTER_TYPE_VALKEY_SENTINEL: CLUSTER_TYPE_VALKEY, EXT_CLUSTER_TYPE_REDIS_SHARDED: CLUSTER_TYPE_REDIS_SHARDED, EXT_CLUSTER_TYPE_VALKEY_SHARDED: CLUSTER_TYPE_VALKEY_SHARDED, EXT_CLUSTER_TYPE_ELASTICSEARH: CLUSTER_TYPE_ELASTIC, @@ -44,6 +46,7 @@ var ( CLUSTER_TYPE_GALERA: EXT_CLUSTER_TYPE_GALERA, CLUSTER_TYPE_MOGNODB: EXT_CLUSTER_TYPE_MONGODB, CLUSTER_TYPE_REDIS: EXT_CLUSTER_TYPE_REDIS_SENTINEL, + CLUSTER_TYPE_VALKEY: EXT_CLUSTER_TYPE_VALKEY_SENTINEL, CLUSTER_TYPE_REDIS_SHARDED: EXT_CLUSTER_TYPE_REDIS_SHARDED, CLUSTER_TYPE_VALKEY_SHARDED: EXT_CLUSTER_TYPE_VALKEY_SHARDED, CLUSTER_TYPE_ELASTIC: EXT_CLUSTER_TYPE_ELASTICSEARH, @@ -87,6 +90,7 @@ var ( CLUSTER_TYPE_PG_SINGLE: "pgadmin", CLUSTER_TYPE_MOGNODB: "mongoadmin", CLUSTER_TYPE_REDIS: "admin", + CLUSTER_TYPE_VALKEY: "admin", CLUSTER_TYPE_REDIS_SHARDED: "admin", CLUSTER_TYPE_VALKEY_SHARDED: "admin", CLUSTER_TYPE_ELASTIC: "admin", @@ -102,6 +106,7 @@ var ( CLUSTER_TYPE_PG_SINGLE: "", CLUSTER_TYPE_MOGNODB: "/var/lib/mongodb", CLUSTER_TYPE_REDIS: "/var/lib/redis", + CLUSTER_TYPE_VALKEY: "/var/lib/redis", CLUSTER_TYPE_REDIS_SHARDED: "/var/lib/redis", CLUSTER_TYPE_VALKEY_SHARDED: "/var/lib/redis", CLUSTER_TYPE_ELASTIC: "", @@ -263,12 +268,27 @@ var ( "", }, }, - CLUSTER_TYPE_ELASTIC: { // VENDOR_REDIS + CLUSTER_TYPE_VALKEY: { // + VENDOR_VALKEY: { + "", + }, + }, + CLUSTER_TYPE_REDIS_SHARDED: { // + VENDOR_REDIS: { + "", + }, + }, + CLUSTER_TYPE_VALKEY_SHARDED: { // + VENDOR_VALKEY: { + "", + }, + }, + CLUSTER_TYPE_ELASTIC: { // VENDOR_ELASTIC: { "", }, }, - CLUSTER_TYPE_PG_SINGLE: { // VENDOR_REDIS + CLUSTER_TYPE_PG_SINGLE: { // VENDOR_DEFAULT: { BACKUP_METHOD_PG_BASEBACKUP, BACKUP_METHOD_PGDUMPALL, diff --git a/internal/provider/template.go b/internal/provider/template.go index 9ff3ab7..88c4a77 100644 --- a/internal/provider/template.go +++ b/internal/provider/template.go @@ -2,6 +2,10 @@ package provider import "strings" +// ************************************* +// OBSOLETE +// ************************************* + type DbClusterTypeBase struct { ClusterName string ClusterType string @@ -23,7 +27,7 @@ func NewClusterTypeBase(clusterType string, vendor string, version string) *DbCl case MYSQL_VERSION_8: ret.ClusterConfigTemplate = "" break - case MYSQL_VERSION_5_7: + //case MYSQL_VERSION_5_7: ret.ClusterConfigTemplate = "" break default: @@ -39,7 +43,7 @@ func NewClusterTypeBase(clusterType string, vendor string, version string) *DbCl case MARIADB_VERSION_10_6: case MARIADB_VERSION_10_5: case MARIADB_VERSION_10_4: - case MARIADB_VERSION_10_3: + //case MARIADB_VERSION_10_3: ret.ClusterConfigTemplate = "" break default: