use of io.stackgres.common.crd.storages.BackupStorage in project stackgres by ongres.
the class BackupConfigSourceValidatorTest method setAzureBlobCredentials.
private void setAzureBlobCredentials(final BackupConfigReview review, String accountName, String accountKey, String accessKeyName, String accessKeyKey) {
BackupStorage storage = review.getRequest().getObject().getSpec().getStorage();
storage.setType("azureblob");
storage.setAzureBlob(new AzureBlobStorage());
storage.getAzureBlob().setAzureCredentials(new AzureBlobStorageCredentials());
storage.getAzureBlob().getAzureCredentials().setSecretKeySelectors(new AzureBlobSecretKeySelector());
AzureBlobSecretKeySelector azureBlobSecretKeySelector = storage.getAzureBlob().getAzureCredentials().getSecretKeySelectors();
azureBlobSecretKeySelector.setAccount(new SecretKeySelector(accountKey, accountName));
azureBlobSecretKeySelector.setAccessKey(new SecretKeySelector(accessKeyKey, accessKeyName));
}
use of io.stackgres.common.crd.storages.BackupStorage in project stackgres by ongres.
the class BackupConfigSourceValidatorTest method getEmptyReview.
private BackupConfigReview getEmptyReview() {
BackupConfigReview review = JsonUtil.readFromJson("backupconfig_allow_request/create.json", BackupConfigReview.class);
review.getRequest().getObject().getSpec().setStorage(new BackupStorage());
return review;
}
use of io.stackgres.common.crd.storages.BackupStorage in project stackgres by ongres.
the class BackupConfigSourceValidatorTest method setGcsCredentials.
private void setGcsCredentials(final BackupConfigReview review, String serviceAccountJsonKeyName, String serviceAccountJsonKeyKey) {
BackupStorage storage = review.getRequest().getObject().getSpec().getStorage();
storage.setType("gcs");
storage.setGcs(new GoogleCloudStorage());
storage.getGcs().setCredentials(new GoogleCloudCredentials());
storage.getGcs().getCredentials().setSecretKeySelectors(new GoogleCloudSecretKeySelector());
GoogleCloudSecretKeySelector awsSecretKeySelector = storage.getGcs().getCredentials().getSecretKeySelectors();
awsSecretKeySelector.setServiceAccountJsonKey(new SecretKeySelector(serviceAccountJsonKeyKey, serviceAccountJsonKeyName));
}
use of io.stackgres.common.crd.storages.BackupStorage in project stackgres by ongres.
the class BackupConfigSourceValidatorTest method setS3Credentials.
private void setS3Credentials(final BackupConfigReview review, String accessKeyIdName, String accessKeyIdKey, String secretAccessKeyName, String secretAccessKeyKey) {
BackupStorage storage = review.getRequest().getObject().getSpec().getStorage();
storage.setType("s3");
storage.setS3(new AwsS3Storage());
storage.getS3().setAwsCredentials(new AwsCredentials());
storage.getS3().getAwsCredentials().setSecretKeySelectors(new AwsSecretKeySelector());
AwsSecretKeySelector awsSecretKeySelector = storage.getS3().getAwsCredentials().getSecretKeySelectors();
awsSecretKeySelector.setAccessKeyId(new SecretKeySelector(accessKeyIdKey, accessKeyIdName));
awsSecretKeySelector.setSecretAccessKey(new SecretKeySelector(secretAccessKeyKey, secretAccessKeyName));
}
use of io.stackgres.common.crd.storages.BackupStorage 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