Skip to content

Commit

Permalink
feat: add customizable server image through spec (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosthe19916 authored Aug 1, 2024
1 parent ddbd09e commit 766a056
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
import java.util.List;

public record TrustifySpec(
@JsonPropertyDescription("Custom Trustify Server image to be used. For internal use only")
String serverImage,

@JsonPropertyDescription("Custom Image Pull Policy for images managed by the Operator")
String imagePullPolicy,

@JsonPropertyDescription("Secret(s) that might be used when pulling an image from a private container image registry or repository.")
List<LocalObjectReference> imagePullSecrets,

Expand All @@ -33,6 +39,8 @@ public TrustifySpec() {
null,
null,
null,
null,
null,
null
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;

Expand Down Expand Up @@ -97,8 +98,8 @@ private DeploymentSpec getDeploymentSpec(Trustify cr, Context<Trustify> context,
.getMandatory(Constants.CONTEXT_LABELS_KEY, Map.class);

Map<String, String> selectorLabels = Constants.SERVER_SELECTOR_LABELS;
String image = config.serverImage();
String imagePullPolicy = config.imagePullPolicy();
String image = Optional.ofNullable(cr.getSpec().serverImage()).orElse(config.serverImage());
String imagePullPolicy = Optional.ofNullable(cr.getSpec().imagePullPolicy()).orElse(config.imagePullPolicy());

List<EnvVar> envVars = distConfigurator.getAllEnvVars();
List<Volume> volumes = distConfigurator.getAllVolumes();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ quarkus.container-image.tag=v${quarkus.application.version}
quarkus.operator-sdk.crd.apply=true

# Operator config
related.image.server=${RELATED_IMAGE_SERVER:ghcr.io/trustification/trustd:0.1.0-alpha.11}
related.image.server=${RELATED_IMAGE_SERVER:ghcr.io/trustification/trustd:0.1.0-alpha.12}
related.image.db=quay.io/sclorg/postgresql-15-c9s:latest
related.image.pull-policy=Always

Expand Down

0 comments on commit 766a056

Please sign in to comment.