[MOSIP-43100] Added Injiwallet uitestrigs (#2143)

* [MOSIP-43100] Added Injiwallet uitestrigs

Signed-off-by: Abhi <abhishek.shankarcs@gmail.com>

* [MOSIP-43100] Added Injiwallet uitestrigs

Signed-off-by: Abhi <abhishek.shankarcs@gmail.com>

* [MOSIP-43100] Added Injiwallet uitestrigs

Signed-off-by: Abhi <abhishek.shankarcs@gmail.com>

* [MOSIP-43100] Added Injiwallet uitestrigs

Signed-off-by: Abhi <abhishek.shankarcs@gmail.com>

* [MOSIP-43100] Added Injiwallet uitestrigs

Signed-off-by: Abhi <abhishek.shankarcs@gmail.com>

---------

Signed-off-by: Abhi <abhishek.shankarcs@gmail.com>
This commit is contained in:
Abhishek S
2025-11-27 11:53:17 +05:30
committed by GitHub
parent 17b9b928eb
commit ff9ee7184f
7 changed files with 765 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
# INJI-WALLET UITESTRIG
## Introduction
INJI-WALLET UITESTRIG is a UI automation test rig designed to validate end-to-end functional flows across INJI-WALLET applications.
It includes two cronjobs that automatically run UI test flows:
- **Android** Executes the complete Android UI functional flow.
- **iOS** Executes the complete iOS UI functional flow.
These cronjobs help ensure stability, correctness, and consistency across both mobile platforms before releases or environment changes.
## Prerequisites
Before installing INJI-WALLET UITESTRIG, you must update the required configuration in the `values.yaml` file.
The following fields must be reviewed and updated:
- Enable or disable the Android/iOS test modules.
- Add or modify environment-specific values.
- Verify correct cron schedules for automated execution.
Ensure all values are correctly configured before initiating the installation.
## Install
To install INJI-WALLET UITESTRIG, run:
```
./install.sh
```
## Uninstall
To Uninstall INJI-WALLET UITESTRIG, run:
```
./delete.sh
```

8
deploy/uitestrig/copy_cm.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
# Copy configmaps from other namespaces
# DST_NS: Destination namespace
COPY_UTIL=./copy_cm_func.sh
DST_NS=injiuitestrig
$COPY_UTIL configmap global default $DST_NS
$COPY_UTIL configmap keycloak-host keycloak $DST_NS
$COPY_UTIL configmap db postgres $DST_NS

View File

@@ -0,0 +1,28 @@
#!/bin/bash
# Copy configmap and secret from one namespace to another.
# ./copy_cm_func.sh <resource> <configmap_name> <source_namespace> <destination_namespace> [name]
# Parameters:
# resource: configmap|secret
# name: Optional new name of the configmap or secret in destination namespace. This may be needed if there is
# clash of names
if [ $1 = "configmap" ]
then
RESOURCE=configmap
elif [ $1 = "secret" ]
then
RESOURCE=secret
else
echo "Incorrect resource $1. Exiting.."
exit 1
fi
if [ $# -ge 5 ]
then
kubectl -n $4 delete --ignore-not-found=true $RESOURCE $5
kubectl -n $3 get $RESOURCE $2 -o yaml | sed "s/namespace: $3/namespace: $4/g" | sed "s/name: $2/name: $5/g" | kubectl -n $4 create -f -
else
kubectl -n $4 delete --ignore-not-found=true $RESOURCE $2
kubectl -n $3 get $RESOURCE $2 -o yaml | sed "s/namespace: $3/namespace: $4/g" | kubectl -n $4 create -f -
fi

View File

@@ -0,0 +1,5 @@
COPY_UTIL=./copy_cm_func.sh
DST_NS=injiuitestrig
$COPY_UTIL secret keycloak-client-secrets keycloak $DST_NS
$COPY_UTIL secret s3 s3 $DST_NS
$COPY_UTIL secret postgres-postgresql postgres $DST_NS

37
deploy/uitestrig/delete.sh Executable file
View File

@@ -0,0 +1,37 @@
#!/bin/bash
# Deletes INJI UITESTRIG deployment
# Usage: ./delete.sh [kubeconfig]
# If kubeconfig is provided, export it
if [ $# -ge 1 ] ; then
export KUBECONFIG=$1
fi
NS="injiuitestrig"
RELEASE_NAME="injiuitestrig"
echo "Deleting INJI UITESTRIG from namespace: $NS"
# Check if namespace exists
kubectl get ns $NS >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Namespace $NS does not exist. Nothing to delete."
exit 0
fi
# Uninstall Helm release
echo "Uninstalling helm release $RELEASE_NAME..."
helm uninstall $RELEASE_NAME -n $NS
# Verify uninstall
if [ $? -ne 0 ]; then
echo "Helm uninstall failed or release not found."
else
echo "Helm release removed successfully."
fi
# Delete namespace
echo "Deleting namespace $NS..."
kubectl delete ns $NS --ignore-not-found=true
echo "Cleanup completed."

109
deploy/uitestrig/install.sh Executable file
View File

@@ -0,0 +1,109 @@
#!/bin/bash
# Installs uitestrig automation
## Usage: ./install.sh [kubeconfig]
if [ $# -ge 1 ] ; then
export KUBECONFIG=$1
fi
NS=injiuitestrig
CHART_VERSION=0.0.1-develop
echo Create $NS namespace
kubectl create ns $NS
function installing_uitestrig() {
ENV_NAME=$( kubectl -n default get cm global -o json | jq -r '.data."installation-domain"' )
read -p "Please enter the time(hr) to run the cronjob every day (time: 0-23) : " time
if [ -z "$time" ]; then
echo "ERROR: Time cannot be empty; EXITING!";
exit 1;
fi
if ! [ $time -eq $time ] 2>/dev/null; then
echo "ERROR: Time $time is not a number; EXITING;";
exit 1;
fi
if [ $time -gt 23 ] || [ $time -lt 0 ] ; then
echo "ERROR: Time should be in range ( 0-23 ); EXITING;";
exit 1;
fi
echo "Do you have public domain & valid SSL? (Y/n) "
echo "Y: if you have public domain & valid ssl certificate"
echo "n: if you don't have public domain & valid ssl certificate"
read -p "" flag
if [ -z "$flag" ]; then
echo "'flag' was not provided; EXITING;"
exit 1;
fi
ENABLE_INSECURE=''
if [ "$flag" = "n" ]; then
ENABLE_INSECURE='--set uitestrig.configmaps.uitestrig.ENABLE_INSECURE=true';
fi
echo Istio label
kubectl label ns $NS istio-injection=disabled --overwrite
helm repo update
echo Copy configmaps
./copy_cm.sh
echo Copy secrets
./copy_secrets.sh
DB_HOST=$( kubectl -n default get cm global -o json | jq -r '.data."mosip-api-internal-host"' )
API_INTERNAL_HOST=$( kubectl -n default get cm global -o json | jq -r '.data."mosip-api-internal-host"' )
echo ""
echo "Have you updated the values.yaml file with the required changes? (Y/n)"
read -p "" values_flag
if [ -z "$values_flag" ]; then
echo "No input provided. Exiting."
exit 1
fi
case "$values_flag" in
Y|y)
echo "Proceeding with deployment..."
;;
N|n)
echo "Please update values.yaml before running the script. Exiting!"
exit 1
;;
*)
echo "Invalid input. Please answer Y or n. Exiting!"
exit 1
;;
esac
echo Installing uitestrig
helm -n $NS install injiuitestrig mosip/uitestrig \
-f values.yaml \
--set crontime="0 $time * * *" \
--version $CHART_VERSION \
--set uitestrig.configmaps.s3.s3-host='http://minio.minio:9000' \
--set uitestrig.configmaps.s3.s3-user-key='admin' \
--set uitestrig.configmaps.s3.s3-region='' \
--set uitestrig.configmaps.db.db-server="$DB_HOST" \
--set uitestrig.configmaps.db.db-su-user="postgres" \
--set uitestrig.configmaps.db.db-port="5432" \
--set uitestrig.configmaps.uitestrig.apiInternalEndPoint="https://$API_INTERNAL_HOST" \
--set uitestrig.configmaps.uitestrig.apiEnvUser="$API_INTERNAL_HOST" \
--set uitestrig.configmaps.uitestrig.NS="$NS" \
$ENABLE_INSECURE
return 0
}
# set commands for error handling.
set -e
set -o errexit
set -o nounset
set -o errtrace
set -o pipefail
installing_uitestrig # calling function

View File

@@ -0,0 +1,545 @@
## Global Docker image parameters
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
## Current available global Docker image parameters: imageRegistry and imagePullSecrets
##
# global:
# imageRegistry: myRegistryName
# imagePullSecrets:
# - myRegistryKeySecretName
# storageClass: myStorageClass
## Add labels to all the deployed resources
##
commonLabels:
app.kubernetes.io/component: mosip
## Add annotations to all the deployed resources
##
commonAnnotations: {}
## Kubernetes Cluster Domain
##
clusterDomain: cluster.local
## Extra objects to deploy (value evaluated as a template)
##
extraDeploy: []
## Number of nodes
##
replicaCount: 1
service:
type: ClusterIP
port: 80
## loadBalancerIP for the SuiteCRM Service (optional, cloud specific)
## ref: http://kubernetes.io/docs/user-guide/services/#type-loadbalancer
##
## loadBalancerIP:
##
## nodePorts:
## http: <to set explicitly, choose port between 30000-32767>
## https: <to set explicitly, choose port between 30000-32767>
##
nodePorts:
http: ""
https: ""
## Enable client source IP preservation
## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip
##
externalTrafficPolicy: Cluster
image:
registry: docker.io
repository: mosipdev/pmptest
tag: develop
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
##
pullPolicy: Always
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistryKeySecretName
## Port on which this particular spring service module is running.
springServicePort: 8083
## Configure extra options for liveness and readiness probes
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes
##
##
# existingConfigmap:
## Command and args for running the container (set to default if not set). Use array form
##
command: ['/bin/bash']
args: ['-c', "/home/${container_user}/scripts/fetch_docker_image_hash_ids.sh"]
## Deployment pod host aliases
## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/
##
hostAliases: []
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
resources:
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
limits:
cpu: 1000m
memory: 3500Mi
requests:
cpu: 1000m
memory: 3500Mi
additionalResources:
## Specify any JAVA_OPTS string here. These typically will be specified in conjunction with above resources
## Example: java_opts: "-Xms500M -Xmx500M"
javaOpts: "-Xms3500M -Xmx3500M"
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container
## Clamav container already runs as 'mosip' user, so we may not need to enable this
containerSecurityContext:
enabled: false
runAsUser: mosip
runAsNonRoot: true
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
##
podSecurityContext:
enabled: false
fsGroup: 1001
## Pod affinity preset
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
## Allowed values: soft, hard
##
podAffinityPreset: ""
## Pod anti-affinity preset
## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
## Allowed values: soft, hard
##
podAntiAffinityPreset: soft
## Node affinity preset
## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
## Allowed values: soft, hard
##
nodeAffinityPreset:
## Node affinity type
## Allowed values: soft, hard
##
type: ""
## Node label key to match
## E.g.
## key: "kubernetes.io/e2e-az-name"
##
key: ""
## Node label values to match
## E.g.
## values:
## - e2e-az1
## - e2e-az2
##
values: []
## Affinity for pod assignment. Evaluated as a template.
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
##
affinity: {}
## Node labels for pod assignment. Evaluated as a template.
## ref: https://kubernetes.io/docs/user-guide/node-selection/
##
nodeSelector: {}
## Tolerations for pod assignment. Evaluated as a template.
## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
##
tolerations: []
## Pod extra labels
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
##
podLabels: {}
## Annotations for server pods.
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
##
podAnnotations: {}
## pods' priority.
## ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
##
# priorityClassName: ""
## lifecycleHooks for the container to automate configuration before or after startup.
##
lifecycleHooks: {}
## Custom Liveness probes for
##
customLivenessProbe: {}
## Custom Rediness probes
##
customReadinessProbe: {}
## Update strategy - only really applicable for deployments with RWO PVs attached
## If replicas = 1, an update can get "stuck", as the previous pod remains attached to the
## PV, and the "incoming" pod can never start. Changing the strategy to "Recreate" will
## terminate the single previous pod, so that the new, incoming pod can attach to the PV
##
updateStrategy:
type: RollingUpdate
## Additional environment variables to set
## Example:
## extraEnvVars:
## - name: FOO
## value: "bar"
##
extraEnvVars: []
## ConfigMap with extra environment variables
##
extraEnvVarsCM:
- global
- s3
- keycloak-host
- db
- uitestrig
## Secret with extra environment variables
##
extraEnvVarsSecret:
- s3
- keycloak-client-secrets
- postgres-postgresql
## Extra volumes to add to the deployment
##
extraVolumes: []
## Extra volume mounts to add to the container
##
extraVolumeMounts: []
## Add init containers to the pods.
## Example:
## initContainers:
## - name: your-image-name
## image: your-image
## imagePullPolicy: Always
## ports:
## - name: portname
## containerPort: 1234
##
initContainers:
- command:
- /bin/bash
- -c
- if [ "$ENABLE_INSECURE" = "true" ]; then HOST=$( env | grep "mosip-api-internal-host"
|sed "s/mosip-api-internal-host=//g"); if [ -z "$HOST" ]; then echo "HOST
$HOST is empty; EXITING"; exit 1; fi; openssl s_client -servername "$HOST"
-connect "$HOST":443 > "$HOST.cer" 2>/dev/null & sleep 2 ; sed -i -ne '/-BEGIN
CERTIFICATE-/,/-END CERTIFICATE-/p' "$HOST.cer"; cat "$HOST.cer"; /usr/local/openjdk-11/bin/keytool
-delete -alias "$HOST" -keystore $JAVA_HOME/lib/security/cacerts -storepass
changeit; /usr/local/openjdk-11/bin/keytool -trustcacerts -keystore "$JAVA_HOME/lib/security/cacerts"
-storepass changeit -noprompt -importcert -alias "$HOST" -file "$HOST.cer"
; if [ $? -gt 0 ]; then echo "Failed to add SSL certificate for host $host;
EXITING"; exit 1; fi; cp /usr/local/openjdk-11/lib/security/cacerts /cacerts;
fi
env:
- name: ENABLE_INSECURE
value: "true"
envFrom:
- configMapRef:
name: global
- configMapRef:
name: uitestrig
image: docker.io/openjdk:11-jre
imagePullPolicy: Always
name: cacerts
resources: {}
securityContext:
runAsUser: 0
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /cacerts
name: cacerts
## Add sidecars to the pods.
## Example:
## sidecars:
## - name: your-image-name
## image: your-image
## imagePullPolicy: Always
## ports:
## - name: portname
## containerPort: 1234
##
sidecars: {}
persistence:
enabled: true
## If defined, storageClassName: <storageClass>
## If set to "-", storageClassName: "", which disables dynamic provisioning
## If undefined (the default) or set to null, no storageClassName spec is
## set, choosing the default provisioner. (gp2 on AWS, standard on
## GKE, AWS & OpenStack).
##
# storageClass: "-"
##
## If you want to reuse an existing claim, you can pass the name of the PVC using
## the existingClaim variable
# existingClaim: your-claim
## ReadWriteMany not supported by AWS gp2
storageClass:
accessModes:
- ReadWriteOnce
size: 100m
## Init containers parameters:
## volumePermissions: Change the owner and group of the persistent volume mountpoint to runAsUser:fsGroup values from the securityContext section.
##
volumePermissions:
enabled: false
image:
registry: docker.io
repository: mosipid/os-shell
tag: "12-debian-12-r46"
pullPolicy: Always
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
pullSecrets: []
## - myRegistryKeySecretName
## Init containers' resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
resources:
## We usually recommend not to specify default resources and to leave this as a conscious
## choice for the user. This also increases chances charts run on environments with little
## resources, such as Minikube. If you do want to specify resources, uncomment the following
## lines, adjust them as necessary, and remove the curly braces after 'resources:'.
##
limits: {}
## cpu: 100m
## memory: 128Mi
##
requests: {}
## cpu: 100m
## memory: 128Mi
##
## Specifies whether RBAC resources should be created
##
rbac:
create: true
## Specifies whether a ServiceAccount should be created
##
serviceAccount:
create: true
## The name of the ServiceAccount to use.
## If not set and create is true, a name is generated using the fullname template
##
name:
## Prometheus Metrics
##
metrics:
enabled: false
## Prometheus pod annotations
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
##
podAnnotations:
prometheus.io/scrape: "true"
endpointPath:
## Prometheus Service Monitor
## ref: https://github.com/coreos/prometheus-operator
##
serviceMonitor:
## If the operator is installed in your cluster, set to true to create a Service Monitor Entry
##
enabled: true
## Specify the namespace in which the serviceMonitor resource will be created
##
# namespace: ""
## Specify the interval at which metrics should be scraped
##
interval: 10s
## Specify the timeout after which the scrape is ended
##
# scrapeTimeout: 30s
## Specify Metric Relabellings to add to the scrape endpoint
##
# relabellings:
## Specify honorLabels parameter to add the scrape endpoint
##
honorLabels: false
## Used to pass Labels that are used by the Prometheus installed in your cluster to select Service Monitors to work with
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec
##
additionalLabels: {}
## Custom PrometheusRule to be defined
## The value is evaluated as a template, so, for example, the value can depend on .Release or .Chart
## ref: https://github.com/coreos/prometheus-operator#customresourcedefinitions
##
prometheusRule:
enabled: false
additionalLabels: {}
namespace: ''
## List of rules, used as template by Helm.
## These are just examples rules inspired from https://awesome-prometheus-alerts.grep.to/rules.html
# rules:
# - alert: RabbitmqDown
# expr: rabbitmq_up{service="{{ template "rabbitmq.fullname" . }}"} == 0
# for: 5m
# labels:
# severity: error
rules: []
## Admin swagger should have only internal access. Hence linked to internal gateway
istio:
enabled: false
gateways:
- istio-system/internal
prefix:
corsPolicy:
allowOrigins:
- prefix: https://api-internal.sandbox.mosip.net
allowCredentials: true
allowHeaders:
- Accept
- Accept-Encoding
- Accept-Language
- Connection
- Content-Type
- Cookie
- Host
- Referer
- Sec-Fetch-Dest
- Sec-Fetch-Mode
- Sec-Fetch-Site
- Sec-Fetch-User
- Origin
- Upgrade-Insecure-Requests
- User-Agent
- sec-ch-ua
- sec-ch-ua-mobile
- sec-ch-ua-platform
- x-xsrf-token
- xsrf-token
allowMethods:
- GET
- POST
- PATCH
- PUT
- DELETE
modules:
- name: android
enabled: true
image:
registry: docker.io
repository: mosipdev/uitest-inji-wallet
tag: develop
extraEnvVarsCM:
- android
- name: ios
enabled: true
image:
registry: docker.io
repository: mosipdev/uitest-inji-wallet
tag: develop
extraEnvVarsCM:
- ios
crontime: "0 3 * * *" ## run cronjob every day at 3 AM (time hr: 0-23 )
uitestrig:
configmaps:
s3:
s3-host: 'http://minio.minio:9000'
s3-user-key: 'admin'
s3-region: ''
db:
db-port: '5432'
db-su-user: 'postgres'
db-server: 'api-internal.sandbox.xyz.net'
uitestrig:
apiInternalEndPoint: 'https://api-internal.sandbox.xyz.net'
apiEnvUser: 'api-internal.sandbox.xyz.net'
CHROME_DRIVER_CPU_LIMIT: "2"
CHROME_DRIVER_MEMORY: 3g
loginlang: sin
push-reports-to-s3: 'yes'
s3-account: Injiuitestrig
browserstack_username: <provide browserstack_username>
browserstack_accesskey: <provide browserstack_accesskey>
eSignet_resource_bundle_url: https://github.com/mosip/esignet/blob/v1.6.1/oidc-ui/public/locales/en.json
mosip_components_base_urls: auditmanager=api-internal.sandbox.xyz.net;idrepository=api-internal.sandbox.mosip.net;partnermanager=api-internal.sandbox.mosip.net;idauthentication=api-internal.sandbox.mosip.net;policymanager=api-internal.sandbox.mosip.net;authmanager=api-internal.sandbox.mosip.net;resident=api-internal.sandbox.mosip.net;preregistration=api-internal.sandbox.mosip.net;masterdata=api-internal.sandbox.mosip.net;idgenerator=api-internal.sandbox.mosip.net;
ENV_ENDPOINT: https://api-internal.sandbox.xyz.net
ENV_TESTLEVEL: smokeAndRegression
ENV_USER: api-internal.sandboxname
actuatorMimotoEndpoint: /v1/mimoto/actuator/env
eSignetbaseurl: https://esignet.sandbox.xyz.net
android:
browserstack_appId: <provide browserstack_appId>
browserstack_platformName: Android
browserstack_deviceName: <provide browserstack_deviceName> #eg: Google Pixel 7 Pro
browserstack_platformVersion: <provide browserstack_platformVersion> #eg: 13.0
browserstack_buildName: <provide browserstack_buildName> #eg: dev-int-inji Android Build
ENV_TESTNG_XML_FILE: androidRegression.xml
ENV_BROWSERSTACK_CONFIG: androidConfig.yml
ios:
browserstack_appId: <provide browserstack_appId>
browserstack_platformName: ios
browserstack_deviceName: <provide browserstack_deviceName> #eg:iPhone 13 Pro
browserstack_platformVersion: <provide browserstack_platformVersion> #eg:15
browserstack_buildName: <provide browserstack_buildName> #eg:dev-int-inji Ios Build
ENV_TESTNG_XML_FILE: iosRegression.xml
ENV_BROWSERSTACK_CONFIG: iosConfig.yml
scripts:
fetch_docker_image_hash_ids.sh: |
#!/bin/bash
sleep 5
export DOCKER_HASH_ID=$( kubectl get pod "$HOSTNAME" -n "$NS" -o jsonpath='{.status.containerStatuses[*].imageID}' | sed 's/ /\n/g' | grep -v 'istio' | sed 's/docker\-pullable\:\/\///g' )
export DOCKER_IMAGE=$( kubectl get pod "$HOSTNAME" -n "$NS" -o jsonpath='{.status.containerStatuses[*].image}' | sed 's/ /\n/g' | grep -v 'istio' | sed 's/docker\-pullable\:\/\///g' )
if [[ -z $DOCKER_HASH_ID ]]; then
echo "DOCKER_HASH_ID IS EMPTY;EXITING";
exit 1;
fi
echo "DOCKER_HASH_ID ; $DOCKER_HASH_ID"
echo "DOCKER_IMAGE : $DOCKER_IMAGE"
kubectl get pods -A -o=jsonpath='{range .items[*]}{.metadata.namespace}{","}{.metadata.labels.app\.kubernetes\.io\/name}{","}{.status.containerStatuses[?(@.name!="istio-proxy")].image}{","}{.status.containerStatuses[?(@.name!="istio-proxy")].imageID}{","}{.metadata.creationTimestamp}{"\n"}' | sed 's/ /\n/g' | grep -vE 'istio*|longhorn*|cattle*|rancher|kube' | sed 's/docker\-pullable\:\/\///g' | sort -u | sed '/,,,/d' | awk -F ',' 'BEGIN {print "{ \"POD_NAME\": \"'$(echo $HOSTNAME)'\", \"DOCKER_IMAGE\": \"'$(echo $DOCKER_IMAGE)'\", \"DOCKER_HASH_ID\": \"'$(echo $DOCKER_HASH_ID)'\", \"k8s-cluster-image-list\": ["} {print "{"} {print "\"namespace\": \"" $1 "\","} {print "\"app_name\": \"" $2 "\","} {print "\"docker_image_name\": \"" $3 "\","} {print "\"docker_image_id\": \"" $4 "\","} {print "\"creation_timestamp\": \"" $5 "\"" } {print "},"} END {print "]}"}' | sed -z 's/},\n]/}\n]/g' | jq -r . | tee -a images-list.json
## run entrypoint script
sleep 5
cd /home/${container_user}/
bash ./entrypoint.sh
secrets:
volumes:
configmaps:
scripts:
defaultMode: 0777
volumeMounts:
mountPath: '/home/mosip/scripts/'
enable_insecure: false