-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathkcfg.sh
More file actions
executable file
·34 lines (29 loc) · 1011 Bytes
/
kcfg.sh
File metadata and controls
executable file
·34 lines (29 loc) · 1011 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
######################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# SPDX-License-Identifier: MIT-0 #
######################################################################
. .env
function usage {
echo ""
echo "Usage $0 [kubeconfig_path] - configure pm platform for access to Kubernetes"
echo ""
echo " kubeconfig_path - optional location of the kube config file to encode"
echo " default: ~/.kube/config"
echo ""
}
if [ "$1" == "--help" ]; then
usage
else
KCFG=~/.kube/config
if [ ! "$1" == "" ]; then
KCFG=$1
fi
if [ "$OPERATING_SYSTEM" == "Linux" ]; then
./pm config set KCFG_ENC $(cat ${KCFG} | base64 -w 0)
elif [ "$OPERATING_SYSTEM" == "MacOS" ]; then
./pm config set KCFG_ENC $(cat ${KCFG} | base64 -b 0)
else
echo "Not implemented for current operating system $OPERATING_SYSTEM"
fi
fi