File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ package cmd
1818import (
1919 "github.com/ProxySQL/dbdeployer/common"
2020 "github.com/ProxySQL/dbdeployer/globals"
21+ "github.com/ProxySQL/dbdeployer/providers"
2122 "github.com/ProxySQL/dbdeployer/sandbox"
2223 "github.com/spf13/cobra"
2324)
@@ -28,6 +29,15 @@ func multipleSandbox(cmd *cobra.Command, args []string) {
2829 flags := cmd .Flags ()
2930 sd , err := fillSandboxDefinition (cmd , args , false )
3031 common .ErrCheckExitf (err , 1 , "error filling sandbox definition" )
32+ // Validate version with provider
33+ // TODO: Phase 2b — determine provider from sd.Flavor instead of hardcoding "mysql"
34+ p , provErr := providers .DefaultRegistry .Get ("mysql" )
35+ if provErr != nil {
36+ common .Exitf (1 , "provider error: %s" , provErr )
37+ }
38+ if provErr = p .ValidateVersion (sd .Version ); provErr != nil {
39+ common .Exitf (1 , "version validation failed: %s" , provErr )
40+ }
3141 nodes , _ := flags .GetInt (globals .NodesLabel )
3242 sd .SBType = "multiple"
3343 origin := args [0 ]
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ package cmd
1818import (
1919 "github.com/ProxySQL/dbdeployer/common"
2020 "github.com/ProxySQL/dbdeployer/globals"
21+ "github.com/ProxySQL/dbdeployer/providers"
2122 "github.com/ProxySQL/dbdeployer/sandbox"
2223 "github.com/spf13/cobra"
2324)
@@ -28,6 +29,15 @@ func replicationSandbox(cmd *cobra.Command, args []string) {
2829 common .CheckOrigin (args )
2930 sd , err := fillSandboxDefinition (cmd , args , false )
3031 common .ErrCheckExitf (err , 1 , "error filling sandbox definition : %s" , err )
32+ // Validate version with provider
33+ // TODO: Phase 2b — determine provider from sd.Flavor instead of hardcoding "mysql"
34+ p , provErr := providers .DefaultRegistry .Get ("mysql" )
35+ if provErr != nil {
36+ common .Exitf (1 , "provider error: %s" , provErr )
37+ }
38+ if provErr = p .ValidateVersion (sd .Version ); provErr != nil {
39+ common .Exitf (1 , "version validation failed: %s" , provErr )
40+ }
3141 if sd .Flavor == common .TiDbFlavor {
3242 common .Exitf (1 , "flavor '%s' is not suitable to create replication sandboxes" , common .TiDbFlavor )
3343 }
You can’t perform that action at this time.
0 commit comments