diff --git a/build.gradle b/build.gradle
index e4dea1f45..55373dbce 100644
--- a/build.gradle
+++ b/build.gradle
@@ -74,13 +74,6 @@ subprojects { project ->
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
testRuntimeOnly("org.objenesis:objenesis")
}
- // Keep this constraint till all other components get bumped up to this version and subsequently updated in the kork.
- configurations.all {
- resolutionStrategy.force 'com.google.apis:google-api-services-storage:v1-rev20200326-1.30.9'
- resolutionStrategy.force 'com.google.auth:google-auth-library-oauth2-http:0.20.0'
- // TODO(plumpy): remove version once added to kork
- resolutionStrategy.force 'com.google.cloud:google-cloud-storage:1.108.0'
- }
}
}
diff --git a/front50-gcs/src/main/kotlin/com/netflix/spinnaker/front50/model/GcsStorageService.kt b/front50-gcs/src/main/kotlin/com/netflix/spinnaker/front50/model/GcsStorageService.kt
index adcdff6ac..58abab87e 100644
--- a/front50-gcs/src/main/kotlin/com/netflix/spinnaker/front50/model/GcsStorageService.kt
+++ b/front50-gcs/src/main/kotlin/com/netflix/spinnaker/front50/model/GcsStorageService.kt
@@ -31,6 +31,8 @@ import com.google.common.collect.ImmutableMap
import com.google.common.util.concurrent.Futures
import com.netflix.spinnaker.front50.api.model.Timestamped
import com.netflix.spinnaker.kork.web.exceptions.NotFoundException
+import net.logstash.logback.argument.StructuredArguments
+import org.slf4j.LoggerFactory
import java.io.IOException
import java.time.Duration
import java.util.concurrent.ExecutorService
@@ -38,8 +40,6 @@ import java.util.concurrent.Future
import java.util.concurrent.TimeUnit
import java.util.concurrent.TimeoutException
import javax.annotation.PostConstruct
-import net.logstash.logback.argument.StructuredArguments
-import org.slf4j.LoggerFactory
class GcsStorageService(
private val storage: Storage,
@@ -206,7 +206,11 @@ class GcsStorageService(
try {
// Calling update() is enough to change the modification time on the file, which is all we
// care about. It doesn't matter if we don't actually specify any fields to change.
- storage.update(blobInfo)
+
+ //if last-modified does not exist, throw exception to create it
+ val lastModified = storage.get(lastModifiedBlobId(objectType)) ?: throw StorageException(404, "no object $blobInfo.bucket/$blobInfo.name")
+ val lastUpdated = lastModified.toBuilder().setMetadata(mapOf("updateTrigger" to System.currentTimeMillis().toString())).build()
+ storage.update(lastUpdated)
} catch (e: Exception) {
when {
e is StorageException && e.code == 404 ->
diff --git a/front50-gcs/src/test/kotlin/com/netflix/spinnaker/front50/model/FakeStorageRpc.kt b/front50-gcs/src/test/kotlin/com/netflix/spinnaker/front50/model/FakeStorageRpc.kt
index 0fcc19b5c..ed2683194 100644
--- a/front50-gcs/src/test/kotlin/com/netflix/spinnaker/front50/model/FakeStorageRpc.kt
+++ b/front50-gcs/src/test/kotlin/com/netflix/spinnaker/front50/model/FakeStorageRpc.kt
@@ -18,6 +18,7 @@
package com.netflix.spinnnaker.front50.model
import com.google.api.client.util.DateTime
+import com.google.api.services.storage.Storage
import com.google.api.services.storage.model.Bucket
import com.google.api.services.storage.model.BucketAccessControl
import com.google.api.services.storage.model.HmacKey
@@ -103,13 +104,12 @@ internal class FakeStorageRpc(private val clock: Clock) : StorageRpc {
override fun patch(storageObject: StorageObject, options: MutableMap