Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Working

Thearas Thearas

🎯
Working
View GitHub Profile
@Thearas
Thearas / build.yml
Created Feb 22, 2021
GitHub Action Rust MUSL Binary
View build.yml
name: Rust
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
@Thearas
Thearas / cleanup-pvc.sh
Created Apr 2, 2021
Cleanup dangling PVCs which were created by tidb-operator
View cleanup-pvc.sh
#!/bin/bash
set -xuo pipefail
IFS='
'
pvc2tcs=( $(kubectl get pvc -l app.kubernetes.io/managed-by=tidb-operator,app.kubernetes.io/name=tidb-cluster -o jsonpath="{range .items[*]}{.metadata.name}{' '}{.metadata.labels.app\.kubernetes\.io/instance}{'\n'}{end}") )
echo "Cleanup all dangling PVCs created by tidb-operator."
for pvc2tc in "${pvc2tcs[@]}"; do
pvc=$(echo "${pvc2tc}" | awk -F ' ' '{print $1}')
tc=$(echo "${pvc2tc}" | awk -F ' ' '{print $2}')