Skip to content
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

feat(halyard): Add support for the new java8 containers #1485

Merged
merged 2 commits into from
Dec 17, 2019
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -5951,9 +5951,10 @@ This is only required when Spinnaker is being deployed in non-Kubernetes cluster
* `--git-origin-user`: This is the git user your github fork exists under.
* `--git-upstream-user`: This is the upstream git user you are configuring to pull changes from & push PRs to.
* `--image-variant`: The container image variant type to use when deploying a distributed installation of Spinnaker.
Warning: variants other than the 'slim' one are only available with Spinnaker v1.16+
slim: Based on an Alpine image
ubuntu: Based on Canonical's ubuntu:bionic image.
java8: A variant of slim that uses the Java 8 runtime
ubuntu-java8: A variant of ubuntu that uses the Java 8 runtime
Default value: slim
* `--liveness-probe-enabled`: When true, enable Kubernetes liveness probes on Spinnaker services deployed in a Distributed installation. See docs for more information: [https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/)
* `--liveness-probe-initial-delay-seconds`: The number of seconds to wait before performing the first liveness probe. Should be set to the longest service startup time. See docs for more information: [https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,10 @@ public class EditDeploymentEnvironmentCommand extends AbstractConfigCommand {
names = "--image-variant",
description =
"The container image variant type to use when deploying a distributed installation of Spinnaker.\n"
+ "Warning: variants other than the 'slim' one are only available with Spinnaker v1.16+\n"
+ "\tslim: Based on an Alpine image\n"
+ "\tubuntu: Based on Canonical's ubuntu:bionic image.\n"
+ "\tjava8: A variant of slim that uses the Java 8 runtime\n"
+ "\tubuntu-java8: A variant of ubuntu that uses the Java 8 runtime\n"
+ "Default value: slim",
converter = ImageVariantConverter.class)
private ImageVariant imageVariant;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ public static Size fromString(String name) {

public enum ImageVariant {
SLIM("Based on an Alpine image"),
UBUNTU("Based on Canonical's ubuntu:bionic image");
UBUNTU("Based on Canonical's ubuntu:bionic image"),
JAVA8("A variant of SLIM that uses the Java 8 runtime"),
UBUNTU_JAVA8("A variant of UBUNTU that uses the Java 8 runtime");

@Getter final String description;

Expand All @@ -102,17 +104,18 @@ public enum ImageVariant {
}

public static ImageVariant fromString(String name) {
for (ImageVariant variant : values()) {
if (variant.toString().equalsIgnoreCase(name)) {
return variant;
}
try {
return ImageVariant.valueOf(name.toUpperCase().replace('-', '_'));
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException(
String.format(
"ImageVariant \"%s\" is not a valid choice. The options are: %s",
name, Arrays.toString(ImageVariant.values())));
}
}

throw new IllegalArgumentException(
"ImageVariant \""
+ name
+ "\" is not a valid choice. The options are: "
+ Arrays.toString(ImageVariant.values()));
public String getContainerSuffix() {
return name().toLowerCase().replace("_", "-");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ default String getArtifactId(DeploymentConfiguration deploymentConfiguration) {
// versions >= 1.16.0
tag = version;
} else {
tag = String.format("%s-%s", version, imageVariant.toString().toLowerCase());
tag = String.format("%s-%s", version, imageVariant.getContainerSuffix());
}

KubernetesImageDescription image =
Expand Down