Skip to content

Commit

Permalink
remove not support of mdb7
Browse files Browse the repository at this point in the history
  • Loading branch information
nammn committed Nov 6, 2023
1 parent b4e111a commit a92ed4d
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions controllers/replica_set_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/blang/semver"
"github.com/mongodb/mongodb-kubernetes-operator/pkg/util/envvar"
"os"
"strconv"
"strings"
Expand Down Expand Up @@ -54,8 +52,6 @@ const (

lastSuccessfulConfiguration = "mongodb.com/v1.lastSuccessfulConfiguration"
lastAppliedMongoDBVersion = "mongodb.com/v1.lastAppliedMongoDBVersion"

ignoreMdb7ErrorEnvVar = "IGNORE_MDB_7_ERROR"
)

func init() {
Expand Down Expand Up @@ -626,16 +622,6 @@ func (r *ReplicaSetReconciler) buildService(mdb mdbv1.MongoDBCommunity, portMana
// it checks that the attempted Spec is valid in relation to the Spec that resulted from that last successful configuration.
// The validation also returns the lastSuccessFulConfiguration Spec as mdbv1.MongoDBCommunitySpec.
func (r ReplicaSetReconciler) validateSpec(mdb mdbv1.MongoDBCommunity) (error, *mdbv1.MongoDBCommunitySpec) {
if !envvar.ReadBool(ignoreMdb7ErrorEnvVar) {
semverVersion, err := semver.Make(mdb.Spec.Version)
if err != nil {
r.log.Warnf("could not parse version %v", mdb.Spec.Version)
} else {
if semverVersion.Major >= 7 {
return fmt.Errorf("mongodb >= 7.0.0 is not supported"), nil
}
}
}
lastSuccessfulConfigurationSaved, ok := mdb.Annotations[lastSuccessfulConfiguration]
if !ok {
// First version of Spec
Expand Down

0 comments on commit a92ed4d

Please sign in to comment.