Skip to content

Commit

Permalink
chore(artifacts): remove reference to artifact-store.enabled (#6114)
Browse files Browse the repository at this point in the history
and always construct artifact store-related beans

since spinnaker/kork#1120 removes the artifact-store.enabled
property such that ArtifactStore beans are always present.
  • Loading branch information
dbyron-sf authored Nov 27, 2023
1 parent f11ef95 commit 456f39d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,6 @@ ThreadPoolTaskScheduler threadPoolTaskScheduler(
}

@Bean
@ConditionalOnExpression("${artifact-store.enabled:false}")
ArtifactDeserializer artifactDeserializer(
ArtifactStore storage, @Qualifier("artifactObjectMapper") ObjectMapper objectMapper) {
return new ArtifactDeserializer(objectMapper, storage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ import org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticSearc
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
import org.springframework.boot.autoconfigure.batch.BatchAutoConfiguration
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
import org.springframework.boot.autoconfigure.groovy.template.GroovyTemplateAutoConfiguration
import org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
Expand Down Expand Up @@ -88,20 +86,12 @@ class Main extends SpringBootServletInitializer {

@Bean
@Primary
@ConditionalOnBean(value = ArtifactDeserializer.class)
ObjectMapper objectMapper(Jackson2ObjectMapperBuilder builder) {
return builder.createXmlMapper(false)
.mixIn(Artifact.class, ArtifactMixin.class)
.build()
}

@Bean
@Primary
@ConditionalOnMissingBean(value = ArtifactDeserializer.class)
ObjectMapper jacksonObjectMapper(Jackson2ObjectMapperBuilder builder) {
return builder.createXmlMapper(false).build()
}

@Override
SpringApplicationBuilder configure(SpringApplicationBuilder application) {
application
Expand All @@ -110,8 +100,8 @@ class Main extends SpringBootServletInitializer {
}

/**
* Used to deserialize artifacts utilizing an artifact store if it is enabled,
* and thus bypassing the default deserializer on the artifact object itself.
* Used to deserialize artifacts utilizing an artifact store, and thus
* bypassing the default deserializer on the artifact object itself.
*/
@JsonDeserialize(using = ArtifactDeserializer.class)
private static interface ArtifactMixin{}
Expand Down

0 comments on commit 456f39d

Please sign in to comment.