#!/usr/bin/env bash
# fake kubectl for phase-07-conductor-graft.sh tests.
# Only `kubectl api-versions` is used (7.3 DOCFIX-063 probe). Emits the served
# group/versions; steered by env NO_V1BETA1_CORE (drops cluster.x-k8s.io/v1beta1
# so the 7.3 core-group gate fails).
if [ "${1:-}" = "api-versions" ]; then
  cat <<'AV'
addons.cluster.x-k8s.io/v1beta1
addons.cluster.x-k8s.io/v1beta2
bootstrap.cluster.x-k8s.io/v1beta1
bootstrap.cluster.x-k8s.io/v1beta2
controlplane.cluster.x-k8s.io/v1beta1
controlplane.cluster.x-k8s.io/v1beta2
infrastructure.cluster.x-k8s.io/v1beta1
infrastructure.cluster.x-k8s.io/v1beta2
v1
AV
  if [ "${NO_V1BETA1_CORE:-0}" = 1 ]; then
    echo "cluster.x-k8s.io/v1beta2"
  else
    echo "cluster.x-k8s.io/v1beta1"
    echo "cluster.x-k8s.io/v1beta2"
  fi
fi
exit 0
