pipeline #8
This commit is contained in:
parent
a4df93c326
commit
9b8dd00dd2
|
|
@ -118,18 +118,26 @@ jobs:
|
|||
kubectl version --client
|
||||
|
||||
- name: Configure kubectl
|
||||
env:
|
||||
KUBECTLSECRET: ${{ secrets.KUBECTLSECRET }}
|
||||
run: |
|
||||
mkdir -p ~/.kube
|
||||
|
||||
echo "🔍 Debugging KUBECTLSECRET..."
|
||||
echo "Secret length: ${#KUBECTLSECRET}"
|
||||
|
||||
# Check if secret is empty
|
||||
if [ "${#KUBECTLSECRET}" -eq 0 ]; then
|
||||
echo "❌ ERROR: KUBECTLSECRET is empty!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Try to decode as base64 first, if that fails, use as plain text
|
||||
if echo "${{ secrets.KUBECTLSECRET }}" | base64 -d > ~/.kube/config 2>/dev/null; then
|
||||
if echo "$KUBECTLSECRET" | base64 -d > ~/.kube/config 2>/dev/null; then
|
||||
echo "✅ KUBECTLSECRET decoded as base64"
|
||||
else
|
||||
echo "⚠️ KUBECTLSECRET is not base64, using as plain text"
|
||||
echo "${{ secrets.KUBECTLSECRET }}" > ~/.kube/config
|
||||
echo "$KUBECTLSECRET" > ~/.kube/config
|
||||
fi
|
||||
|
||||
echo "📁 kubeconfig created at ~/.kube/config"
|
||||
|
|
@ -139,8 +147,8 @@ jobs:
|
|||
echo "🔧 Fixing TLS verification for self-signed certificates..."
|
||||
|
||||
# Get all cluster names and add insecure-skip-tls-verify
|
||||
kubectl config get-clusters --no-headers | while read cluster; do
|
||||
if [ "$cluster" != "NAME" ]; then
|
||||
kubectl config get-clusters | tail -n +2 | while read cluster; do
|
||||
if [ -n "$cluster" ]; then
|
||||
echo "Setting insecure-skip-tls-verify for cluster: $cluster"
|
||||
kubectl config set-cluster "$cluster" --insecure-skip-tls-verify=true
|
||||
fi
|
||||
|
|
@ -339,18 +347,26 @@ jobs:
|
|||
kubectl version --client
|
||||
|
||||
- name: Configure kubectl
|
||||
env:
|
||||
KUBECTLSECRET: ${{ secrets.KUBECTLSECRET }}
|
||||
run: |
|
||||
mkdir -p ~/.kube
|
||||
|
||||
echo "🔍 Debugging KUBECTLSECRET..."
|
||||
echo "Secret length: ${#KUBECTLSECRET}"
|
||||
|
||||
# Check if secret is empty
|
||||
if [ "${#KUBECTLSECRET}" -eq 0 ]; then
|
||||
echo "❌ ERROR: KUBECTLSECRET is empty!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Try to decode as base64 first, if that fails, use as plain text
|
||||
if echo "${{ secrets.KUBECTLSECRET }}" | base64 -d > ~/.kube/config 2>/dev/null; then
|
||||
if echo "$KUBECTLSECRET" | base64 -d > ~/.kube/config 2>/dev/null; then
|
||||
echo "✅ KUBECTLSECRET decoded as base64"
|
||||
else
|
||||
echo "⚠️ KUBECTLSECRET is not base64, using as plain text"
|
||||
echo "${{ secrets.KUBECTLSECRET }}" > ~/.kube/config
|
||||
echo "$KUBECTLSECRET" > ~/.kube/config
|
||||
fi
|
||||
|
||||
echo "📁 kubeconfig created at ~/.kube/config"
|
||||
|
|
@ -360,8 +376,8 @@ jobs:
|
|||
echo "🔧 Fixing TLS verification for self-signed certificates..."
|
||||
|
||||
# Get all cluster names and add insecure-skip-tls-verify
|
||||
kubectl config get-clusters --no-headers | while read cluster; do
|
||||
if [ "$cluster" != "NAME" ]; then
|
||||
kubectl config get-clusters | tail -n +2 | while read cluster; do
|
||||
if [ -n "$cluster" ]; then
|
||||
echo "Setting insecure-skip-tls-verify for cluster: $cluster"
|
||||
kubectl config set-cluster "$cluster" --insecure-skip-tls-verify=true
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in New Issue