Skip to content

Commit

Permalink
Merge pull request #680 from atlanhq/DVX-503
Browse files Browse the repository at this point in the history
Fixes for cloud-agnostic fallbacks
  • Loading branch information
cmgrote committed Jun 5, 2024
2 parents 82a81bc + f70b090 commit 81e4784
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
14 changes: 14 additions & 0 deletions package-toolkit/config/src/main/resources/Renderers.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,14 @@ class ConfigMapEntry extends NamedPair {
hidden configMapName: String
hidden configMapKey: String
hidden default: String? = null
hidden optional: Boolean? = null
hidden fixed value = new Mapping {
["configMapKeyRef"] = new Mapping {
["name"] = configMapName
["key"] = configMapKey
when (optional != null) {
["optional"] = optional
}
}
}
}
Expand All @@ -475,10 +479,14 @@ class NamedSecret extends NamedPair {
["secretKeyRef"] = new Mapping {
["name"] = secretName
["key"] = secretKey
when (optional != null) {
["optional"] = optional
}
}
}
hidden secretName: String
hidden secretKey: String
hidden optional: Boolean? = null
}

local class NestedConfig extends NamedPair {
Expand Down Expand Up @@ -863,31 +871,37 @@ local class WorkflowContainer {
name = "AWS_S3_BUCKET_NAME"
configMapName = "atlan-defaults"
configMapKey = "bucket"
optional = true
}
new ConfigMapEntry {
name = "AWS_S3_REGION"
configMapName = "atlan-defaults"
configMapKey = "region"
optional = true
}
new ConfigMapEntry {
name = "GCP_STORAGE_BUCKET"
configMapName = "atlan-defaults"
configMapKey = "bucket"
optional = true
}
new NamedSecret {
name = "GCP_PROJECT_ID"
secretName = "bucket-details-secret"
secretKey = "GCP_PROJECT_ID"
optional = true
}
new NamedSecret {
name = "AZURE_STORAGE_ACCESS_KEY"
secretName = "azurestorage"
secretKey = "AZURE_STORAGE_ACCESS_KEY"
optional = true
}
new NamedSecret {
name = "AZURE_STORAGE_ACCOUNT"
secretName = "azurestorage"
secretKey = "AZURE_STORAGE_ACCOUNT"
optional = true
}
new NamedSecret {
name = "CLIENT_ID"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ import java.io.FileOutputStream
* @param projectId identifier of the GCP project
* @param bucketName name of the bucket in GCS to use for syncing
* @param logger through which to record any problems
* @param credentials path to JSON application credentials
* @param credentials JSON application credentials (as a string), or empty to use Atlan's backing store
*/
class GCSSync(
private val projectId: String,
private val bucketName: String,
private val logger: KLogger,
private val credentials: String?,
private val credentials: String,
) : ObjectStorageSyncer {
private val storage = if (credentials != null) {
private val storage = if (credentials.isNotBlank()) {
StorageOptions.newBuilder().setProjectId(projectId)
.setCredentials(GoogleCredentials.fromStream(credentials.byteInputStream()))
.build().service
Expand Down

0 comments on commit 81e4784

Please sign in to comment.