mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-09 21:48:04 -05:00
* [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>
29 lines
912 B
Bash
Executable File
29 lines
912 B
Bash
Executable File
#!/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
|