java.lang.Object
io.debezium.testing.system.tools.databases.mongodb.sharded.MongoShardedUtil

public class MongoShardedUtil extends Object
  • Constructor Details

    • MongoShardedUtil

      public MongoShardedUtil()
  • Method Details

    • intRange

      public static List<Integer> intRange(int count)
    • executeMongoShOnPod

      public static OpenShiftUtils.CommandOutputs executeMongoShOnPod(OpenShiftUtils ocpUtils, String project, io.fabric8.kubernetes.api.model.apps.Deployment deployment, String connectionString, String command, boolean debugLogs)
    • createPasswordUserCommand

      public static String createPasswordUserCommand(String userName, String password) throws IOException, freemarker.template.TemplateException
      Throws:
      IOException
      freemarker.template.TemplateException
    • createCertUserCommand

      public static String createCertUserCommand(String subjectName) throws IOException, freemarker.template.TemplateException
      Get command that creates a user (with correct permissions for debezium usage) in mongodb for x509 client authentication.
      Parameters:
      subjectName - must match the subject of certificate used to authenticate user
      Returns:
      mongo command string
      Throws:
      IOException
      freemarker.template.TemplateException
    • getTestShardKeys

      public static List<MongoShardKey> getTestShardKeys()
    • createRootUserCommand

      public static String createRootUserCommand(String userName, String password)
    • addKeyFileToDeployment

      public static void addKeyFileToDeployment(io.fabric8.kubernetes.api.model.apps.Deployment deployment)
      Modify the mongodb deployment to use keyfile for internal authentication. Mutually exclusive with using x509 certificates for internal auth
      Parameters:
      deployment -
    • addCertificatesToDeployment

      public static void addCertificatesToDeployment(io.fabric8.kubernetes.api.model.apps.Deployment deployment)
      Modify the mongodb deployment object to mount server and ca certificates (from configMap, name is set by constant) and use them in mongodb deployment for internal and client authentication. Mutually exclusive with using keyfile for internal auth
      Parameters:
      deployment -