apiVersion: v1
kind: ConfigMap
metadata:
  annotations:
    operator.openyurt.io/skip-reconcile: "true"
  name: yurt-operator-trans-command-template
  namespace: kube-system
data:
  node-convert-cmd: |
    set -e
    cp -a /var/run/secrets/kubernetes.io/serviceaccount /tmp/serviceaccount
    nsenter -t 1 -m -u -n -i sh <<EOF
    if [ ! -d /var/run/secrets/kubernetes.io ]; then
      mkdir -p /var/run/secrets/kubernetes.io
    fi
    cp -a /var/tmp/serviceaccount /var/run/secrets/kubernetes.io/
    /var/tmp/edgectl convert --pod-manifests-path %v --node-name %v --node-type %v --trans-health-check-timeout %v --v=2
    rm -rf /var/run/secrets/kubernetes.io/serviceaccount
    exit
    EOF
    rm -rf /tmp/serviceaccount
  node-revert-cmd: |
    set -e
    cp -a /var/run/secrets/kubernetes.io/serviceaccount /tmp/serviceaccount
    nsenter -t 1 -m -u -n -i sh <<EOF
    if [ ! -d /var/run/secrets/kubernetes.io ]; then
      mkdir -p /var/run/secrets/kubernetes.io
    fi
    cp -a /var/tmp/serviceaccount /var/run/secrets/kubernetes.io/
    /var/tmp/edgectl revert --pod-manifests-path %v --node-name %v --trans-health-check-timeout %v --force --v=2
    rm -rf /var/run/secrets/kubernetes.io/serviceaccount
    exit
    EOF
    rm -rf /tmp/serviceaccount
