This repository was archived by the owner on May 28, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-13
lines changed
pkg/resources/statefulsets Expand file tree Collapse file tree 1 file changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ import (
34
34
"github.com/oracle/mysql-operator/pkg/resources/secrets"
35
35
"github.com/oracle/mysql-operator/pkg/version"
36
36
37
- goverion "github.com/hashicorp /go-version "
37
+ "github.com/coreos /go-semver/semver "
38
38
)
39
39
40
40
const (
@@ -159,22 +159,24 @@ func getReplicationGroupSeeds(name string, members int) string {
159
159
return strings .Join (seeds , "," )
160
160
}
161
161
162
- func checkSupportGroupExitStateArgs (deployingVersion string ) bool {
163
- ver , err := goverion .NewVersion (deployingVersion )
164
- if err != nil {
165
- return false
166
- }
162
+ func checkSupportGroupExitStateArgs (deployingVersion string ) (supportedVer bool ) {
163
+ defer func () {
164
+ if r := recover (); r != nil {
167
165
168
- minVer , err := goverion .NewVersion (minMysqlVersionWithGroupExitStateArgs )
169
- if err != nil {
170
- return false
171
- }
166
+ }
167
+ }()
168
+
169
+ supportedVer = false
170
+
171
+ ver := semver .New (deployingVersion )
172
+ minVer := semver .New (minMysqlVersionWithGroupExitStateArgs )
172
173
173
- if ver .GreaterThan ( minVer ) || ver . Equal ( minVer ) {
174
- return true
174
+ if ver .LessThan ( * minVer ) {
175
+ return
175
176
}
176
177
177
- return false
178
+ supportedVer = true
179
+ return
178
180
}
179
181
180
182
// Builds the MySQL operator container for a cluster.
You can’t perform that action at this time.
0 commit comments