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

Disable TLS in LRA quickstart #836

Merged
merged 1 commit into from
Jan 9, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ function isOptimizedModeDisabled() {
echo "0"
}

# Whether to disable TLS route.
# Default is to not do anything.
# To disable TLS routes, override this method change the body to 'echo "1"'
function disableTlsRoute() {
echo ""
}

# If the Helm variables set by the parent script (e.g. 'build.enabled') need a prefix, return
# that here. If e.g "wildfly." is returned, the resulting 'build.enabled' becomes 'wildfly.build.enabled'
function getHelmSetVariablePrefix() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Use insecure route for this QS
function disableTlsRoute() {
echo "1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ fi
# These functions are from overridable-functions.sh
application=$(applicationName "${qs_dir}")
helm_set_arg_prefix=$(getHelmSetVariablePrefix)
server_protocol="https"
disableTlsRoute=$(disableTlsRoute)
if [ "1" = "${disableTlsRoute}" ]; then
server_protocol="http"
fi

################################################################################################
# Install any pre-requisites. Function is from overridable-functions.sh
Expand Down Expand Up @@ -183,7 +188,7 @@ if [ "${QS_UNSIGNED_SERVER_CERT}" = "1" ]; then
fi


mvnVerifyArguments="-Dserver.host=https://${route} ${QS_MAVEN_REPOSITORY} ${truststore_properties}"
mvnVerifyArguments="-Dserver.host=${server_protocol}://${route} ${QS_MAVEN_REPOSITORY} ${truststore_properties}"
extraMvnVerifyArguments="$(getMvnVerifyExtraArguments)"
echo "Verify Arguments: ${mvnVerifyArguments}"
if [ -n "${extraMvnVerifyArguments}" ]; then
Expand Down
1 change: 1 addition & 0 deletions microprofile-lra/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The `microprofile-lra` quickstart demonstrates the use of the MicroProfile LRA s
:custom-bootable-jar-layers:
:custom-openshift-layers:
:extra-openshift-test-arguments:
:requires-http-route:

== What is it?

Expand Down
5 changes: 4 additions & 1 deletion microprofile-lra/charts/helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ build:
ref: main
contextDir: microprofile-lra
deploy:
replicas: 1
replicas: 1
route:
tls:
enabled: false
16 changes: 16 additions & 0 deletions shared-doc/helm-deploy-project.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ oc get deployment {helm-app-name}

The Helm Chart for this quickstart contains all the information to build an image from the source code using S2I on Java 17:

ifndef::requires-http-route[]
[source,options="nowrap",subs="+attributes"]
----
build:
Expand All @@ -32,6 +33,21 @@ build:
deploy:
replicas: 1
----
endif::requires-http-route[]
ifdef::requires-http-route[]
[source,options="nowrap",subs="+attributes"]
----
build:
uri: {githubRepoCodeUrl}
ref: {WildFlyQuickStartRepoTag}
contextDir: {artifactId}
deploy:
replicas: 1
route:
tls:
enabled: false
----
endif::requires-http-route[]

This will create a new deployment on OpenShift and deploy the application.

Expand Down
8 changes: 8 additions & 0 deletions shared-doc/run-integration-tests-with-openshift.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,18 @@ endif::extra-openshift-testing-actions[]
ifndef::extra-openshift-test-arguments[:extra-openshift-test-arguments:]

Run the integration tests using the following command to run the `verify` goal with the `integration-testing` profile activated and the proper URL:
ifndef::requires-http-route[]
[source,options="nowrap",subs="+attributes"]
----
$ mvn verify -Pintegration-testing -Dserver.host=https://$(oc get route {helm-app-name} --template='{{ .spec.host }}') {extra-openshift-test-arguments}
----
endif::requires-http-route[]
ifdef::requires-http-route[]
[source,options="nowrap",subs="+attributes"]
----
$ mvn verify -Pintegration-testing -Dserver.host=http://$(oc get route {helm-app-name} --template='{{ .spec.host }}') {extra-openshift-test-arguments}
----
endif::requires-http-route[]

[NOTE]
====
Expand Down