Skip to content

Commit 2e4895d

Browse files
reggeenrsmoser-ibm
authored andcommitted
Adjusted the private path example
1 parent 775db3c commit 2e4895d

2 files changed

Lines changed: 20 additions & 20 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM registry.access.redhat.com/ubi9/nodejs-22:latest AS build-env
1+
FROM registry.access.redhat.com/ubi9/nodejs-24:latest AS build-env
22
WORKDIR /job
33

44
# Define which files should be copied into the container image
@@ -8,7 +8,7 @@ COPY --chown=default:root *.mjs *.json .
88
RUN npm install
99

1010
# Use a small distroless image for as runtime image
11-
FROM gcr.io/distroless/nodejs22
11+
FROM gcr.io/distroless/nodejs24
1212
COPY --from=build-env /job /job
1313
WORKDIR /job
1414
CMD ["job.mjs"]

private-path-to-vpc-vsi/run

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ function check_prerequisites {
4646
print_error "'jq' tool is not installed"
4747
exit 1
4848
fi
49+
50+
# Ensure that openssl tool is installed
51+
if ! command -v openssl &>/dev/null; then
52+
print_error "'openssl' tool is not installed"
53+
exit 1
54+
fi
4955
}
5056

5157
# helper function to check whether IBM Cloud CLI plugins should get updated, or not
@@ -380,33 +386,27 @@ if [ $? -ne 0 ]; then
380386
fi
381387
project_guid=$(ibmcloud ce project current --output json | jq -r '.guid')
382388

383-
#
384-
# Obtain the kube context of the current project
385-
print_msg "\nObtain the kube context of the Code Engine project '$ce_project_name' ..."
386-
ibmcloud ce project select --name $ce_project_name --kubecfg
387-
388389
#
389390
# Create the private path integration
391+
390392
ce_vpegatewayconnection_name=guestbook-integration
391-
kubectl apply -f - <<EOF
392-
apiVersion: codeengine.cloud.ibm.com/v1beta1
393-
kind: VpeGatewayConnection
394-
metadata:
395-
name: $ce_vpegatewayconnection_name
396-
spec:
397-
target:
398-
crn: $pps_instance_crn
399-
resourceType: private_path_service_gateway
400-
EOF
393+
ibmcloud ce connectivity outbound create \
394+
--name $ce_vpegatewayconnection_name \
395+
--format private_path_service_gateway \
396+
--pps-crn $pps_instance_crn
397+
if [ $? -ne 0 ]; then
398+
print_error "Failed to create the private path gateway!"
399+
abortScript
400+
fi
401401

402402
print_msg "\nWaiting for the Private Path integration '$ce_vpegatewayconnection_name' to become ready ..."
403403
COUNTER=0
404-
while ! [[ $(kubectl get vpegatewayconnection $ce_vpegatewayconnection_name -o JSON|jq -r '.status|.conditions|.[]|select(.type=="Ready")|.status') == "True" ]]; do
404+
while ! [[ $(ibmcloud ce connectivity outbound get -n $ce_vpegatewayconnection_name -o json|jq -r '.status') == "ready" ]]; do
405405
sleep 5
406406
COUNTER=$((COUNTER + 1))
407407
if ((COUNTER > 30)); then
408-
kubectl get vpegatewayconnection $ce_vpegatewayconnection_name -o YAML
409-
print_error "The Private Path integration does not became ready as expected. Perform 'kubectl get vpegatewayconnection $ce_vpegatewayconnection_name -o yaml' for further details."
408+
ibmcloud ce connectivity outbound get -n $ce_vpegatewayconnection_name -o json
409+
print_error "The Private Path integration does not became ready as expected. Perform 'ibmcloud ce connectivity outbound get -n $ce_vpegatewayconnection_name -o json' for further details."
410410
abortScript
411411
fi
412412
done

0 commit comments

Comments
 (0)