Currently when user tries to perform ‘kubectl kcp workload drain ’ we just see a message appearing which reads “cluster1 draining” but kcp does not check if any other synctarget exist and workload running are not seen any more in the pcluster.
Steps To Reproduce
Add a synctarget by running the command kubectl kcp workload sync knarracluster1 --syncer-image ghcr.io/kcp-dev/kcp/syncer:cf540bb -o - | KUBECONFIG=/home/knarra/Downloads/kubeconfig_411 kubectl apply -f -
Now make sure that deployment has been successfully synced
Run command kubectl kcp workload drain cluster1
Kcp just drains the cluster1 without checking if another synctarget exists in the location so that the workload could be moved.
Expected Behaviour
Before draining a synctarget kcp should actually check and give an error or warning message that there is no other synctarget that exists to have the workload scheduled on it.
Describe the bug
Currently when user tries to perform ‘kubectl kcp workload drain’ we just see a message appearing which reads “cluster1 draining” but kcp does not check if any other synctarget exist and workload running are not seen any more in the pcluster.
Steps To Reproduce
kubectl kcp workload sync knarracluster1 --syncer-image ghcr.io/kcp-dev/kcp/syncer:cf540bb -o - | KUBECONFIG=/home/knarra/Downloads/kubeconfig_411 kubectl apply -f -
kubectl create deployment kuard --image gcr.io/kuar-demo/kuard-amd64:blue --dry-run=client -o yaml > kuard.yaml & kubectl apply -f kuard.yaml
kubectl kcp workload drain cluster1
Expected Behaviour
Before draining a synctarget kcp should actually check and give an error or warning message that there is no other synctarget that exists to have the workload scheduled on it.
Additional Context
No response