Skip to content

Commit

Permalink
Fix Intersmash#37: fix service labels
Browse files Browse the repository at this point in the history
  • Loading branch information
tommaso-borgato committed May 30, 2023
1 parent 8637709 commit d0393fb
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void deploy() {
ApplicationBuilder appBuilder = ApplicationBuilder.fromImage(dbApplication.getName(), getImage(),
Collections.singletonMap(APP_LABEL_KEY, dbApplication.getName()));

final DeploymentConfigBuilder builder = appBuilder.deploymentConfig();
final DeploymentConfigBuilder builder = appBuilder.deploymentConfig(dbApplication.getName());
builder.podTemplate().container().envVars(getImageVariables()).port(getPort());

configureContainer(builder.podTemplate().container());
Expand All @@ -95,9 +95,9 @@ public void deploy() {
new PVCBuilder(pvc.getClaimName()).accessRWX().storageSize("100Mi").build());
}

appBuilder.service().port(getPort())
appBuilder.service(getServiceName()).port(getPort())
.addContainerSelector("deploymentconfig", dbApplication.getName())
.addContainerSelector("app", dbApplication.getName());
.addContainerSelector("name", dbApplication.getName());

customizeApplicationBuilder(appBuilder);

Expand Down Expand Up @@ -141,14 +141,14 @@ public String getUrl(String routeName, boolean secure) {
* @return service name to access the database
*/
public String getServiceName() {
return dbApplication.getName();
return dbApplication.getName() + "-service";
}

/**
* @return name of the secret containing username and password for the database
*/
public String getSecretName() {
return dbApplication.getName();
return dbApplication.getName() + "-credentials";
}

}

0 comments on commit d0393fb

Please sign in to comment.