Skip to content

fix: add object mapper to config override #1381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import io.fabric8.kubernetes.client.Config;
import io.javaoperatorsdk.operator.api.monitoring.Metrics;

import com.fasterxml.jackson.databind.ObjectMapper;

@SuppressWarnings("unused")
public class ConfigurationServiceOverrider {
private final ConfigurationService original;
Expand All @@ -17,6 +19,7 @@ public class ConfigurationServiceOverrider {
private Cloner cloner;
private int timeoutSeconds;
private boolean closeClientOnStop;
private ObjectMapper objectMapper;
private ExecutorService executorService = null;

ConfigurationServiceOverrider(ConfigurationService original) {
Expand All @@ -28,6 +31,7 @@ public class ConfigurationServiceOverrider {
this.timeoutSeconds = original.getTerminationTimeoutSeconds();
this.metrics = original.getMetrics();
this.closeClientOnStop = original.closeClientOnStop();
this.objectMapper = original.getObjectMapper();
}


Expand Down Expand Up @@ -71,6 +75,11 @@ public ConfigurationServiceOverrider withExecutorService(ExecutorService executo
return this;
}

public ConfigurationServiceOverrider withObjectMapper(ObjectMapper objectMapper) {
this.objectMapper = objectMapper;
return this;
}

public ConfigurationService build() {
return new BaseConfigurationService(original.getVersion()) {
@Override
Expand Down Expand Up @@ -121,6 +130,11 @@ public ExecutorService getExecutorService() {
return super.getExecutorService();
}
}

@Override
public ObjectMapper getObjectMapper() {
return objectMapper;
}
};
}

Expand Down