From 2cc6cd78f08dbf1b2b8a3514f51b1ad6b7f36607 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Fri, 2 Feb 2024 11:00:06 +0100 Subject: [PATCH] Be a bit more consistent with OpenShift case --- .../cli/src/main/java/io/quarkus/cli/deploy/Kind.java | 4 ++-- .../src/main/java/io/quarkus/cli/deploy/Knative.java | 4 ++-- .../main/java/io/quarkus/cli/deploy/Kubernetes.java | 4 ++-- .../src/main/java/io/quarkus/cli/deploy/Openshift.java | 4 ++-- .../src/main/java/io/quarkus/cli/image/Openshift.java | 4 ++-- docs/src/main/asciidoc/cli-tooling.adoc | 10 +++++----- docs/src/main/asciidoc/deploying-to-kubernetes.adoc | 2 +- docs/src/main/asciidoc/flyway.adoc | 2 +- docs/src/main/asciidoc/init-tasks.adoc | 2 +- docs/src/main/asciidoc/liquibase-mongodb.adoc | 2 +- docs/src/main/asciidoc/liquibase.adoc | 2 +- .../image/openshift/deployment/OpenshiftProcessor.java | 4 ++-- .../io/quarkus/kubernetes/deployment/PropertyUtil.java | 3 ++- 13 files changed, 24 insertions(+), 23 deletions(-) diff --git a/devtools/cli/src/main/java/io/quarkus/cli/deploy/Kind.java b/devtools/cli/src/main/java/io/quarkus/cli/deploy/Kind.java index 7ed69a6a910c1..8714c8c084c78 100644 --- a/devtools/cli/src/main/java/io/quarkus/cli/deploy/Kind.java +++ b/devtools/cli/src/main/java/io/quarkus/cli/deploy/Kind.java @@ -5,8 +5,8 @@ import io.quarkus.cli.BuildToolContext; import picocli.CommandLine; -@CommandLine.Command(name = "kind", sortOptions = false, showDefaultValues = true, mixinStandardHelpOptions = false, header = "Perform the deploy action on kind.", description = "%n" - + "The command will deploy the application on kind.", footer = "%n" +@CommandLine.Command(name = "kind", sortOptions = false, showDefaultValues = true, mixinStandardHelpOptions = false, header = "Perform the deploy action on Kind.", description = "%n" + + "The command will deploy the application on Kind.", footer = "%n" + "For example (using default values), it will create a Deployment named '' using the image with REPOSITORY='${user.name}/' and TAG='' and will deploy it to the target cluster.", headerHeading = "%n", commandListHeading = "%nCommands:%n", synopsisHeading = "%nUsage: ", parameterListHeading = "%n", optionListHeading = "Options:%n") public class Kind extends BaseKubernetesDeployCommand { diff --git a/devtools/cli/src/main/java/io/quarkus/cli/deploy/Knative.java b/devtools/cli/src/main/java/io/quarkus/cli/deploy/Knative.java index 84382b78c974a..8ce127a53f7c7 100644 --- a/devtools/cli/src/main/java/io/quarkus/cli/deploy/Knative.java +++ b/devtools/cli/src/main/java/io/quarkus/cli/deploy/Knative.java @@ -3,8 +3,8 @@ import io.quarkus.cli.BuildToolContext; import picocli.CommandLine; -@CommandLine.Command(name = "knative", sortOptions = false, showDefaultValues = true, mixinStandardHelpOptions = false, header = "Perform the deploy action on knative.", description = "%n" - + "The command will deploy the application on knative.", footer = "%n" +@CommandLine.Command(name = "knative", sortOptions = false, showDefaultValues = true, mixinStandardHelpOptions = false, header = "Perform the deploy action on Knative.", description = "%n" + + "The command will deploy the application on Knative.", footer = "%n" + "For example (using default values), it will create a Deployment named '' using the image with REPOSITORY='${user.name}/' and TAG='' and will deploy it to the target cluster.", headerHeading = "%n", commandListHeading = "%nCommands:%n", synopsisHeading = "%nUsage: ", parameterListHeading = "%n", optionListHeading = "Options:%n") public class Knative extends BaseKubernetesDeployCommand { diff --git a/devtools/cli/src/main/java/io/quarkus/cli/deploy/Kubernetes.java b/devtools/cli/src/main/java/io/quarkus/cli/deploy/Kubernetes.java index 44275ca0a8673..0817b843a4c00 100644 --- a/devtools/cli/src/main/java/io/quarkus/cli/deploy/Kubernetes.java +++ b/devtools/cli/src/main/java/io/quarkus/cli/deploy/Kubernetes.java @@ -5,8 +5,8 @@ import io.quarkus.cli.BuildToolContext; import picocli.CommandLine; -@CommandLine.Command(name = "kubernetes", sortOptions = false, showDefaultValues = true, mixinStandardHelpOptions = false, header = "Perform the deploy action on kubernetes.", description = "%n" - + "The command will deploy the application on kubernetes.", footer = "%n" +@CommandLine.Command(name = "kubernetes", sortOptions = false, showDefaultValues = true, mixinStandardHelpOptions = false, header = "Perform the deploy action on Kubernetes.", description = "%n" + + "The command will deploy the application on Kubernetes.", footer = "%n" + "For example (using default values), it will create a Deployment named '' using the image with REPOSITORY='${user.name}/' and TAG='' and will deploy it to the target cluster.", headerHeading = "%n", commandListHeading = "%nCommands:%n", synopsisHeading = "%nUsage: ", parameterListHeading = "%n", optionListHeading = "Options:%n") public class Kubernetes extends BaseKubernetesDeployCommand { diff --git a/devtools/cli/src/main/java/io/quarkus/cli/deploy/Openshift.java b/devtools/cli/src/main/java/io/quarkus/cli/deploy/Openshift.java index fcfd245e51f07..fbf9d23973d61 100644 --- a/devtools/cli/src/main/java/io/quarkus/cli/deploy/Openshift.java +++ b/devtools/cli/src/main/java/io/quarkus/cli/deploy/Openshift.java @@ -5,8 +5,8 @@ import io.quarkus.cli.BuildToolContext; import picocli.CommandLine; -@CommandLine.Command(name = "openshift", sortOptions = false, showDefaultValues = true, mixinStandardHelpOptions = false, header = "Perform the deploy action on openshift.", description = "%n" - + "The command will deploy the application on openshift.", footer = "%n" +@CommandLine.Command(name = "openshift", sortOptions = false, showDefaultValues = true, mixinStandardHelpOptions = false, header = "Perform the deploy action on OpenShift.", description = "%n" + + "The command will deploy the application on OpenShift.", footer = "%n" + "For example (using default values), it will create a Deployment named '' using the image with REPOSITORY='${user.name}/' and TAG='' and will deploy it to the target cluster.", headerHeading = "%n", commandListHeading = "%nCommands:%n", synopsisHeading = "%nUsage: ", parameterListHeading = "%n", optionListHeading = "Options:%n") public class Openshift extends BaseKubernetesDeployCommand { diff --git a/devtools/cli/src/main/java/io/quarkus/cli/image/Openshift.java b/devtools/cli/src/main/java/io/quarkus/cli/image/Openshift.java index 4aaa822d80af8..5ae380164897f 100644 --- a/devtools/cli/src/main/java/io/quarkus/cli/image/Openshift.java +++ b/devtools/cli/src/main/java/io/quarkus/cli/image/Openshift.java @@ -10,9 +10,9 @@ import io.quarkus.cli.BuildToolContext; import picocli.CommandLine; -@CommandLine.Command(name = "openshift", sortOptions = false, showDefaultValues = true, mixinStandardHelpOptions = false, header = "Build a container image using Openshift.", description = "%n" +@CommandLine.Command(name = "openshift", sortOptions = false, showDefaultValues = true, mixinStandardHelpOptions = false, header = "Build a container image using OpenShift.", description = "%n" + "This command will build or push a container image for the project, using Openshift.", footer = "%n" - + "For example (using default values), it will create a container image in Openshift using the docker build strategy with REPOSITORY='${user.name}/' and TAG=''.", headerHeading = "%n", commandListHeading = "%nCommands:%n", synopsisHeading = "%nUsage: ", parameterListHeading = "%n", optionListHeading = "Options:%n") + + "For example (using default values), it will create a container image in OpenShift using the docker build strategy with REPOSITORY='${user.name}/' and TAG=''.", headerHeading = "%n", commandListHeading = "%nCommands:%n", synopsisHeading = "%nUsage: ", parameterListHeading = "%n", optionListHeading = "Options:%n") public class Openshift extends BaseImageSubCommand implements Callable { private static final String OPENSHIFT = "openshift"; diff --git a/docs/src/main/asciidoc/cli-tooling.adoc b/docs/src/main/asciidoc/cli-tooling.adoc index d363697be730a..51e7a6dcdf233 100644 --- a/docs/src/main/asciidoc/cli-tooling.adoc +++ b/docs/src/main/asciidoc/cli-tooling.adoc @@ -283,13 +283,13 @@ Commands: docker Build a container image using Docker. buildpack Build a container image using Buildpack. jib Build a container image using Jib. - openshift Build a container image using Openshift. + openshift Build a container image using OpenShift. push Push a container image. deploy Deploy application. - kubernetes Perform the deploy action on kubernetes. - openshift Perform the deploy action on openshift. - knative Perform the deploy action on knative. - kind Perform the deploy action on minikube. + kubernetes Perform the deploy action on Kubernetes. + openshift Perform the deploy action on OpenShift. + knative Perform the deploy action on Knative. + kind Perform the deploy action on Kind. minikube Perform the deploy action on minikube. registry Configure Quarkus registry client list List enabled Quarkus registries diff --git a/docs/src/main/asciidoc/deploying-to-kubernetes.adoc b/docs/src/main/asciidoc/deploying-to-kubernetes.adoc index 382e724a36d14..17744792c7ddd 100644 --- a/docs/src/main/asciidoc/deploying-to-kubernetes.adoc +++ b/docs/src/main/asciidoc/deploying-to-kubernetes.adoc @@ -1474,7 +1474,7 @@ The provided replicas <1>, labels <2> and environment variables <3> were retain === Using common resources -When generating the manifests for multiple deployment targets like Kubernetes, OpenShift or Knative, we can place the common resources in `src/main/kubernetes/common.yml`, so these resources will be integrated into the generated `kubernetes.json`/`kubernetes.yml`, and `openshift.json`/`openshift.yml` files (if you configure the Kubernetes and Openshift extensions at the same time). +When generating the manifests for multiple deployment targets like Kubernetes, OpenShift or Knative, we can place the common resources in `src/main/kubernetes/common.yml`, so these resources will be integrated into the generated `kubernetes.json`/`kubernetes.yml`, and `openshift.json`/`openshift.yml` files (if you configure the Kubernetes and OpenShift extensions at the same time). For example, we can write a ConfigMap resource only once in the file `src/main/kubernetes/common.yml`: diff --git a/docs/src/main/asciidoc/flyway.adoc b/docs/src/main/asciidoc/flyway.adoc index 877aade8cd639..3544d4361e457 100644 --- a/docs/src/main/asciidoc/flyway.adoc +++ b/docs/src/main/asciidoc/flyway.adoc @@ -318,7 +318,7 @@ To change the `wait-for` image which by default is `groundnuty/k8s-wait-for:no-r quarkus.kubernetes.init-task-defaults.wait-for-container.image=my/wait-for-image:1.0 ---- -or on Openshift: +or on OpenShift: [source,properties] diff --git a/docs/src/main/asciidoc/init-tasks.adoc b/docs/src/main/asciidoc/init-tasks.adoc index eaccf6eea7965..939ae65a79c29 100644 --- a/docs/src/main/asciidoc/init-tasks.adoc +++ b/docs/src/main/asciidoc/init-tasks.adoc @@ -31,7 +31,7 @@ The default behavior can change by setting the following property to `false`: quarkus.kubernetes.init-task-defaults.enabled=false ---- -or on Openshift: +or on OpenShift: [source,properties] ---- diff --git a/docs/src/main/asciidoc/liquibase-mongodb.adoc b/docs/src/main/asciidoc/liquibase-mongodb.adoc index 28932c07b33f6..2efb8b798f211 100644 --- a/docs/src/main/asciidoc/liquibase-mongodb.adoc +++ b/docs/src/main/asciidoc/liquibase-mongodb.adoc @@ -180,7 +180,7 @@ To change the `wait-for` image which by default is `groundnuty/k8s-wait-for:no-r quarkus.kubernetes.init-task-defaults.wait-for-container.image=my/wait-for-image:1.0 ---- -or on Openshift: +or on OpenShift: [source,properties] diff --git a/docs/src/main/asciidoc/liquibase.adoc b/docs/src/main/asciidoc/liquibase.adoc index 133226eb895c0..2ab713d5711a7 100644 --- a/docs/src/main/asciidoc/liquibase.adoc +++ b/docs/src/main/asciidoc/liquibase.adoc @@ -264,7 +264,7 @@ To change the `wait-for` image which by default is `groundnuty/k8s-wait-for:no-r quarkus.kubernetes.init-task-defaults.wait-for-container.image=my/wait-for-image:1.0 ---- -or on Openshift: +or on OpenShift: [source,properties] diff --git a/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftProcessor.java b/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftProcessor.java index f445a45abb515..8d4cc5bacc11b 100644 --- a/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftProcessor.java +++ b/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftProcessor.java @@ -275,7 +275,7 @@ public void openshiftBuildFromJar(ContainerImageOpenshiftConfig openshiftConfig, if (openshiftYml.isEmpty()) { LOG.warn( - "No Openshift manifests were generated so no openshift build process will be taking place"); + "No OpenShift manifests were generated so no OpenShift build process will be taking place"); return; } @@ -351,7 +351,7 @@ public void openshiftBuildFromNative(ContainerImageOpenshiftConfig openshiftConf if (openshiftYml.isEmpty()) { LOG.warn( - "No Openshift manifests were generated so no openshift build process will be taking place"); + "No OpenShift manifests were generated so no OpenShift build process will be taking place"); return; } //The contextRoot is where inside the tarball we will add the jars. A null value means everything will be added under '/' while "target" means everything will be added under '/target'. diff --git a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/PropertyUtil.java b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/PropertyUtil.java index 699a5dbc08d02..e03a13c49f1f2 100644 --- a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/PropertyUtil.java +++ b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/PropertyUtil.java @@ -26,7 +26,8 @@ public static void printMessages(String usage, String platform, Property return; } - String platformCapitalized = platform.substring(0, 1).toUpperCase() + platform.substring(1); + String platformCapitalized = platform.replace("openshift", "OpenShift"); + platformCapitalized = platformCapitalized.substring(0, 1).toUpperCase() + platformCapitalized.substring(1); T kubernetesValue = kubernetesProperty.getValue().orElse(null); if (kubernetesValue == null) { // If no kubernetes property is provided, this will be used instead.