Skip to content

Commit 4185323

Browse files
committed
fix(storage): allow disabling presigned transfers for managed storage
1 parent 2651a48 commit 4185323

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

internal/controller/common/resource_definitions/resource_definitions.go

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,15 +1761,22 @@ func newStorageEnvForCoreContainer(cr *model.CryostatInstance, specs *ServiceSpe
17611761
Name: "QUARKUS_S3_AWS_REGION",
17621762
Value: "us-east-1",
17631763
},
1764-
{
1765-
Name: "STORAGE_PRESIGNED_TRANSFERS_ENABLED",
1766-
Value: "true",
1767-
},
1768-
{
1769-
Name: "STORAGE_PRESIGNED_DOWNLOADS_ENABLED",
1770-
Value: "false",
1771-
},
17721764
}...)
1765+
1766+
disablePresignedFileTransfers := false
1767+
if cr.Spec.ObjectStorageOptions.Provider != nil && cr.Spec.ObjectStorageOptions.Provider.DisablePresignedFileTransfers != nil {
1768+
disablePresignedFileTransfers = *cr.Spec.ObjectStorageOptions.Provider.DisablePresignedFileTransfers
1769+
}
1770+
envs = append(envs, corev1.EnvVar{
1771+
Name: "STORAGE_PRESIGNED_TRANSFERS_ENABLED",
1772+
Value: strconv.FormatBool(!disablePresignedFileTransfers),
1773+
})
1774+
if cr.Spec.ObjectStorageOptions.Provider != nil && cr.Spec.ObjectStorageOptions.Provider.DisablePresignedDownloads != nil {
1775+
envs = append(envs, corev1.EnvVar{
1776+
Name: "STORAGE_PRESIGNED_DOWNLOADS_ENABLED",
1777+
Value: strconv.FormatBool(!*cr.Spec.ObjectStorageOptions.Provider.DisablePresignedDownloads),
1778+
})
1779+
}
17731780
} else {
17741781
if cr.Spec.ObjectStorageOptions.Provider.URL == nil {
17751782
return nil, fmt.Errorf("cr.Spec.ObjectStorageOptions was not nil, but cr.Spec.ObjectStorageOptions.Provider.URL was nil")

0 commit comments

Comments
 (0)