use of io.stackgres.common.crd.storages.AwsS3CompatibleStorage in project stackgres by ongres.
the class BackupConfigSourceValidatorTest method setS3CompatibleCredentials.
private void setS3CompatibleCredentials(final BackupConfigReview review, String accessKeyIdName, String accessKeyIdKey, String secretAccessKeyName, String secretAccessKeyKey) {
BackupStorage storage = review.getRequest().getObject().getSpec().getStorage();
storage.setType("s3compatible");
storage.setS3Compatible(new AwsS3CompatibleStorage());
storage.getS3Compatible().setAwsCredentials(new AwsCredentials());
storage.getS3Compatible().getAwsCredentials().setSecretKeySelectors(new AwsSecretKeySelector());
AwsSecretKeySelector awsSecretKeySelector = storage.getS3Compatible().getAwsCredentials().getSecretKeySelectors();
awsSecretKeySelector.setAccessKeyId(new SecretKeySelector(accessKeyIdKey, accessKeyIdName));
awsSecretKeySelector.setSecretAccessKey(new SecretKeySelector(secretAccessKeyKey, secretAccessKeyName));
}
Aggregations