Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
Bugfix/#1751 openshift docker s2i (#1753)
Browse files Browse the repository at this point in the history
* WIP: Code implementation completed

* Refactored affected tests and included new test cases

* Added changelog entry

* Changelog typo
  • Loading branch information
manusa authored and Devang Gaur committed Nov 8, 2019
1 parent 14b5ac2 commit 73878e0
Show file tree
Hide file tree
Showing 4 changed files with 285 additions and 283 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ After this we will switch probably to real [Semantic Versioning 2.0.0](http://se
* Feature #1748: Quarkus generator: Extract base image from configuration.
* Fix #1695: IllegalArgumentException when Spring Boot application.yaml contains integer keys
* Fix #797: spring-boot generator can not handle multi-profile configuration
* Fix #1751: Build Names are suffixed with -*s2i regardless of build strategy

### 4.3.1 (18-10-2019)
* Updated Kubernetes client to 4.6.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
*/
public class OpenshiftBuildService implements BuildService {

private static final String DEFAULT_S2I_BUILD_SUFFIX = "-s2i";

private final OpenShiftClient client;
private final Logger log;
private ServiceHub dockerServiceHub;
Expand Down Expand Up @@ -309,7 +311,7 @@ private BuildStrategy createBuildStrategy(ImageConfiguration imageConfig, OpenSh
.withNoCache(checkForNocache(imageConfig))
.withEnv(checkForEnv(imageConfig))
.endDockerStrategy().build();

if (openshiftPullSecret != null) {
buildStrategy.getDockerStrategy().setPullSecret(new LocalObjectReferenceBuilder()
.withName(openshiftPullSecret)
Expand Down Expand Up @@ -698,7 +700,13 @@ private void addImageStreamToFile(File imageStreamFile, ImageName imageName, Ope
// == Utility methods ==========================

private String getS2IBuildName(BuildServiceConfig config, ImageName imageName) {
return imageName.getSimpleName() + config.getS2iBuildNameSuffix();
final StringBuilder s2IBuildName = new StringBuilder(imageName.getSimpleName());
if (!StringUtils.isEmpty(config.getS2iBuildNameSuffix())) {
s2IBuildName.append(config.getS2iBuildNameSuffix());
} else if (config.getOpenshiftBuildStrategy() == OpenShiftBuildStrategy.s2i) {
s2IBuildName.append(DEFAULT_S2I_BUILD_SUFFIX);
}
return s2IBuildName.toString();
}

private String getImageStreamName(ImageName name) {
Expand Down
Loading

0 comments on commit 73878e0

Please sign in to comment.