Skip to content

Commit

Permalink
Fix #1043
Browse files Browse the repository at this point in the history
  • Loading branch information
mgubaidullin committed Jan 3, 2024
1 parent 37a0d29 commit ee5a7e8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ public OpenShiftClient openshiftClient() {
@ConfigProperty(name = "karavan.builder.service.account")
public String builderServiceAccount;

@ConfigProperty(name = "karavan.version")
String version;
@ConfigProperty(name = "karavan.secret.name", defaultValue = "karavan")
String secretName;

List<SharedIndexInformer> informers = new ArrayList<>(INFORMERS);

Expand Down Expand Up @@ -230,28 +230,28 @@ private Pod getBuilderPod(String name, List<String> env, Map<String, String> lab
});

envVars.add(
new EnvVar("IMAGE_REGISTRY", null, new EnvVarSourceBuilder().withSecretKeyRef(new SecretKeySelector("image-registry", SECRET_NAME, false)).build())
new EnvVar("IMAGE_REGISTRY", null, new EnvVarSourceBuilder().withSecretKeyRef(new SecretKeySelector("image-registry", secretName, false)).build())
);
envVars.add(
new EnvVar("IMAGE_REGISTRY_USERNAME", null, new EnvVarSourceBuilder().withSecretKeyRef(new SecretKeySelector("image-registry-username", SECRET_NAME, false)).build())
new EnvVar("IMAGE_REGISTRY_USERNAME", null, new EnvVarSourceBuilder().withSecretKeyRef(new SecretKeySelector("image-registry-username", secretName, false)).build())
);
envVars.add(
new EnvVar("IMAGE_REGISTRY_PASSWORD", null, new EnvVarSourceBuilder().withSecretKeyRef(new SecretKeySelector("image-registry-password", SECRET_NAME, false)).build())
new EnvVar("IMAGE_REGISTRY_PASSWORD", null, new EnvVarSourceBuilder().withSecretKeyRef(new SecretKeySelector("image-registry-password", secretName, false)).build())
);
envVars.add(
new EnvVar("IMAGE_GROUP", null, new EnvVarSourceBuilder().withSecretKeyRef(new SecretKeySelector("image-group", SECRET_NAME, false)).build())
new EnvVar("IMAGE_GROUP", null, new EnvVarSourceBuilder().withSecretKeyRef(new SecretKeySelector("image-group", secretName, false)).build())
);
envVars.add(
new EnvVar("GIT_REPOSITORY", null, new EnvVarSourceBuilder().withSecretKeyRef(new SecretKeySelector("git-repository", SECRET_NAME, false)).build())
new EnvVar("GIT_REPOSITORY", null, new EnvVarSourceBuilder().withSecretKeyRef(new SecretKeySelector("git-repository", secretName, false)).build())
);
envVars.add(
new EnvVar("GIT_USERNAME", null, new EnvVarSourceBuilder().withSecretKeyRef(new SecretKeySelector("git-username", SECRET_NAME, false)).build())
new EnvVar("GIT_USERNAME", null, new EnvVarSourceBuilder().withSecretKeyRef(new SecretKeySelector("git-username", secretName, false)).build())
);
envVars.add(
new EnvVar("GIT_PASSWORD", null, new EnvVarSourceBuilder().withSecretKeyRef(new SecretKeySelector("git-password", SECRET_NAME, false)).build())
new EnvVar("GIT_PASSWORD", null, new EnvVarSourceBuilder().withSecretKeyRef(new SecretKeySelector("git-password", secretName, false)).build())
);
envVars.add(
new EnvVar("GIT_BRANCH", null, new EnvVarSourceBuilder().withSecretKeyRef(new SecretKeySelector("git-branch", SECRET_NAME, false)).build())
new EnvVar("GIT_BRANCH", null, new EnvVarSourceBuilder().withSecretKeyRef(new SecretKeySelector("git-branch", secretName, false)).build())
);

ObjectMeta meta = new ObjectMetaBuilder()
Expand Down Expand Up @@ -558,13 +558,13 @@ private void createService(String name, Map<String, String> labels) {

public Secret getKaravanSecret() {
try (KubernetesClient client = kubernetesClient()) {
return client.secrets().inNamespace(getNamespace()).withName("karavan").get();
return client.secrets().inNamespace(getNamespace()).withName(secretName).get();
}
}

public String getKaravanSecret(String key) {
try (KubernetesClient client = kubernetesClient()) {
Secret secret = client.secrets().inNamespace(getNamespace()).withName("karavan").get();
Secret secret = client.secrets().inNamespace(getNamespace()).withName(secretName).get();
Map<String, String> data = secret.getData();
return decodeSecret(data.get(key));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public class Constants {
public static final String BUILDER_SUFFIX = "-builder";

public static final String CAMEL_PREFIX = "camel";
public static final String SECRET_NAME = "karavan";
public static final String KARAVAN_PREFIX = "karavan";
public static final String JBANG_CACHE_SUFFIX = "jbang-cache";
public static final String M2_CACHE_SUFFIX = "m2-cache";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ karavan.devmode.image=ghcr.io/apache/camel-karavan-devmode:4.3.1
karavan.devmode.create-pvc=false
karavan.devmode.service.account=karavan
karavan.builder.service.account=karavan
karavan.secret.name=karavan
karavan.maven.cache=

karavan.docker.network=karavan
Expand Down
2 changes: 1 addition & 1 deletion karavan-web/karavan-app/src/main/webui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ee5a7e8

Please sign in to comment.