Class MongoShardedUtil
java.lang.Object
io.debezium.testing.system.tools.databases.mongodb.sharded.MongoShardedUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddCertificatesToDeployment(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.static voidaddKeyFileToDeployment(io.fabric8.kubernetes.api.model.apps.Deployment deployment) Modify the mongodb deployment to use keyfile for internal authentication.static StringcreateCertUserCommand(String subjectName) Get command that creates a user (with correct permissions for debezium usage) in mongodb for x509 client authentication.static StringcreatePasswordUserCommand(String userName, String password) static StringcreateRootUserCommand(String userName, String password) executeMongoShOnPod(OpenShiftUtils ocpUtils, String project, io.fabric8.kubernetes.api.model.apps.Deployment deployment, String connectionString, String command, boolean debugLogs) static List<MongoShardKey>intRange(int count)
-
Constructor Details
-
MongoShardedUtil
public MongoShardedUtil()
-
-
Method Details
-
intRange
-
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:
IOExceptionfreemarker.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:
IOExceptionfreemarker.template.TemplateException
-
getTestShardKeys
-
createRootUserCommand
-
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-
-